Add D3DFeatureLevel info to D2D1ShaderInfo type
このコミットが含まれているのは:
1 親
890172b719
コミット
4efa9b6168
6ファイル変更
+107
-2
検索条件に一致するファイルはありません
@@ -67,6 +67,10 @@ public static class D2D1ReflectionServices
|
||||
|
||||
d3D11ShaderReflection.Get()->GetDesc(&d3D11ShaderDescription).Assert();
|
||||
|
||||
D3D_FEATURE_LEVEL d3DFeatureLevel = default;
|
||||
|
||||
d3D11ShaderReflection.Get()->GetMinFeatureLevel(&d3DFeatureLevel).Assert();
|
||||
|
||||
return new(
|
||||
CompilerVersion: new string(d3D11ShaderDescription.Creator),
|
||||
HlslSource: hlslSource,
|
||||
@@ -92,6 +96,7 @@ public static class D2D1ReflectionServices
|
||||
MovcInstructionCount: d3D11ShaderReflection.Get()->GetMovcInstructionCount(),
|
||||
MovInstructionCount: d3D11ShaderReflection.Get()->GetMovInstructionCount(),
|
||||
InterfaceSlotCount: d3D11ShaderReflection.Get()->GetNumInterfaceSlots(),
|
||||
RequiresDoublePrecisionSupport: (d3D11ShaderReflection.Get()->GetRequiresFlags() & (D3D.D3D_SHADER_REQUIRES_DOUBLES | D3D.D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS)) != 0);
|
||||
RequiresDoublePrecisionSupport: (d3D11ShaderReflection.Get()->GetRequiresFlags() & (D3D.D3D_SHADER_REQUIRES_DOUBLES | D3D.D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS)) != 0,
|
||||
FeatureLevel: (D3DFeatureLevel)d3DFeatureLevel);
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ namespace ComputeSharp.D2D1.Interop;
|
||||
/// <param name="MovInstructionCount">The number of <c>mov</c> instructions used.</param>
|
||||
/// <param name="InterfaceSlotCount">The number of interface slots used.</param>
|
||||
/// <param name="RequiresDoublePrecisionSupport">Indicates whether support for double precision floating point numbers is required.</param>
|
||||
/// <param name="FeatureLevel">The feature level for the shader.</param>
|
||||
public sealed record D2D1ShaderInfo(
|
||||
string CompilerVersion,
|
||||
string HlslSource,
|
||||
@@ -53,4 +54,5 @@ public sealed record D2D1ShaderInfo(
|
||||
uint MovcInstructionCount,
|
||||
uint MovInstructionCount,
|
||||
uint InterfaceSlotCount,
|
||||
bool RequiresDoublePrecisionSupport);
|
||||
bool RequiresDoublePrecisionSupport,
|
||||
D3DFeatureLevel FeatureLevel);
|
||||
@@ -0,0 +1,69 @@
|
||||
using static TerraFX.Interop.DirectX.D3D_FEATURE_LEVEL;
|
||||
|
||||
namespace ComputeSharp.D2D1.Interop;
|
||||
|
||||
/// <summary>
|
||||
/// Describes the set of features targeted by a Direct3D device.
|
||||
/// </summary>
|
||||
public enum D3DFeatureLevel
|
||||
{
|
||||
/// <summary>
|
||||
/// Allows Microsoft Compute Driver Model (MCDM) devices to be used, or more feature-rich devices (such as
|
||||
/// traditional GPUs) that support a superset of the functionality. MCDM is the overall driver model for
|
||||
/// compute-only; it's a scaled-down peer of the larger scoped Windows Device Driver Model (WDDM).
|
||||
/// </summary>
|
||||
FeatureLevel1_0Core = D3D_FEATURE_LEVEL_1_0_CORE,
|
||||
|
||||
/// <summary>
|
||||
/// Targets features supported by <see href="https://learn.microsoft.com/windows/win32/direct3d11/overviews-direct3d-11-devices-downlevel-intro">feature level</see> 9.1, including shader model 2.
|
||||
/// </summary>
|
||||
FeatureLevel9_1 = D3D_FEATURE_LEVEL_9_1,
|
||||
|
||||
/// <summary>
|
||||
/// Targets features supported by <see href="https://learn.microsoft.com/windows/win32/direct3d11/overviews-direct3d-11-devices-downlevel-intro">feature level</see> 9.2, including shader model 2.
|
||||
/// </summary>
|
||||
FeatureLevel9_2 = D3D_FEATURE_LEVEL_9_2,
|
||||
|
||||
/// <summary>
|
||||
/// Targets features supported by <see href="https://learn.microsoft.com/windows/win32/direct3d11/overviews-direct3d-11-devices-downlevel-intro">feature level</see> 9.3, including shader model 2.
|
||||
/// </summary>
|
||||
FeatureLevel9_3 = D3D_FEATURE_LEVEL_9_3,
|
||||
|
||||
/// <summary>
|
||||
/// Targets features supported by Direct3D 10.0, including shader model 4.
|
||||
/// </summary>
|
||||
FeatureLevel10 = D3D_FEATURE_LEVEL_10_0,
|
||||
|
||||
/// <summary>
|
||||
/// Targets features supported by Direct3D 10.1, including shader model 4.
|
||||
/// </summary>
|
||||
FeatureLevel10_1 = D3D_FEATURE_LEVEL_10_1,
|
||||
|
||||
/// <summary>
|
||||
/// Targets features supported by Direct3D 11.0, including shader model 5.
|
||||
/// </summary>
|
||||
FeatureLevel11_0 = D3D_FEATURE_LEVEL_11_0,
|
||||
|
||||
/// <summary>
|
||||
/// Targets features supported by Direct3D 11.1, including shader model 5 and logical blend operations. This
|
||||
/// feature level requires a display driver that is at least implemented to WDDM for Windows 8 (WDDM 1.2).
|
||||
/// </summary>
|
||||
FeatureLevel11_1 = D3D_FEATURE_LEVEL_11_1,
|
||||
|
||||
/// <summary>
|
||||
/// Targets features supported by Direct3D 12.0, including shader model 5.
|
||||
/// </summary>
|
||||
FeatureLevel12 = D3D_FEATURE_LEVEL_12_0,
|
||||
|
||||
/// <summary>
|
||||
/// Targets features supported by Direct3D 12.1, including shader model 5.
|
||||
/// </summary>
|
||||
FeatureLevel12_1 = D3D_FEATURE_LEVEL_12_1,
|
||||
|
||||
/// <summary>
|
||||
/// Targets features supported by Direct3D 12.2, including shader model 6.5. For more information about feature
|
||||
/// level 12_2, see its <see href="https://microsoft.github.io/DirectX-Specs/d3d/D3D12_FeatureLevel12_2.html">specification page</see>.
|
||||
/// Feature level 12_2 is available in Windows SDK builds 20170 and later.
|
||||
/// </summary>
|
||||
FeatureLevel12_2 = D3D_FEATURE_LEVEL_12_2
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
|
||||
|
||||
// Ported from d3dcommon.h in microsoft/DirectX-Headers tag v1.606.4
|
||||
// Original source is Copyright © Microsoft. Licensed under the MIT license
|
||||
|
||||
namespace TerraFX.Interop.DirectX;
|
||||
|
||||
internal enum D3D_FEATURE_LEVEL
|
||||
{
|
||||
D3D_FEATURE_LEVEL_1_0_CORE = 0x1000,
|
||||
D3D_FEATURE_LEVEL_9_1 = 0x9100,
|
||||
D3D_FEATURE_LEVEL_9_2 = 0x9200,
|
||||
D3D_FEATURE_LEVEL_9_3 = 0x9300,
|
||||
D3D_FEATURE_LEVEL_10_0 = 0xa000,
|
||||
D3D_FEATURE_LEVEL_10_1 = 0xa100,
|
||||
D3D_FEATURE_LEVEL_11_0 = 0xb000,
|
||||
D3D_FEATURE_LEVEL_11_1 = 0xb100,
|
||||
D3D_FEATURE_LEVEL_12_0 = 0xc000,
|
||||
D3D_FEATURE_LEVEL_12_1 = 0xc100,
|
||||
D3D_FEATURE_LEVEL_12_2 = 0xc200
|
||||
}
|
||||
@@ -94,6 +94,13 @@ namespace TerraFX.Interop.DirectX
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D11ShaderReflection*, uint>)(lpVtbl[18]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(19)]
|
||||
public HRESULT GetMinFeatureLevel([NativeTypeName("enum D3D_FEATURE_LEVEL *")] D3D_FEATURE_LEVEL* pLevel)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D11ShaderReflection*, D3D_FEATURE_LEVEL*, int>)(lpVtbl[19]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this), pLevel);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(20)]
|
||||
public uint GetThreadGroupSize(uint* pSizeX, uint* pSizeY, uint* pSizeZ)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)..\TerraFX.Interop.Windows\DirectX\um\d3d11shader\D3D.cs" Link="DirectX\um\d3d11shader\D3D.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)DirectX\headers\d3dcommon\D3D_FEATURE_LEVEL.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)DirectX\um\d2d1effectauthor\D2D1_CHANGE_TYPE.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)DirectX\um\d2d1effectauthor\D2D1_FEATURE.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)DirectX\um\d2d1effectauthor\D2D1_FEATURE_DATA_DOUBLES.cs" />
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする