aboutsummaryrefslogtreecommitdiff
path: root/contrib/DirectX-Headers-1.618.2/googletest/feature_support_test.cpp
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-12-02 16:39:36 -0800
committer3gg <3gg@shellblade.net>2025-12-02 16:39:36 -0800
commit6c8ae19be66cee247980a48e736a4e05d14de179 (patch)
treed860767907bf0cbe17ec66422e11bea700cf56d9 /contrib/DirectX-Headers-1.618.2/googletest/feature_support_test.cpp
parent8f594c8ebd11f0e5f8a0c6369c3fe7383d250cbe (diff)
Immediate-mode renderer, triangle demo, shader compilation in cmake, Agility SDKHEADmain
Diffstat (limited to 'contrib/DirectX-Headers-1.618.2/googletest/feature_support_test.cpp')
-rw-r--r--contrib/DirectX-Headers-1.618.2/googletest/feature_support_test.cpp1354
1 files changed, 1354 insertions, 0 deletions
diff --git a/contrib/DirectX-Headers-1.618.2/googletest/feature_support_test.cpp b/contrib/DirectX-Headers-1.618.2/googletest/feature_support_test.cpp
new file mode 100644
index 0000000..0394384
--- /dev/null
+++ b/contrib/DirectX-Headers-1.618.2/googletest/feature_support_test.cpp
@@ -0,0 +1,1354 @@
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3#include "gtest/gtest.h"
4
5#include <wsl/winadapter.h>
6
7#include <directx/d3d12.h>
8#include <directx/dxcore.h>
9#include <directx/d3dx12.h>
10#include "dxguids/dxguids.h"
11
12#include "MockDevice.hpp"
13
14// Initiliaze the CD3DX12FeatureSupport instance
15// Can be modified to use new initialization methods if any comes up in the future
16#define INIT_FEATURES() \
17 CD3DX12FeatureSupport features; \
18 HRESULT InitResult = features.Init(device); \
19 EXPECT_EQ(features.GetStatus(), S_OK);
20
21// Testing class setup
22class FeatureSupportTest : public ::testing::Test {
23protected:
24 void SetUp() override {
25 device = new MockDevice(1);
26 }
27
28 void TearDown() override {
29 delete device;
30 }
31
32 MockDevice* device = nullptr;
33};
34
35// Test if the class can be initialized correctly
36TEST_F(FeatureSupportTest, Initialization) {
37 CD3DX12FeatureSupport features;
38 EXPECT_EQ(features.Init(device), S_OK);
39 EXPECT_EQ(features.GetStatus(), S_OK);
40}
41
42// 0: D3D12_OPTIONS
43// Arbitarily set support status for caps and see if the returned results are correct
44TEST_F(FeatureSupportTest, D3D12Options) {
45 device->m_DoublePrecisionFloatShaderOps = true;
46 device->m_OutputMergerLogicOp = true;
47 device->m_ShaderMinPrecisionSupport10Bit = D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT;
48 device->m_ShaderMinPrecisionSupport16Bit = D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT;
49 device->m_TiledResourcesTier = D3D12_TILED_RESOURCES_TIER_3;
50 device->m_ResourceBindingTier = D3D12_RESOURCE_BINDING_TIER_3;
51 device->m_PSSpecifiedStencilRefSupported = true;
52 device->m_ConservativeRasterizationTier = D3D12_CONSERVATIVE_RASTERIZATION_TIER_2;
53 device->m_MaxGPUVirtualAddressBitsPerResource = 10;
54 device->m_ResourceHeapTier = D3D12_RESOURCE_HEAP_TIER_2;
55
56 INIT_FEATURES();
57 EXPECT_TRUE(features.DoublePrecisionFloatShaderOps());
58 EXPECT_TRUE(features.OutputMergerLogicOp());
59 EXPECT_EQ(features.MinPrecisionSupport(), D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT | D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT);
60 EXPECT_EQ(features.TiledResourcesTier(), D3D12_TILED_RESOURCES_TIER_3);
61 EXPECT_EQ(features.ResourceBindingTier(), D3D12_RESOURCE_BINDING_TIER_3);
62 EXPECT_TRUE(features.PSSpecifiedStencilRefSupported());
63 EXPECT_FALSE(features.TypedUAVLoadAdditionalFormats());
64 EXPECT_FALSE(features.ROVsSupported());
65 EXPECT_EQ(features.ConservativeRasterizationTier(), D3D12_CONSERVATIVE_RASTERIZATION_TIER_2);
66 EXPECT_EQ(features.MaxGPUVirtualAddressBitsPerResource(), 10);
67 EXPECT_FALSE(features.StandardSwizzle64KBSupported());
68 EXPECT_EQ(features.CrossNodeSharingTier(), D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED);
69 EXPECT_FALSE(features.CrossAdapterRowMajorTextureSupported());
70 EXPECT_FALSE(features.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation());
71 EXPECT_EQ(features.ResourceHeapTier(), D3D12_RESOURCE_HEAP_TIER_2);
72}
73
74// 1: Architecture & 16: Architecture1
75// Test where architecture1 is available
76TEST_F(FeatureSupportTest, Architecture1Available)
77{
78 device->m_Architecture1Available = true;
79 device->m_TileBasedRenderer[0] = false;
80 device->m_UMA[0] = true;
81 device->m_CacheCoherentUMA[0] = true;
82 device->m_IsolatedMMU[0] = true;
83
84 INIT_FEATURES();
85 EXPECT_FALSE(features.TileBasedRenderer(0));
86 EXPECT_TRUE(features.UMA(0));
87 EXPECT_TRUE(features.CacheCoherentUMA(0));
88 EXPECT_TRUE(features.IsolatedMMU(0));
89}
90
91// Test where architecture1 is not available
92TEST_F(FeatureSupportTest, Architecture1Unavailable)
93{
94 device->m_Architecture1Available = false; // Architecture1 not available
95 device->m_TileBasedRenderer[0] = false;
96 device->m_UMA[0] = true;
97 device->m_CacheCoherentUMA[0] = false;
98 device->m_IsolatedMMU[0] = true; // Notice that if architecture1 is not available, IslatedMMU cap should not be present
99
100 INIT_FEATURES();
101 EXPECT_FALSE(features.TileBasedRenderer(0));
102 EXPECT_TRUE(features.UMA(0));
103 EXPECT_FALSE(features.CacheCoherentUMA(0));
104 EXPECT_FALSE(features.IsolatedMMU(0)); // If Architecture1 is not available, IsolatedMMU should not be available
105}
106
107// Test on devices with more than one graphics node
108TEST_F(FeatureSupportTest, ArchitectureMultinode)
109{
110 device->SetNodeCount(3);
111 device->m_Architecture1Available = true;
112 device->m_TileBasedRenderer = {false, true, true};
113 device->m_UMA = {true, false, false};
114 device->m_CacheCoherentUMA = {false, false, true};
115 device->m_IsolatedMMU = {false, true, false};
116
117 INIT_FEATURES();
118
119 EXPECT_FALSE(features.TileBasedRenderer(0));
120 EXPECT_TRUE(features.TileBasedRenderer(1));
121 EXPECT_TRUE(features.TileBasedRenderer(2));
122
123 EXPECT_TRUE(features.UMA(0));
124 EXPECT_FALSE(features.UMA(1));
125 EXPECT_FALSE(features.UMA(2));
126
127 EXPECT_FALSE(features.CacheCoherentUMA(0));
128 EXPECT_FALSE(features.CacheCoherentUMA(1));
129 EXPECT_TRUE(features.CacheCoherentUMA(2));
130
131 EXPECT_FALSE(features.IsolatedMMU(0));
132 EXPECT_TRUE(features.IsolatedMMU(1));
133 EXPECT_FALSE(features.IsolatedMMU(2));
134}
135
136// 2: Feature Levels
137// Basic test with a high feature level
138TEST_F(FeatureSupportTest, FeatureLevelBasic)
139{
140 device->m_FeatureLevel = D3D_FEATURE_LEVEL_12_2;
141
142 INIT_FEATURES();
143 EXPECT_EQ(features.MaxSupportedFeatureLevel(), D3D_FEATURE_LEVEL_12_2);
144}
145
146// Test through all supported feature levels
147TEST_F(FeatureSupportTest, FeatureLevelAll)
148{
149 std::vector<D3D_FEATURE_LEVEL> allLevels =
150 {
151 D3D_FEATURE_LEVEL_1_0_CORE,
152 D3D_FEATURE_LEVEL_9_1,
153 D3D_FEATURE_LEVEL_9_2,
154 D3D_FEATURE_LEVEL_9_3,
155 D3D_FEATURE_LEVEL_10_0,
156 D3D_FEATURE_LEVEL_10_1,
157 D3D_FEATURE_LEVEL_11_0,
158 D3D_FEATURE_LEVEL_11_1,
159 D3D_FEATURE_LEVEL_12_0,
160 D3D_FEATURE_LEVEL_12_1,
161 D3D_FEATURE_LEVEL_12_2
162 };
163
164 for (unsigned int i = 0; i < allLevels.size(); i++)
165 {
166 device->m_FeatureLevel = allLevels[i];
167 INIT_FEATURES();
168 EXPECT_EQ(features.MaxSupportedFeatureLevel(), allLevels[i]);
169 }
170}
171
172// Test with a feature level higher than the current highest level
173TEST_F(FeatureSupportTest, FeatureLevelHigher)
174{
175 device->m_FeatureLevel = (D3D_FEATURE_LEVEL)(D3D_FEATURE_LEVEL_12_2 + 1);
176 INIT_FEATURES();
177 EXPECT_EQ(features.MaxSupportedFeatureLevel(), D3D_FEATURE_LEVEL_12_2);
178}
179
180// 3: Format Support
181// Forward call to the old API. Basic correctness check
182// Note: The input and return value of this test is arbitrary and does not reflect the results of running on real devices
183// The test only checks if the input and output are correctly passed to the inner API and the user.
184// Same applies to Multisample Quality Levels (4) and Format Info (5)
185TEST_F(FeatureSupportTest, FormatSupportPositive)
186{
187 device->m_FormatSupport1 = D3D12_FORMAT_SUPPORT1_BUFFER | D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_COMPARISON | D3D12_FORMAT_SUPPORT1_DECODER_OUTPUT;
188 device->m_FormatSupport2 = D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_ADD | D3D12_FORMAT_SUPPORT2_TILED;
189
190 INIT_FEATURES();
191
192 D3D12_FORMAT_SUPPORT1 support1;
193 D3D12_FORMAT_SUPPORT2 support2;
194
195 HRESULT result = features.FormatSupport(DXGI_FORMAT_R32G32_UINT, support1, support2); // Some random input
196 EXPECT_EQ(support1, D3D12_FORMAT_SUPPORT1_BUFFER | D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_COMPARISON | D3D12_FORMAT_SUPPORT1_DECODER_OUTPUT);
197 EXPECT_EQ(support2, D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_ADD | D3D12_FORMAT_SUPPORT2_TILED);
198 EXPECT_EQ(result, S_OK);
199}
200
201// Negative test
202TEST_F(FeatureSupportTest, FormatSupportNegative)
203{
204 device->m_FormatSupport1 = D3D12_FORMAT_SUPPORT1_NONE;
205 device->m_FormatSupport2 = D3D12_FORMAT_SUPPORT2_NONE;
206 INIT_FEATURES();
207
208 D3D12_FORMAT_SUPPORT1 support1;
209 D3D12_FORMAT_SUPPORT2 support2;
210
211 HRESULT result = features.FormatSupport(DXGI_FORMAT_UNKNOWN, support1, support2);
212 EXPECT_EQ(support1, D3D12_FORMAT_SUPPORT1_NONE);
213 EXPECT_EQ(support2, D3D12_FORMAT_SUPPORT2_NONE);
214 EXPECT_EQ(result, E_FAIL);
215}
216
217// 4: Multisample Quality Levels
218// Forwarding call. Check if the API received the correct information.
219TEST_F(FeatureSupportTest, MultisampleQualityLevelsPositive)
220{
221 device->m_NumQualityLevels = 42; // Arbitrary return value
222
223 INIT_FEATURES();
224
225 DXGI_FORMAT inFormat = DXGI_FORMAT_R16G16B16A16_FLOAT;
226 UINT inSampleCount = 10;
227 D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS inFlags = D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE;
228 UINT NumQualityLevels;
229
230 HRESULT result = features.MultisampleQualityLevels(inFormat, inSampleCount, inFlags, NumQualityLevels);
231
232 EXPECT_EQ(device->m_FormatReceived, inFormat);
233 EXPECT_EQ(device->m_SampleCountReceived, inSampleCount);
234 EXPECT_EQ(device->m_MultisampleQualityLevelFlagsReceived, inFlags);
235 EXPECT_EQ(result, S_OK);
236 EXPECT_EQ(NumQualityLevels, 42);
237}
238
239// Test where the feature check fails
240TEST_F(FeatureSupportTest, MultisampleQualityLevelsNegative)
241{
242 device->m_NumQualityLevels = 42;
243 device->m_MultisampleQualityLevelsSucceed = false; // Simulate failure
244
245 INIT_FEATURES();
246
247 DXGI_FORMAT inFormat = DXGI_FORMAT_R16G16B16A16_FLOAT;
248 UINT inSampleCount = 6;
249 D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS inFlags = D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE;
250 UINT NumQualityLevels;
251
252 HRESULT result = features.MultisampleQualityLevels(inFormat, inSampleCount, inFlags, NumQualityLevels);
253
254 EXPECT_EQ(device->m_FormatReceived, inFormat);
255 EXPECT_EQ(device->m_SampleCountReceived, inSampleCount);
256 EXPECT_EQ(device->m_MultisampleQualityLevelFlagsReceived, inFlags);
257 EXPECT_EQ(result, E_FAIL);
258 EXPECT_EQ(NumQualityLevels, 0);
259}
260
261// 5: Format Info
262// Forward call to old API. Basic check
263TEST_F(FeatureSupportTest, FormatInfoPositive)
264{
265 device->m_PlaneCount = 4;
266
267 INIT_FEATURES();
268
269 DXGI_FORMAT inFormat = DXGI_FORMAT_D32_FLOAT;
270 UINT8 PlaneCount;
271 HRESULT result = features.FormatInfo(inFormat, PlaneCount);
272
273 EXPECT_EQ(PlaneCount, 4);
274 EXPECT_EQ(result, S_OK);
275 EXPECT_EQ(device->m_FormatReceived, inFormat);
276}
277
278// Test when feature check fails
279TEST_F(FeatureSupportTest, FormatInfoNegative)
280{
281 device->m_PlaneCount = 6;
282 device->m_DXGIFormatSupported = false;
283
284 INIT_FEATURES();
285
286 DXGI_FORMAT inFormat = DXGI_FORMAT_BC1_UNORM;
287 UINT8 PlaneCount;
288 HRESULT result = features.FormatInfo(inFormat, PlaneCount);
289
290 EXPECT_EQ(result, E_INVALIDARG);
291 EXPECT_EQ(PlaneCount, 0);
292 EXPECT_EQ(device->m_FormatReceived, inFormat);
293}
294
295// 6: GPUVA Support
296TEST_F(FeatureSupportTest, GPUVASupport)
297{
298 device->m_MaxGPUVirtualAddressBitsPerProcess = 16;
299 device->m_MaxGPUVirtualAddressBitsPerResource = 12;
300
301 INIT_FEATURES();
302
303 EXPECT_EQ(features.MaxGPUVirtualAddressBitsPerProcess(), 16);
304 EXPECT_EQ(features.MaxGPUVirtualAddressBitsPerResource(), 12);
305}
306
307/*
308 Starting from Options1, all features should have an "unavailable test"
309 to ensure the new API returns the desired default values
310 when a device does not support that feature
311*/
312
313// 8: Options1
314// Basic tests
315TEST_F(FeatureSupportTest, Options1Basic)
316{
317 device->m_WaveOpsSupported = true;
318 device->m_WaveLaneCountMin = 2;
319 device->m_WaveLaneCountMax = 4;
320 device->m_TotalLaneCount = 8;
321 device->m_ExpandedComputeResourceStates = true;
322 device->m_Int64ShaderOpsSupported = true;
323
324 INIT_FEATURES();
325
326 EXPECT_TRUE(features.WaveOps());
327 EXPECT_EQ(features.WaveLaneCountMin(), 2);
328 EXPECT_EQ(features.WaveLaneCountMax(), 4);
329 EXPECT_EQ(features.TotalLaneCount(), 8);
330 EXPECT_TRUE(features.ExpandedComputeResourceStates());
331 EXPECT_TRUE(features.Int64ShaderOps());
332}
333
334// Unavailable test
335// Test where device does not support Options1
336TEST_F(FeatureSupportTest, Options1Unavailable)
337{
338 device->m_Options1Available = false;
339 device->m_WaveOpsSupported = true;
340 device->m_WaveLaneCountMin = 2;
341 device->m_WaveLaneCountMax = 4;
342 device->m_TotalLaneCount = 8;
343 device->m_ExpandedComputeResourceStates = true;
344 device->m_Int64ShaderOpsSupported = true;
345
346 INIT_FEATURES();
347
348 EXPECT_FALSE(features.WaveOps());
349 EXPECT_EQ(features.WaveLaneCountMin(), 0);
350 EXPECT_EQ(features.WaveLaneCountMax(), 0);
351 EXPECT_EQ(features.TotalLaneCount(), 0);
352 EXPECT_FALSE(features.ExpandedComputeResourceStates());
353 EXPECT_FALSE(features.Int64ShaderOps());
354}
355
356// 10: Protected Resource Session Support
357// Basic test
358TEST_F(FeatureSupportTest, ProtectedResourceSessionSupportBasic)
359{
360 device->m_ProtectedResourceSessionSupport[0] = D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED;
361
362 INIT_FEATURES();
363
364 EXPECT_EQ(features.ProtectedResourceSessionSupport(0), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED);
365}
366
367// Negative test
368TEST_F(FeatureSupportTest, ProtectedResourceSessionSupportNegative)
369{
370 device->m_ProtectedResourceSessionSupport[0] = D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED;
371 device->m_ContentProtectionSupported = false;
372
373 INIT_FEATURES();
374
375 EXPECT_EQ(features.ProtectedResourceSessionSupport(), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE);
376}
377
378// Multinode test
379TEST_F(FeatureSupportTest, ProtectedResourceSessionSupportMultinode)
380{
381 device->SetNodeCount(4);
382 device->m_ProtectedResourceSessionSupport =
383 {
384 D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE,
385 D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED,
386 D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED,
387 D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE
388 };
389
390 INIT_FEATURES();
391
392 EXPECT_EQ(features.ProtectedResourceSessionSupport(0), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE);
393 EXPECT_EQ(features.ProtectedResourceSessionSupport(1), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED);
394 EXPECT_EQ(features.ProtectedResourceSessionSupport(2), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED);
395 EXPECT_EQ(features.ProtectedResourceSessionSupport(3), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE);
396}
397
398// Unavailable test
399TEST_F(FeatureSupportTest, ProtectedResourceSessionSupportNotAvailable)
400{
401 device->m_ProtectedResourceSessionAvailable = false;
402 device->m_ProtectedResourceSessionSupport[0] = D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED;
403
404 INIT_FEATURES();
405
406 EXPECT_EQ(features.ProtectedResourceSessionSupport(0), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE);
407}
408
409
410// Multinode Unavailable test
411TEST_F(FeatureSupportTest, ProtectedResourceSessionSupportNotAvailableMultinode)
412{
413 device->m_ProtectedResourceSessionAvailable = false;
414 device->SetNodeCount(4);
415 device->m_ProtectedResourceSessionSupport =
416 {
417 D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE,
418 D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED,
419 D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED,
420 D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE
421 };
422
423 INIT_FEATURES();
424
425 EXPECT_EQ(features.ProtectedResourceSessionSupport(0), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE);
426 EXPECT_EQ(features.ProtectedResourceSessionSupport(1), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE);
427 EXPECT_EQ(features.ProtectedResourceSessionSupport(2), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE);
428 EXPECT_EQ(features.ProtectedResourceSessionSupport(3), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE);
429}
430
431// 12: Root Signature
432// Basic test (highest supported version in header)
433TEST_F(FeatureSupportTest, RootSignatureBasic)
434{
435 device->m_RootSignatureHighestVersion = D3D_ROOT_SIGNATURE_VERSION_1_1;
436 INIT_FEATURES();
437 EXPECT_EQ(features.HighestRootSignatureVersion(), D3D_ROOT_SIGNATURE_VERSION_1_1);
438}
439
440// Lower version test
441TEST_F(FeatureSupportTest, RootSignatureLower)
442{
443 device->m_RootSignatureHighestVersion = D3D_ROOT_SIGNATURE_VERSION_1;
444 INIT_FEATURES();
445 EXPECT_EQ(features.HighestRootSignatureVersion(), D3D_ROOT_SIGNATURE_VERSION_1);
446}
447
448// Higher version test
449TEST_F(FeatureSupportTest, RootSignatureHigher)
450{
451 device->m_RootSignatureHighestVersion = (D3D_ROOT_SIGNATURE_VERSION)(D3D_ROOT_SIGNATURE_VERSION_1_1 + 1);
452 INIT_FEATURES();
453 EXPECT_EQ(features.HighestRootSignatureVersion(), D3D_ROOT_SIGNATURE_VERSION_1_1);
454}
455
456// Unavailable test
457TEST_F(FeatureSupportTest, RootSignatureUnavailable)
458{
459 device->m_RootSignatureAvailable = false;
460 device->m_RootSignatureHighestVersion = D3D_ROOT_SIGNATURE_VERSION_1_1;
461 INIT_FEATURES();
462 EXPECT_EQ(features.HighestRootSignatureVersion(), 0);
463}
464
465// 18: Options2
466// Basic test
467TEST_F(FeatureSupportTest, D3D12Options2Basic)
468{
469 device->m_DepthBoundsTestSupport = true;
470 device->m_ProgrammableSamplePositionsTier = D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2;
471 INIT_FEATURES();
472 EXPECT_TRUE(features.DepthBoundsTestSupported());
473 EXPECT_EQ(features.ProgrammableSamplePositionsTier(), D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2);
474}
475
476// Unavailable test
477TEST_F(FeatureSupportTest, D3D12Options2Unavailable)
478{
479 device->m_Options2Available = false;
480 device->m_DepthBoundsTestSupport = true;
481 device->m_ProgrammableSamplePositionsTier = D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2;
482 INIT_FEATURES();
483 EXPECT_FALSE(features.DepthBoundsTestSupported());
484 EXPECT_EQ(features.ProgrammableSamplePositionsTier(), D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED);
485}
486
487// 19: Shader Cache
488// Basic test
489TEST_F(FeatureSupportTest, ShaderCacheBasic)
490{
491 D3D12_SHADER_CACHE_SUPPORT_FLAGS outFlags = D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO
492 | D3D12_SHADER_CACHE_SUPPORT_LIBRARY
493 | D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE
494 | D3D12_SHADER_CACHE_SUPPORT_DRIVER_MANAGED_CACHE
495 | D3D12_SHADER_CACHE_SUPPORT_SHADER_CONTROL_CLEAR
496 | D3D12_SHADER_CACHE_SUPPORT_SHADER_SESSION_DELETE;
497 device->m_ShaderCacheSupportFlags = outFlags;
498
499 INIT_FEATURES();
500 EXPECT_EQ(features.ShaderCacheSupportFlags(), outFlags);
501}
502
503// Unavailable test
504TEST_F(FeatureSupportTest, ShaderCacheUnavailable)
505{
506 device->m_ShaderCacheAvailable = false;
507 D3D12_SHADER_CACHE_SUPPORT_FLAGS outFlags = D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO
508 | D3D12_SHADER_CACHE_SUPPORT_LIBRARY
509 | D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE
510 | D3D12_SHADER_CACHE_SUPPORT_DRIVER_MANAGED_CACHE
511 | D3D12_SHADER_CACHE_SUPPORT_SHADER_CONTROL_CLEAR
512 | D3D12_SHADER_CACHE_SUPPORT_SHADER_SESSION_DELETE;
513 device->m_ShaderCacheSupportFlags = outFlags;
514
515 INIT_FEATURES();
516 EXPECT_EQ(features.ShaderCacheSupportFlags(), D3D12_SHADER_CACHE_SUPPORT_NONE);
517}
518
519// 20: Command Queue Priority
520// Basic positive test
521TEST_F(FeatureSupportTest, CommandQueuePriorityBasic)
522{
523 device->m_GlobalRealtimeCommandQueueSupport = true;
524 INIT_FEATURES();
525 EXPECT_TRUE(features.CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_NORMAL));
526 EXPECT_TRUE(features.CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_HIGH));
527 EXPECT_TRUE(features.CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME));
528}
529
530// Negative tests
531TEST_F(FeatureSupportTest, CommandQueuePriorityNegative)
532{
533 device->m_GlobalRealtimeCommandQueueSupport = false;
534 INIT_FEATURES();
535 EXPECT_FALSE(features.CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE, D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME)); // Global realtime not on
536 EXPECT_FALSE(features.CommandQueuePrioritySupported((D3D12_COMMAND_LIST_TYPE)(D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE+1), D3D12_COMMAND_QUEUE_PRIORITY_NORMAL)); // Unknown command list type
537 EXPECT_FALSE(features.CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE_COMPUTE, (D3D12_COMMAND_QUEUE_PRIORITY)10)); // Unknown Priority level
538}
539
540// Unavailable test
541TEST_F(FeatureSupportTest, CommandQueuePriorityUnavailable)
542{
543 device->m_CommandQueuePriorityAvailable = false;
544
545 device->m_GlobalRealtimeCommandQueueSupport = true;
546 INIT_FEATURES();
547 EXPECT_FALSE(features.CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_NORMAL));
548 EXPECT_FALSE(features.CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_HIGH));
549 EXPECT_FALSE(features.CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME));
550}
551
552// 21: Options3
553// Basic Test
554TEST_F(FeatureSupportTest, Options3Basic)
555{
556 device->m_CopyQueueTimestampQueriesSupported = true;
557 device->m_CastingFullyTypedFormatsSupported = true;
558 device->m_GetCachedWriteBufferImmediateSupportFlags = D3D12_COMMAND_LIST_SUPPORT_FLAG_DIRECT | D3D12_COMMAND_LIST_SUPPORT_FLAG_COMPUTE;
559 device->m_ViewInstancingTier = D3D12_VIEW_INSTANCING_TIER_3;
560 device->m_BarycentricsSupported = true;
561
562 INIT_FEATURES();
563
564 EXPECT_TRUE(features.CopyQueueTimestampQueriesSupported());
565 EXPECT_TRUE(features.CastingFullyTypedFormatSupported());
566 EXPECT_EQ(features.WriteBufferImmediateSupportFlags(), D3D12_COMMAND_LIST_SUPPORT_FLAG_DIRECT | D3D12_COMMAND_LIST_SUPPORT_FLAG_COMPUTE);
567 EXPECT_EQ(features.ViewInstancingTier(), D3D12_VIEW_INSTANCING_TIER_3);
568 EXPECT_TRUE(features.BarycentricsSupported());
569}
570
571// Unavailable Test
572TEST_F(FeatureSupportTest, Options3Unavailable)
573{
574 device->m_Options3Available = false;
575 device->m_CopyQueueTimestampQueriesSupported = true;
576 device->m_CastingFullyTypedFormatsSupported = true;
577 device->m_GetCachedWriteBufferImmediateSupportFlags = D3D12_COMMAND_LIST_SUPPORT_FLAG_DIRECT | D3D12_COMMAND_LIST_SUPPORT_FLAG_COMPUTE;
578 device->m_ViewInstancingTier = D3D12_VIEW_INSTANCING_TIER_3;
579 device->m_BarycentricsSupported = true;
580
581 INIT_FEATURES();
582
583 EXPECT_FALSE(features.CopyQueueTimestampQueriesSupported());
584 EXPECT_FALSE(features.CastingFullyTypedFormatSupported());
585 EXPECT_EQ(features.WriteBufferImmediateSupportFlags(), D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE);
586 EXPECT_EQ(features.ViewInstancingTier(), D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED);
587 EXPECT_FALSE(features.BarycentricsSupported());
588}
589
590// 22: Existing Heaps
591// Basic Test
592TEST_F(FeatureSupportTest, ExistingHeapsBasic)
593{
594 device->m_ExistingHeapCaps = true;
595 INIT_FEATURES();
596 EXPECT_TRUE(features.ExistingHeapsSupported());
597}
598
599// Unavailable Test
600TEST_F(FeatureSupportTest, ExistingHeapsUnavailable)
601{
602 device->m_ExistingHeapsAvailable = false;
603 device->m_ExistingHeapCaps = true;
604 INIT_FEATURES();
605 EXPECT_FALSE(features.ExistingHeapsSupported());
606}
607
608// 23: Options4
609// Basic Test
610TEST_F(FeatureSupportTest, Options4Basic)
611{
612 device->m_MSAA64KBAlignedTextureSupported = true;
613 device->m_SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2; // Duplicate member
614 device->m_Native16BitShaderOpsSupported = true;
615
616 INIT_FEATURES();
617 EXPECT_TRUE(features.MSAA64KBAlignedTextureSupported());
618 EXPECT_EQ(features.SharedResourceCompatibilityTier(), D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2);
619 EXPECT_TRUE(features.Native16BitShaderOpsSupported());
620}
621
622// Unavailable Test
623TEST_F(FeatureSupportTest, Options4Unavailable)
624{
625 device->m_Options4Available = false;
626 device->m_MSAA64KBAlignedTextureSupported = true;
627 device->m_SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2; // Duplicate member
628 device->m_Native16BitShaderOpsSupported = true;
629
630 INIT_FEATURES();
631 EXPECT_FALSE(features.MSAA64KBAlignedTextureSupported());
632 EXPECT_EQ(features.SharedResourceCompatibilityTier(), D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0);
633 EXPECT_FALSE(features.Native16BitShaderOpsSupported());
634}
635
636// 24: Serialization
637// Basic Test
638TEST_F(FeatureSupportTest, SerializationBasic)
639{
640 device->m_HeapSerializationTier[0] = D3D12_HEAP_SERIALIZATION_TIER_10;
641
642 INIT_FEATURES();
643
644 EXPECT_EQ(features.HeapSerializationTier(), D3D12_HEAP_SERIALIZATION_TIER_10);
645}
646
647// Multinode Test
648TEST_F(FeatureSupportTest, SerializationMultinode)
649{
650 device->SetNodeCount(3);
651 device->m_HeapSerializationTier =
652 {
653 D3D12_HEAP_SERIALIZATION_TIER_10,
654 D3D12_HEAP_SERIALIZATION_TIER_0,
655 D3D12_HEAP_SERIALIZATION_TIER_10
656 };
657
658 INIT_FEATURES();
659
660 EXPECT_EQ(features.HeapSerializationTier(), D3D12_HEAP_SERIALIZATION_TIER_10);
661 EXPECT_EQ(features.HeapSerializationTier(1), D3D12_HEAP_SERIALIZATION_TIER_0);
662 EXPECT_EQ(features.HeapSerializationTier(2), D3D12_HEAP_SERIALIZATION_TIER_10);
663}
664
665// Unavailable Test
666TEST_F(FeatureSupportTest, SerializationUnavailable)
667{
668 device->m_SerializationAvailable = false;
669 device->SetNodeCount(3);
670 device->m_HeapSerializationTier =
671 {
672 D3D12_HEAP_SERIALIZATION_TIER_10,
673 D3D12_HEAP_SERIALIZATION_TIER_0,
674 D3D12_HEAP_SERIALIZATION_TIER_10
675 };
676
677 INIT_FEATURES();
678
679 EXPECT_EQ(features.HeapSerializationTier(), D3D12_HEAP_SERIALIZATION_TIER_0);
680 EXPECT_EQ(features.HeapSerializationTier(1), D3D12_HEAP_SERIALIZATION_TIER_0);
681 EXPECT_EQ(features.HeapSerializationTier(2), D3D12_HEAP_SERIALIZATION_TIER_0);
682}
683
684// 25: Cross Node
685// Basic Test
686TEST_F(FeatureSupportTest, CrossNodeBasic)
687{
688 device->m_CrossNodeSharingTier = D3D12_CROSS_NODE_SHARING_TIER_3; // Duplicated Cap
689 device->m_AtomicShaderInstructions = true;
690
691 INIT_FEATURES();
692
693 EXPECT_EQ(features.CrossNodeSharingTier(), D3D12_CROSS_NODE_SHARING_TIER_3);
694 EXPECT_TRUE(features.CrossNodeAtomicShaderInstructions());
695}
696
697// Unavailable Test
698TEST_F(FeatureSupportTest, CrossNodeUnavailable)
699{
700 device->m_CrossNodeAvailable = false;
701 device->m_CrossNodeSharingTier = D3D12_CROSS_NODE_SHARING_TIER_3; // Duplicated Cap
702 device->m_AtomicShaderInstructions = true;
703
704 INIT_FEATURES();
705
706 EXPECT_EQ(features.CrossNodeSharingTier(), D3D12_CROSS_NODE_SHARING_TIER_3); // It is still correctly initialized by Options1
707 EXPECT_FALSE(features.CrossNodeAtomicShaderInstructions());
708}
709
710// 27: Options5
711// Basic Test
712TEST_F(FeatureSupportTest, Options5Basic)
713{
714 device->m_RaytracingTier = D3D12_RAYTRACING_TIER_1_1;
715 device->m_RenderPassesTier = D3D12_RENDER_PASS_TIER_2;
716 device->m_SRVOnlyTiledResourceTier3 = true;
717
718 INIT_FEATURES();
719
720 EXPECT_EQ(features.RaytracingTier(), D3D12_RAYTRACING_TIER_1_1);
721 EXPECT_EQ(features.RenderPassesTier(), D3D12_RENDER_PASS_TIER_2);
722 EXPECT_TRUE(features.SRVOnlyTiledResourceTier3());
723}
724
725// Unavailable Test
726TEST_F(FeatureSupportTest, Options5Unavailable)
727{
728 device->m_Options5Available = false;
729 device->m_RaytracingTier = D3D12_RAYTRACING_TIER_1_1;
730 device->m_RenderPassesTier = D3D12_RENDER_PASS_TIER_2;
731 device->m_SRVOnlyTiledResourceTier3 = true;
732
733 INIT_FEATURES();
734
735 EXPECT_EQ(features.RaytracingTier(), D3D12_RAYTRACING_TIER_NOT_SUPPORTED);
736 EXPECT_EQ(features.RenderPassesTier(), D3D12_RENDER_PASS_TIER_0);
737 EXPECT_FALSE(features.SRVOnlyTiledResourceTier3());
738}
739
740// 28: Displayable
741// Basic Test
742TEST_F(FeatureSupportTest, DisplayableBasic)
743{
744 device->m_DisplayableTexture = true;
745 device->m_SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2;
746
747 INIT_FEATURES();
748
749 EXPECT_TRUE(features.DisplayableTexture());
750 EXPECT_EQ(features.SharedResourceCompatibilityTier(), D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2);
751}
752
753// Unavailable Test
754TEST_F(FeatureSupportTest, DisplayableUnavailable)
755{
756 device->m_DisplayableAvailable = false;
757 device->m_DisplayableTexture = true;
758 device->m_SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2;
759
760 INIT_FEATURES();
761
762 EXPECT_FALSE(features.DisplayableTexture());
763 EXPECT_EQ(features.SharedResourceCompatibilityTier(), D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2); // Still initialized by Options4
764}
765
766// 30: D3D12 Options6
767// Basic Test
768TEST_F(FeatureSupportTest, Options6Basic)
769{
770 device->m_AdditionalShadingRatesSupported = true;
771 device->m_BackgroundProcessingSupported = true;
772 device->m_PerPrimitiveShadingRateSupportedWithViewportIndexing = true;
773 device->m_ShadingRateImageTileSize = 10;
774 device->m_VariableShadingRateTier = D3D12_VARIABLE_SHADING_RATE_TIER_2;
775
776 INIT_FEATURES();
777
778 EXPECT_TRUE(features.AdditionalShadingRatesSupported());
779 EXPECT_TRUE(features.BackgroundProcessingSupported());
780 EXPECT_TRUE(features.PerPrimitiveShadingRateSupportedWithViewportIndexing());
781 EXPECT_EQ(features.ShadingRateImageTileSize(), 10);
782 EXPECT_EQ(features.VariableShadingRateTier(), D3D12_VARIABLE_SHADING_RATE_TIER_2);
783}
784
785// Unavailable Test
786TEST_F(FeatureSupportTest, Options6Unavailable)
787{
788 device->m_Options6Available = false;
789 device->m_AdditionalShadingRatesSupported = true;
790 device->m_BackgroundProcessingSupported = true;
791 device->m_PerPrimitiveShadingRateSupportedWithViewportIndexing = true;
792 device->m_ShadingRateImageTileSize = 10;
793 device->m_VariableShadingRateTier = D3D12_VARIABLE_SHADING_RATE_TIER_2;
794
795 INIT_FEATURES();
796
797 EXPECT_FALSE(features.AdditionalShadingRatesSupported());
798 EXPECT_FALSE(features.BackgroundProcessingSupported());
799 EXPECT_FALSE(features.PerPrimitiveShadingRateSupportedWithViewportIndexing());
800 EXPECT_EQ(features.ShadingRateImageTileSize(), 0);
801 EXPECT_EQ(features.VariableShadingRateTier(), D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED);
802}
803
804// 31: Query Meta Command
805// Only performs input and output consistency checks; not reflecting results from real device
806// Basic Test
807TEST_F(FeatureSupportTest, QueryMetaCommandBasic)
808{
809 UINT MockOutput[2] = {2, 8};
810 UINT MockOutputSize = sizeof(MockOutput);
811 device->m_pQueryOutputData = MockOutput;
812 device->m_QueryOutputDataSizeInBytes = MockOutputSize;
813
814 UINT MockInput[3] = {3, 6, 42};
815 UINT MockInputSize = sizeof(MockInput);
816 GUID MockCommandID = {1, 5, 9, {12, 17, 23, 38}}; // Not a real CommandID
817 UINT MockNodeMask = 0x12;
818
819 D3D12_FEATURE_DATA_QUERY_META_COMMAND QueryData;
820 QueryData.CommandId = MockCommandID;
821 QueryData.NodeMask = MockNodeMask;
822 QueryData.QueryInputDataSizeInBytes = MockInputSize;
823 QueryData.pQueryInputData = MockInput;
824 QueryData.QueryOutputDataSizeInBytes = MockOutputSize;
825 QueryData.pQueryOutputData = MockOutput;
826
827 INIT_FEATURES();
828
829 HRESULT result = features.QueryMetaCommand(QueryData);
830 EXPECT_EQ(result, S_OK);
831 EXPECT_EQ(device->m_CommandID, MockCommandID);
832 EXPECT_EQ(device->m_NodeMask, MockNodeMask);
833 EXPECT_EQ(device->m_QueryInputDataSizeInBytes, MockInputSize);
834 EXPECT_EQ(device->m_pQueryInputData, MockInput);
835 EXPECT_EQ(QueryData.QueryOutputDataSizeInBytes, MockOutputSize);
836 EXPECT_EQ(QueryData.pQueryOutputData, MockOutput);
837}
838
839// 32: Options7
840// Basic Test
841TEST_F(FeatureSupportTest, Options7Basic)
842{
843 device->m_MeshShaderTier = D3D12_MESH_SHADER_TIER_1;
844 device->m_SamplerFeedbackTier = D3D12_SAMPLER_FEEDBACK_TIER_1_0;
845
846 INIT_FEATURES();
847
848 EXPECT_EQ(features.MeshShaderTier(), D3D12_MESH_SHADER_TIER_1);
849 EXPECT_EQ(features.SamplerFeedbackTier(), D3D12_SAMPLER_FEEDBACK_TIER_1_0);
850}
851
852// Unavailable Test
853TEST_F(FeatureSupportTest, Options7Unavailable)
854{
855 device->m_Options7Available = false;
856 device->m_MeshShaderTier = D3D12_MESH_SHADER_TIER_1;
857 device->m_SamplerFeedbackTier = D3D12_SAMPLER_FEEDBACK_TIER_1_0;
858
859 INIT_FEATURES();
860
861 EXPECT_EQ(features.MeshShaderTier(), D3D12_MESH_SHADER_TIER_NOT_SUPPORTED);
862 EXPECT_EQ(features.SamplerFeedbackTier(), D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED);
863}
864
865// 33: Protected Resource Session Type Count
866// Basic Test
867TEST_F(FeatureSupportTest, ProtectedResourceSessionTypeCountBasic)
868{
869 device->m_ProtectedResourceSessionTypeCount[0] = 5;
870 device->m_ProtectedResourceSessionTypes[0].resize(5); // Must set the session types to a correct number
871
872 INIT_FEATURES();
873
874 EXPECT_EQ(features.ProtectedResourceSessionTypeCount(0), 5);
875}
876
877// Multinode Test
878TEST_F(FeatureSupportTest, ProtectedResourceSessionTypeCountMultinode)
879{
880 device->SetNodeCount(3);
881 device->m_ProtectedResourceSessionTypeCount = {3, 14, 21};
882 device->m_ProtectedResourceSessionTypes[0].resize(3);
883 device->m_ProtectedResourceSessionTypes[1].resize(14);
884 device->m_ProtectedResourceSessionTypes[2].resize(21);
885
886 INIT_FEATURES();
887
888 EXPECT_EQ(features.ProtectedResourceSessionTypeCount(0), 3);
889 EXPECT_EQ(features.ProtectedResourceSessionTypeCount(1), 14);
890 EXPECT_EQ(features.ProtectedResourceSessionTypeCount(2), 21);
891}
892
893// Unavailable Test
894TEST_F(FeatureSupportTest, ProtectedResourceSessionTypeCountUnavailable)
895{
896 device->m_ProtectedResourceSessionTypeCountAvailable = false;
897 device->SetNodeCount(3);
898 device->m_ProtectedResourceSessionTypeCount = {3, 14, 21};
899 device->m_ProtectedResourceSessionTypes[0].resize(3);
900 device->m_ProtectedResourceSessionTypes[1].resize(14);
901 device->m_ProtectedResourceSessionTypes[2].resize(21);
902
903 INIT_FEATURES();
904
905 EXPECT_EQ(features.ProtectedResourceSessionTypeCount(0), 0);
906 EXPECT_EQ(features.ProtectedResourceSessionTypeCount(1), 0);
907 EXPECT_EQ(features.ProtectedResourceSessionTypeCount(2), 0);
908}
909
910// 34: Protected Resource Session Types
911// Note: Protected Resource Seesion Type Count must be correctly set for this feature
912// Basic Test
913TEST_F(FeatureSupportTest, ProtectedResourceSessionTypesBasic)
914{
915 device->m_ProtectedResourceSessionTypeCount[0] = 2;
916 device->m_ProtectedResourceSessionTypes[0] = {{1, 1, 2, {3, 5, 8, 13}}, {1, 4, 9, {16, 25, 36, 49}}}; // Some random GUID test data
917
918 INIT_FEATURES();
919
920 EXPECT_EQ(features.ProtectedResourceSessionTypes(), device->m_ProtectedResourceSessionTypes[0]);
921}
922
923// Multinode Test
924TEST_F(FeatureSupportTest, ProtectedResourceSessionTypesMultinode)
925{
926 device->SetNodeCount(2);
927 device->m_ProtectedResourceSessionTypeCount = {2, 1};
928 device->m_ProtectedResourceSessionTypes[0] = {{1, 1, 2, {3, 5, 8, 13}}, {1, 4, 9, {16, 25, 36, 49}}}; // Some random GUID test data
929 device->m_ProtectedResourceSessionTypes[1] = {{5, 7, 9, {11, 13, 15, 17}}};
930
931 INIT_FEATURES();
932
933 EXPECT_EQ(features.ProtectedResourceSessionTypes(0), device->m_ProtectedResourceSessionTypes[0]);
934 EXPECT_EQ(features.ProtectedResourceSessionTypes(1), device->m_ProtectedResourceSessionTypes[1]);
935}
936
937// Unavailable Test
938TEST_F(FeatureSupportTest, ProtectedResourceSessionTypesUnavailable)
939{
940 device->m_ProtectedResourceSessionTypesAvailable = false;
941 device->m_ProtectedResourceSessionTypeCount[0] = 2;
942 device->m_ProtectedResourceSessionTypes[0] = {{1, 1, 2, {3, 5, 8, 13}}, {1, 4, 9, {16, 25, 36, 49}}}; // Some random GUID test data
943
944 INIT_FEATURES();
945
946 // If the check fails, the types vector should remain empty
947 EXPECT_EQ(features.ProtectedResourceSessionTypes(0).size(), 0);
948}
949
950// Test where ProtectedResourceSessiontTypeCount is unavailable
951TEST_F(FeatureSupportTest, ProtectedResourceSessionTypesCascadeUnavailable)
952{
953 device->m_ProtectedResourceSessionTypeCountAvailable = false;
954 device->m_ProtectedResourceSessionTypeCount[0] = 2;
955 device->m_ProtectedResourceSessionTypes[0] = {{1, 1, 2, {3, 5, 8, 13}}, {1, 4, 9, {16, 25, 36, 49}}}; // Some random GUID test data
956
957 INIT_FEATURES();
958
959 EXPECT_EQ(features.ProtectedResourceSessionTypeCount(0), 0);
960 EXPECT_EQ(features.ProtectedResourceSessionTypes(0).size(), 0);
961}
962
963// 36: Options8
964// Basic Test
965TEST_F(FeatureSupportTest, Options8Basic)
966{
967 device->m_UnalignedBlockTexturesSupported = true;
968 INIT_FEATURES();
969 EXPECT_TRUE(features.UnalignedBlockTexturesSupported());
970}
971
972// Unavailable Test
973TEST_F(FeatureSupportTest, Options8Unavailable)
974{
975 device->m_Options8Available = false;
976 device->m_UnalignedBlockTexturesSupported = true;
977 INIT_FEATURES();
978 EXPECT_FALSE(features.UnalignedBlockTexturesSupported());
979}
980
981// 37: Options9
982// Basic Test
983TEST_F(FeatureSupportTest, Options9Basic)
984{
985 device->m_MeshShaderPipelineStatsSupported = true;
986 device->m_MeshShaderSupportsFullRangeRenderTargetArrayIndex = true;
987 device->m_AtomicInt64OnTypedResourceSupported = true;
988 device->m_AtomicInt64OnGroupSharedSupported = true;
989 device->m_DerivativesInMeshAndAmplificationShadersSupported = true;
990 device->m_WaveMMATier = D3D12_WAVE_MMA_TIER_1_0;
991
992 INIT_FEATURES();
993
994 EXPECT_TRUE(features.MeshShaderPipelineStatsSupported());
995 EXPECT_TRUE(features.MeshShaderSupportsFullRangeRenderTargetArrayIndex());
996 EXPECT_TRUE(features.AtomicInt64OnTypedResourceSupported());
997 EXPECT_TRUE(features.AtomicInt64OnGroupSharedSupported());
998 EXPECT_TRUE(features.DerivativesInMeshAndAmplificationShadersSupported());
999 EXPECT_EQ(features.WaveMMATier(), D3D12_WAVE_MMA_TIER_1_0);
1000}
1001
1002// Unavailable Test
1003TEST_F(FeatureSupportTest, Options9Unavailable)
1004{
1005 device->m_Options9Available = false;
1006 device->m_MeshShaderPipelineStatsSupported = true;
1007 device->m_MeshShaderSupportsFullRangeRenderTargetArrayIndex = true;
1008 device->m_AtomicInt64OnTypedResourceSupported = true;
1009 device->m_AtomicInt64OnGroupSharedSupported = true;
1010 device->m_DerivativesInMeshAndAmplificationShadersSupported = true;
1011 device->m_WaveMMATier = D3D12_WAVE_MMA_TIER_1_0;
1012
1013 INIT_FEATURES();
1014
1015 EXPECT_FALSE(features.MeshShaderPipelineStatsSupported());
1016 EXPECT_FALSE(features.MeshShaderSupportsFullRangeRenderTargetArrayIndex());
1017 EXPECT_FALSE(features.AtomicInt64OnTypedResourceSupported());
1018 EXPECT_FALSE(features.AtomicInt64OnGroupSharedSupported());
1019 EXPECT_FALSE(features.DerivativesInMeshAndAmplificationShadersSupported());
1020 EXPECT_EQ(features.WaveMMATier(), D3D12_WAVE_MMA_TIER_NOT_SUPPORTED);
1021}
1022
1023// 39: Options10
1024// Basic Test
1025TEST_F(FeatureSupportTest, Options10Basic)
1026{
1027 device->m_VariableRateShadingSumCombinerSupported = true;
1028 device->m_MeshShaderPerPrimitiveShadingRateSupported = true;
1029
1030 INIT_FEATURES();
1031
1032 EXPECT_TRUE(features.VariableRateShadingSumCombinerSupported());
1033 EXPECT_TRUE(features.MeshShaderPerPrimitiveShadingRateSupported());
1034}
1035
1036// Unavailable Test
1037TEST_F(FeatureSupportTest, Options10Unavailable)
1038{
1039 device->m_Options10Available = false;
1040 device->m_VariableRateShadingSumCombinerSupported = true;
1041 device->m_MeshShaderPerPrimitiveShadingRateSupported = true;
1042
1043 INIT_FEATURES();
1044
1045 EXPECT_FALSE(features.VariableRateShadingSumCombinerSupported());
1046 EXPECT_FALSE(features.MeshShaderPerPrimitiveShadingRateSupported());
1047}
1048
1049// 40: Options11
1050// Basic Test
1051TEST_F(FeatureSupportTest, Options11Basic)
1052{
1053 device->m_AtomicInt64OnDescriptorHeapResourceSupported = true;
1054 INIT_FEATURES();
1055 EXPECT_TRUE(features.AtomicInt64OnDescriptorHeapResourceSupported());
1056}
1057
1058// Unavailable Test
1059TEST_F(FeatureSupportTest, Options11Unavailable)
1060{
1061 device->m_Options11Available = false;
1062 device->m_AtomicInt64OnDescriptorHeapResourceSupported = true;
1063 INIT_FEATURES();
1064 EXPECT_FALSE(features.AtomicInt64OnDescriptorHeapResourceSupported());
1065}
1066
1067// 41: Options12
1068// Basic Test
1069TEST_F(FeatureSupportTest, Options12Basic)
1070{
1071 device->m_MSPrimitivesPipelineStatisticIncludesCulledPrimitives = D3D12_TRI_STATE_TRUE;
1072 device->m_EnhancedBarriersSupported = true;
1073 INIT_FEATURES();
1074 EXPECT_EQ(features.MSPrimitivesPipelineStatisticIncludesCulledPrimitives(), D3D12_TRI_STATE_TRUE);
1075 EXPECT_TRUE(features.EnhancedBarriersSupported());
1076}
1077
1078// Unavailable Test
1079TEST_F(FeatureSupportTest, Options12Unavailable)
1080{
1081 device->m_Options12Available = false;
1082 device->m_MSPrimitivesPipelineStatisticIncludesCulledPrimitives = D3D12_TRI_STATE_TRUE;
1083 device->m_EnhancedBarriersSupported = true;
1084 INIT_FEATURES();
1085 EXPECT_EQ(features.MSPrimitivesPipelineStatisticIncludesCulledPrimitives(), D3D12_TRI_STATE_UNKNOWN);
1086 EXPECT_FALSE(features.EnhancedBarriersSupported());
1087}
1088
1089// Duplicate Caps Tests
1090// This test ensures that caps that are present in more than one features reports correctly
1091// when either of them are unavailable on the runtime
1092
1093// Cross Node Sharing Tier: D3D12Options, CrossNode
1094TEST_F(FeatureSupportTest, DuplicateCrossNodeSharingTier)
1095{
1096 device->m_CrossNodeSharingTier = D3D12_CROSS_NODE_SHARING_TIER_3;
1097 device->m_CrossNodeAvailable = false;
1098
1099 INIT_FEATURES();
1100
1101 EXPECT_EQ(features.CrossNodeSharingTier(), D3D12_CROSS_NODE_SHARING_TIER_3);
1102}
1103
1104// Shared Resource Compatibility Tier: D3D12Options4, Displayable
1105TEST_F(FeatureSupportTest, DuplicateSharedResourceCompatibilityTier)
1106{
1107 device->m_SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2;
1108 device->m_DisplayableAvailable = false;
1109
1110 INIT_FEATURES();
1111 EXPECT_EQ(features.SharedResourceCompatibilityTier(), D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2);
1112}
1113
1114// Test where both features are unavailable
1115TEST_F(FeatureSupportTest, DuplicateSharedResourceCompatibilityTierNegatvie)
1116{
1117 device->m_SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2;
1118 device->m_DisplayableAvailable = false;
1119 device->m_Options4Available = false;
1120
1121 INIT_FEATURES();
1122 EXPECT_EQ(features.SharedResourceCompatibilityTier(), D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0); // Fallback to default value
1123}
1124
1125// MaxGPUVirtualAddressBitsPerResource also has duplicates,
1126// but since the two features are always supported, no explicit tests are needed.
1127
1128// System Test
1129// Test if the system works when all features are initialized and queries
1130// Skips functions that only does forwarding
1131TEST_F(FeatureSupportTest, SystemTest)
1132{
1133 device->SetNodeCount(2);
1134 device->m_DoublePrecisionFloatShaderOps = true;
1135 device->m_OutputMergerLogicOp = true;
1136 device->m_ShaderMinPrecisionSupport10Bit = D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT;
1137 device->m_ShaderMinPrecisionSupport16Bit = D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT;
1138 device->m_TiledResourcesTier = D3D12_TILED_RESOURCES_TIER_3;
1139 device->m_ResourceBindingTier = D3D12_RESOURCE_BINDING_TIER_3;
1140 device->m_PSSpecifiedStencilRefSupported = true;
1141 device->m_ConservativeRasterizationTier = D3D12_CONSERVATIVE_RASTERIZATION_TIER_2;
1142 device->m_MaxGPUVirtualAddressBitsPerResource = 10;
1143 device->m_ResourceHeapTier = D3D12_RESOURCE_HEAP_TIER_2;
1144 device->m_TypedUAVLoadAdditionalFormats = true;
1145 device->m_ROVsSupported = true;
1146 device->m_StandardSwizzle64KBSupported = true;
1147 device->m_CrossNodeSharingTier = D3D12_CROSS_NODE_SHARING_TIER_3;
1148 device->m_CrossAdapterRowMajorTextureSupported = true;
1149 device->m_VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation = true;
1150
1151 device->m_Architecture1Available = true;
1152 device->m_TileBasedRenderer = {false, true};
1153 device->m_UMA = {true, false};
1154 device->m_CacheCoherentUMA = {false, true};
1155 device->m_IsolatedMMU = {true, true};
1156
1157 device->m_FeatureLevel = D3D_FEATURE_LEVEL_12_2;
1158
1159 device->m_MaxGPUVirtualAddressBitsPerProcess = 16;
1160
1161 device->m_WaveOpsSupported = true;
1162 device->m_WaveLaneCountMin = 2;
1163 device->m_WaveLaneCountMax = 4;
1164 device->m_TotalLaneCount = 8;
1165 device->m_ExpandedComputeResourceStates = true;
1166 device->m_Int64ShaderOpsSupported = true;
1167
1168 device->m_ProtectedResourceSessionSupport =
1169 {
1170 D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE,
1171 D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED,
1172 };
1173
1174 device->m_RootSignatureHighestVersion = D3D_ROOT_SIGNATURE_VERSION_1_1;
1175
1176 device->m_DepthBoundsTestSupport = true;
1177 device->m_ProgrammableSamplePositionsTier = D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2;
1178
1179 D3D12_SHADER_CACHE_SUPPORT_FLAGS outFlags = D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO
1180 | D3D12_SHADER_CACHE_SUPPORT_LIBRARY
1181 | D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE
1182 | D3D12_SHADER_CACHE_SUPPORT_DRIVER_MANAGED_CACHE
1183 | D3D12_SHADER_CACHE_SUPPORT_SHADER_CONTROL_CLEAR
1184 | D3D12_SHADER_CACHE_SUPPORT_SHADER_SESSION_DELETE;
1185 device->m_ShaderCacheSupportFlags = outFlags;
1186
1187 device->m_GlobalRealtimeCommandQueueSupport = true;
1188
1189 device->m_CopyQueueTimestampQueriesSupported = true;
1190 device->m_CastingFullyTypedFormatsSupported = true;
1191 device->m_GetCachedWriteBufferImmediateSupportFlags = D3D12_COMMAND_LIST_SUPPORT_FLAG_DIRECT | D3D12_COMMAND_LIST_SUPPORT_FLAG_COMPUTE;
1192 device->m_ViewInstancingTier = D3D12_VIEW_INSTANCING_TIER_3;
1193 device->m_BarycentricsSupported = true;
1194
1195 device->m_ExistingHeapCaps = true;
1196
1197 device->m_MSAA64KBAlignedTextureSupported = true;
1198 device->m_SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2;
1199 device->m_Native16BitShaderOpsSupported = true;
1200
1201 device->m_HeapSerializationTier =
1202 {
1203 D3D12_HEAP_SERIALIZATION_TIER_10,
1204 D3D12_HEAP_SERIALIZATION_TIER_10,
1205 };
1206
1207 device->m_AtomicShaderInstructions = true;
1208
1209 device->m_RaytracingTier = D3D12_RAYTRACING_TIER_1_1;
1210 device->m_RenderPassesTier = D3D12_RENDER_PASS_TIER_2;
1211 device->m_SRVOnlyTiledResourceTier3 = true;
1212
1213 device->m_DisplayableTexture = true;
1214
1215 device->m_AdditionalShadingRatesSupported = true;
1216 device->m_BackgroundProcessingSupported = true;
1217 device->m_PerPrimitiveShadingRateSupportedWithViewportIndexing = true;
1218 device->m_ShadingRateImageTileSize = 10;
1219 device->m_VariableShadingRateTier = D3D12_VARIABLE_SHADING_RATE_TIER_2;
1220
1221 device->m_MeshShaderTier = D3D12_MESH_SHADER_TIER_1;
1222 device->m_SamplerFeedbackTier = D3D12_SAMPLER_FEEDBACK_TIER_1_0;
1223
1224 device->m_ProtectedResourceSessionTypeCount = {2, 1};
1225 device->m_ProtectedResourceSessionTypes[0].resize(3);
1226 device->m_ProtectedResourceSessionTypes[1].resize(14);
1227
1228 device->m_ProtectedResourceSessionTypes[0] = {{1, 1, 2, {3, 5, 8, 13}}, {1, 4, 9, {16, 25, 36, 49}}}; // Some random GUID test data
1229 device->m_ProtectedResourceSessionTypes[1] = {{5, 7, 9, {11, 13, 15, 17}}};
1230
1231 device->m_UnalignedBlockTexturesSupported = true;
1232
1233 device->m_MeshShaderPipelineStatsSupported = true;
1234 device->m_MeshShaderSupportsFullRangeRenderTargetArrayIndex = true;
1235 device->m_AtomicInt64OnTypedResourceSupported = true;
1236 device->m_AtomicInt64OnGroupSharedSupported = true;
1237 device->m_DerivativesInMeshAndAmplificationShadersSupported = true;
1238 device->m_WaveMMATier = D3D12_WAVE_MMA_TIER_1_0;
1239
1240 device->m_VariableRateShadingSumCombinerSupported = true;
1241 device->m_MeshShaderPerPrimitiveShadingRateSupported = true;
1242
1243 device->m_AtomicInt64OnDescriptorHeapResourceSupported = true;
1244
1245 device->m_MSPrimitivesPipelineStatisticIncludesCulledPrimitives = D3D12_TRI_STATE_TRUE;
1246 device->m_EnhancedBarriersSupported = true;
1247
1248 INIT_FEATURES();
1249
1250 EXPECT_TRUE(features.DoublePrecisionFloatShaderOps());
1251 EXPECT_TRUE(features.OutputMergerLogicOp());
1252 EXPECT_EQ(features.MinPrecisionSupport(), D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT | D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT);
1253 EXPECT_EQ(features.TiledResourcesTier(), D3D12_TILED_RESOURCES_TIER_3);
1254 EXPECT_EQ(features.ResourceBindingTier(), D3D12_RESOURCE_BINDING_TIER_3);
1255 EXPECT_TRUE(features.PSSpecifiedStencilRefSupported());
1256 EXPECT_TRUE(features.TypedUAVLoadAdditionalFormats());
1257 EXPECT_TRUE(features.ROVsSupported());
1258 EXPECT_EQ(features.ConservativeRasterizationTier(), D3D12_CONSERVATIVE_RASTERIZATION_TIER_2);
1259 EXPECT_EQ(features.MaxGPUVirtualAddressBitsPerResource(), 10);
1260 EXPECT_TRUE(features.StandardSwizzle64KBSupported());
1261 EXPECT_EQ(features.CrossNodeSharingTier(), D3D12_CROSS_NODE_SHARING_TIER_3);
1262 EXPECT_TRUE(features.CrossAdapterRowMajorTextureSupported());
1263 EXPECT_TRUE(features.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation());
1264 EXPECT_EQ(features.ResourceHeapTier(), D3D12_RESOURCE_HEAP_TIER_2);
1265
1266 EXPECT_FALSE(features.TileBasedRenderer(0));
1267 EXPECT_TRUE(features.TileBasedRenderer(1));
1268 EXPECT_TRUE(features.UMA(0));
1269 EXPECT_FALSE(features.UMA(1));
1270 EXPECT_FALSE(features.CacheCoherentUMA(0));
1271 EXPECT_TRUE(features.CacheCoherentUMA(1));
1272 EXPECT_TRUE(features.IsolatedMMU(0));
1273 EXPECT_TRUE(features.IsolatedMMU(1));
1274
1275 EXPECT_EQ(features.MaxSupportedFeatureLevel(), D3D_FEATURE_LEVEL_12_2);
1276
1277 EXPECT_EQ(features.MaxGPUVirtualAddressBitsPerProcess(), 16);
1278
1279 EXPECT_TRUE(features.WaveOps());
1280 EXPECT_EQ(features.WaveLaneCountMin(), 2);
1281 EXPECT_EQ(features.WaveLaneCountMax(), 4);
1282 EXPECT_EQ(features.TotalLaneCount(), 8);
1283 EXPECT_TRUE(features.ExpandedComputeResourceStates());
1284 EXPECT_TRUE(features.Int64ShaderOps());
1285
1286 EXPECT_EQ(features.ProtectedResourceSessionSupport(0), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE);
1287 EXPECT_EQ(features.ProtectedResourceSessionSupport(1), D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED);
1288
1289 EXPECT_EQ(features.HighestRootSignatureVersion(), D3D_ROOT_SIGNATURE_VERSION_1_1);
1290
1291 EXPECT_TRUE(features.DepthBoundsTestSupported());
1292 EXPECT_EQ(features.ProgrammableSamplePositionsTier(), D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2);
1293
1294 EXPECT_EQ(features.ShaderCacheSupportFlags(), outFlags);
1295
1296 EXPECT_TRUE(features.CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_NORMAL));
1297 EXPECT_TRUE(features.CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_HIGH));
1298 EXPECT_TRUE(features.CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME));
1299
1300 EXPECT_TRUE(features.CopyQueueTimestampQueriesSupported());
1301 EXPECT_TRUE(features.CastingFullyTypedFormatSupported());
1302 EXPECT_EQ(features.WriteBufferImmediateSupportFlags(), D3D12_COMMAND_LIST_SUPPORT_FLAG_DIRECT | D3D12_COMMAND_LIST_SUPPORT_FLAG_COMPUTE);
1303 EXPECT_EQ(features.ViewInstancingTier(), D3D12_VIEW_INSTANCING_TIER_3);
1304 EXPECT_TRUE(features.BarycentricsSupported());
1305
1306 EXPECT_TRUE(features.ExistingHeapsSupported());
1307
1308 EXPECT_TRUE(features.MSAA64KBAlignedTextureSupported());
1309 EXPECT_EQ(features.SharedResourceCompatibilityTier(), D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2);
1310 EXPECT_TRUE(features.Native16BitShaderOpsSupported());
1311
1312 EXPECT_EQ(features.HeapSerializationTier(), D3D12_HEAP_SERIALIZATION_TIER_10);
1313 EXPECT_EQ(features.HeapSerializationTier(1), D3D12_HEAP_SERIALIZATION_TIER_10);
1314
1315 EXPECT_EQ(features.CrossNodeSharingTier(), D3D12_CROSS_NODE_SHARING_TIER_3);
1316 EXPECT_TRUE(features.CrossNodeAtomicShaderInstructions());
1317
1318 EXPECT_EQ(features.RaytracingTier(), D3D12_RAYTRACING_TIER_1_1);
1319 EXPECT_EQ(features.RenderPassesTier(), D3D12_RENDER_PASS_TIER_2);
1320 EXPECT_TRUE(features.SRVOnlyTiledResourceTier3());
1321
1322 EXPECT_TRUE(features.DisplayableTexture());
1323
1324 EXPECT_TRUE(features.AdditionalShadingRatesSupported());
1325 EXPECT_TRUE(features.BackgroundProcessingSupported());
1326 EXPECT_TRUE(features.PerPrimitiveShadingRateSupportedWithViewportIndexing());
1327 EXPECT_EQ(features.ShadingRateImageTileSize(), 10);
1328 EXPECT_EQ(features.VariableShadingRateTier(), D3D12_VARIABLE_SHADING_RATE_TIER_2);
1329
1330 EXPECT_EQ(features.MeshShaderTier(), D3D12_MESH_SHADER_TIER_1);
1331 EXPECT_EQ(features.SamplerFeedbackTier(), D3D12_SAMPLER_FEEDBACK_TIER_1_0);
1332
1333 EXPECT_EQ(features.ProtectedResourceSessionTypeCount(0), 2);
1334 EXPECT_EQ(features.ProtectedResourceSessionTypeCount(1), 1);
1335 EXPECT_EQ(features.ProtectedResourceSessionTypes(0), device->m_ProtectedResourceSessionTypes[0]);
1336 EXPECT_EQ(features.ProtectedResourceSessionTypes(1), device->m_ProtectedResourceSessionTypes[1]);
1337
1338 EXPECT_TRUE(features.UnalignedBlockTexturesSupported());
1339
1340 EXPECT_TRUE(features.MeshShaderPipelineStatsSupported());
1341 EXPECT_TRUE(features.MeshShaderSupportsFullRangeRenderTargetArrayIndex());
1342 EXPECT_TRUE(features.AtomicInt64OnTypedResourceSupported());
1343 EXPECT_TRUE(features.AtomicInt64OnGroupSharedSupported());
1344 EXPECT_TRUE(features.DerivativesInMeshAndAmplificationShadersSupported());
1345 EXPECT_EQ(features.WaveMMATier(), D3D12_WAVE_MMA_TIER_1_0);
1346
1347 EXPECT_TRUE(features.VariableRateShadingSumCombinerSupported());
1348 EXPECT_TRUE(features.MeshShaderPerPrimitiveShadingRateSupported());
1349
1350 EXPECT_TRUE(features.AtomicInt64OnDescriptorHeapResourceSupported());
1351
1352 EXPECT_EQ(features.MSPrimitivesPipelineStatisticIncludesCulledPrimitives(), D3D12_TRI_STATE_TRUE);
1353 EXPECT_TRUE(features.EnhancedBarriersSupported());
1354} \ No newline at end of file