Skip to content

Commit fd963ca

Browse files
author
Greg Roth
authored
ShaderOpTest limit commandlist6 to where supported (#3602)
Merged #3600 into release-1.6.2104 Because version 6 of the command list pointer was being created whenever the available SDK supported it, sometimes the test would try to create version 6 where it wasn't supported. Instead, this just stores the base pointer type and casts it up where we know support is available. (cherry picked from commit 30e306f)
1 parent 1c656c9 commit fd963ca

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

tools/clang/unittests/HLSL/ShaderOpTest.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ void ShaderOpTest::CreatePipelineState() {
475475
PDesc.SizeInBytes = sizeof(MDesc);
476476
PDesc.pPipelineStateSubobjectStream = &MDesc;
477477

478-
ID3D12Device2 *pDevice2;
478+
CComPtr<ID3D12Device2> pDevice2;
479479
CHECK_HR(m_pDevice->QueryInterface(&pDevice2));
480480

481481
CHECK_HR(pDevice2->CreatePipelineState(&PDesc, IID_PPV_ARGS(&m_pPSO)));
@@ -902,7 +902,12 @@ void ShaderOpTest::RunCommandList() {
902902

903903
#if defined(NTDDI_WIN10_VB) && WDK_NTDDI_VERSION >= NTDDI_WIN10_VB
904904
if (m_pShaderOp->MS) {
905-
ID3D12GraphicsCommandList6 *pList6 = m_CommandList.List.p;
905+
#ifndef NDEBUG
906+
D3D12_FEATURE_DATA_D3D12_OPTIONS7 O7;
907+
DXASSERT_LOCALVAR(O7, SUCCEEDED(m_pDevice->CheckFeatureSupport((D3D12_FEATURE)D3D12_FEATURE_D3D12_OPTIONS7, &O7, sizeof(O7))), "mesh shader test enabled on platform without mesh support");
908+
#endif
909+
CComPtr<ID3D12GraphicsCommandList6> pList6;
910+
CHECK_HR(m_CommandList.List.p->QueryInterface(&pList6));
906911
pList6->BeginQuery(m_pQueryHeap, D3D12_QUERY_TYPE_PIPELINE_STATISTICS, 0);
907912
pList6->DispatchMesh(1, 1, 1);
908913
pList6->EndQuery(m_pQueryHeap, D3D12_QUERY_TYPE_PIPELINE_STATISTICS, 0);

tools/clang/unittests/HLSL/ShaderOpTest.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,7 @@ class ShaderOpSet {
240240
// Use this structure to refer to a command allocator/list/queue triple.
241241
struct CommandListRefs {
242242
CComPtr<ID3D12CommandAllocator> Allocator;
243-
#if defined(NTDDI_WIN10_VB) && WDK_NTDDI_VERSION >= NTDDI_WIN10_VB
244-
CComPtr<ID3D12GraphicsCommandList6> List;
245-
#else
246243
CComPtr<ID3D12GraphicsCommandList> List;
247-
#endif
248244
CComPtr<ID3D12CommandQueue> Queue;
249245

250246
void CreateForDevice(ID3D12Device *pDevice, bool compute);

0 commit comments

Comments
 (0)