Преглед изворни кода

Refix new resource creation in rawgather test (#4443)

The previous usage of createCommittedResource3 had a parameter of the
incorrect type too
Greg Roth пре 3 година
родитељ
комит
0d053cce0e
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      tools/clang/unittests/HLSL/ExecutionTest.cpp

+ 4 - 1
tools/clang/unittests/HLSL/ExecutionTest.cpp

@@ -937,11 +937,14 @@ public:
 #if defined(NTDDI_WIN10_CU) && WDK_NTDDI_VERSION >= NTDDI_WIN10_CU
 #if defined(NTDDI_WIN10_CU) && WDK_NTDDI_VERSION >= NTDDI_WIN10_CU
     if (castFormat) {
     if (castFormat) {
       CComPtr<ID3D12Device10> pDevice10;
       CComPtr<ID3D12Device10> pDevice10;
+      // Copy resDesc0 to resDesc1 zeroing anything new
+      D3D12_RESOURCE_DESC1 resDesc1 = {0};
+      memcpy(&resDesc1, &resDesc, sizeof(resDesc));
       VERIFY_SUCCEEDED(pDevice->QueryInterface(IID_PPV_ARGS(&pDevice10)));
       VERIFY_SUCCEEDED(pDevice->QueryInterface(IID_PPV_ARGS(&pDevice10)));
       VERIFY_SUCCEEDED(pDevice10->CreateCommittedResource3(
       VERIFY_SUCCEEDED(pDevice10->CreateCommittedResource3(
         &defaultHeapProperties,
         &defaultHeapProperties,
         D3D12_HEAP_FLAG_NONE,
         D3D12_HEAP_FLAG_NONE,
-        &resDesc,
+        &resDesc1,
         D3D12_BARRIER_LAYOUT_COPY_DEST,
         D3D12_BARRIER_LAYOUT_COPY_DEST,
         nullptr,
         nullptr,
         nullptr,
         nullptr,