Skip to content

Commit dfceabd

Browse files
authored
dxexp - report advanced texture ops capability (microsoft#4677)
- add D3D12_FEATURE_DATA_D3D12_OPTIONS14 definition if not supported by current WinSDK - move all D3D_SHADER_MODEL defines into one spot
1 parent 6c7ad3e commit dfceabd

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

tools/dxexp/dxexp.cpp

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ static HRESULT AtlCheck(HRESULT hr) {
4545

4646
// Not defined in Creators Update version of d3d12.h:
4747
#if WDK_NTDDI_VERSION <= NTDDI_WIN10_RS2
48-
#define D3D_SHADER_MODEL_6_1 ((D3D_SHADER_MODEL)0x61)
4948
#define D3D12_FEATURE_D3D12_OPTIONS3 ((D3D12_FEATURE)21)
5049
typedef
5150
enum D3D12_COMMAND_LIST_SUPPORT_FLAGS
@@ -83,7 +82,6 @@ typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS3
8382
#endif
8483

8584
#if WDK_NTDDI_VERSION <= NTDDI_WIN10_RS3
86-
#define D3D_SHADER_MODEL_6_2 ((D3D_SHADER_MODEL)0x62)
8785
#define D3D12_FEATURE_D3D12_OPTIONS4 ((D3D12_FEATURE)23)
8886
typedef enum D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER
8987
{
@@ -104,7 +102,6 @@ typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS4
104102
#endif
105103

106104
#if WDK_NTDDI_VERSION <= NTDDI_WIN10_RS4
107-
#define D3D_SHADER_MODEL_6_3 ((D3D_SHADER_MODEL)0x63)
108105
#define D3D12_FEATURE_D3D12_OPTIONS5 ((D3D12_FEATURE)27)
109106
typedef enum D3D12_RENDER_PASS_TIER
110107
{
@@ -128,21 +125,27 @@ typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS5
128125
} D3D12_FEATURE_DATA_D3D12_OPTIONS5;
129126
#endif
130127

131-
#ifndef NTDDI_WIN10_RS5
132-
#define NTDDI_WIN10_RS5 0x0A000006
133-
#endif
134-
135-
#if WDK_NTDDI_VERSION <= NTDDI_WIN10_RS5
136-
#define D3D_SHADER_MODEL_6_4 ((D3D_SHADER_MODEL)0x64)
128+
#ifndef NTDDI_WIN10_NI
129+
#define NTDDI_WIN10_NI 0x0A00000C
137130
#endif
138131

139-
// TODO: Place under new version once available
140-
#if WDK_NTDDI_VERSION <= NTDDI_WIN10_RS5
141-
#define D3D_SHADER_MODEL_6_5 ((D3D_SHADER_MODEL)0x65)
132+
#if WDK_NTDDI_VERSION <= NTDDI_WIN10_NI
133+
#define D3D12_FEATURE_D3D12_OPTIONS14 ((D3D12_FEATURE)43)
134+
typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS14
135+
{
136+
_Out_ BOOL AdvancedTextureOpsSupported;
137+
_Out_ BOOL WriteableMSAATexturesSupported;
138+
_Out_ BOOL IndependentFrontAndBackStencilRefMaskSupported;
139+
} D3D12_FEATURE_DATA_D3D12_OPTIONS14;
142140
#endif
143141

144142
#pragma warning( disable : 4063 )
145143
#define D3D12_RAYTRACING_TIER_1_1 ((D3D12_RAYTRACING_TIER)11)
144+
#define D3D_SHADER_MODEL_6_1 ((D3D_SHADER_MODEL)0x61)
145+
#define D3D_SHADER_MODEL_6_2 ((D3D_SHADER_MODEL)0x62)
146+
#define D3D_SHADER_MODEL_6_3 ((D3D_SHADER_MODEL)0x63)
147+
#define D3D_SHADER_MODEL_6_4 ((D3D_SHADER_MODEL)0x64)
148+
#define D3D_SHADER_MODEL_6_5 ((D3D_SHADER_MODEL)0x65)
146149
#define D3D_SHADER_MODEL_6_6 ((D3D_SHADER_MODEL)0x66)
147150
#define D3D_SHADER_MODEL_6_7 ((D3D_SHADER_MODEL)0x67)
148151
#define D3D_SHADER_MODEL_6_8 ((D3D_SHADER_MODEL)0x68)
@@ -229,21 +232,26 @@ static HRESULT PrintAdapters() {
229232
D3D12_FEATURE_DATA_D3D12_OPTIONS3 DeviceOptions3;
230233
D3D12_FEATURE_DATA_D3D12_OPTIONS4 DeviceOptions4;
231234
D3D12_FEATURE_DATA_D3D12_OPTIONS5 DeviceOptions5;
235+
D3D12_FEATURE_DATA_D3D12_OPTIONS14 DeviceOptions14;
236+
232237
memset(&DeviceOptions, 0, sizeof(DeviceOptions));
233238
memset(&DeviceOptions3, 0, sizeof(DeviceOptions3));
234239
memset(&DeviceOptions4, 0, sizeof(DeviceOptions4));
235240
memset(&DeviceOptions5, 0, sizeof(DeviceOptions5));
241+
memset(&DeviceOptions14, 0, sizeof(DeviceOptions14));
236242
D3D12_FEATURE_DATA_SHADER_MODEL DeviceSM;
237243
AtlCheck(pAdapter->GetDesc1(&AdapterDesc));
238244
AtlCheck(D3D12CreateDevice(pAdapter, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&pDevice)));
239245
AtlCheck(pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1, &DeviceOptions, sizeof(DeviceOptions)));
240246
pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS3, &DeviceOptions3, sizeof(DeviceOptions3));
241247
pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS4, &DeviceOptions4, sizeof(DeviceOptions4));
242248
pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS5, &DeviceOptions5, sizeof(DeviceOptions5));
249+
pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS14, &DeviceOptions14, sizeof(DeviceOptions14));
250+
243251
AtlCheck(GetHighestShaderModel(pDevice, DeviceSM));
244252
const char *Format = IsOutputJson ?
245-
"%c { \"name\": \"%S\", \"sm\": \"%s\", \"wave\": %s, \"i64\": %s, \"bary\": %s, \"view-inst\": \"%s\", \"16bit\": %s, \"raytracing\": \"%s\" }\n" :
246-
"%c %S - Highest SM [%s] Wave [%s] I64 [%s] Barycentrics [%s] View Instancing [%s] 16bit Support [%s] Raytracing [%s]\n";
253+
"%c { \"name\": \"%S\", \"sm\": \"%s\", \"wave\": %s, \"i64\": %s, \"bary\": %s, \"view-inst\": \"%s\", \"16bit\": %s, \"raytracing\": \"%s\", \"ato\":\"%s\" }\n" :
254+
"%c %S - Highest SM [%s] Wave [%s] I64 [%s] Barycentrics [%s] View Instancing [%s] 16bit Support [%s] Raytracing [%s] Advanced Texture Ops [%s]\n";
247255
printf(Format,
248256
comma,
249257
AdapterDesc.Description,
@@ -253,7 +261,8 @@ static HRESULT PrintAdapters() {
253261
BoolToStr(DeviceOptions3.BarycentricsSupported),
254262
ViewInstancingTierToStr(DeviceOptions3.ViewInstancingTier),
255263
BoolToStr(DeviceOptions4.Native16BitShaderOpsSupported),
256-
RaytracingTierToStr(DeviceOptions5.RaytracingTier)
264+
RaytracingTierToStr(DeviceOptions5.RaytracingTier),
265+
BoolToStr(DeviceOptions14.AdvancedTextureOpsSupported)
257266
);
258267
AdapterIndex++;
259268
comma = IsOutputJson ? ',' : ' ';

0 commit comments

Comments
 (0)