Explorar o código

Examples: Win32+DirectX12: Fixed ExampleDescriptorHeapAllocator overflow free index.

Amend 40b2286d1.
PuPuHX hai 5 meses
pai
achega
3d900edba7
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      examples/example_win32_directx12/main.cpp

+ 1 - 1
examples/example_win32_directx12/main.cpp

@@ -54,7 +54,7 @@ struct ExampleDescriptorHeapAllocator
         HeapHandleIncrement = device->GetDescriptorHandleIncrementSize(HeapType);
         HeapHandleIncrement = device->GetDescriptorHandleIncrementSize(HeapType);
         FreeIndices.reserve((int)desc.NumDescriptors);
         FreeIndices.reserve((int)desc.NumDescriptors);
         for (int n = desc.NumDescriptors; n > 0; n--)
         for (int n = desc.NumDescriptors; n > 0; n--)
-            FreeIndices.push_back(n);
+            FreeIndices.push_back(n - 1);
     }
     }
     void Destroy()
     void Destroy()
     {
     {