Fix NanoVDB upload buffer early release causing white screen

This commit is contained in:
2026-03-11 19:14:14 +08:00
parent 8a800f99a2
commit 926e9a6b75
2 changed files with 5 additions and 1 deletions

View File

@@ -92,7 +92,11 @@ bool LoadNanoVDB(const char* filePath, NanoVDBData& outData, ID3D12GraphicsComma
barrier.Transition.StateAfter = D3D12_RESOURCE_STATE_GENERIC_READ;
cmdList->ResourceBarrier(1, &barrier);
EndCommandList();
WaitForCompletionOfCommandList();
uploadBuffer->Release();
GetCommandAllocator()->Reset();
cmdList->Reset(GetCommandAllocator(), nullptr);
}
std::cout << "[NanoVDB] Loaded: " << byteSize << " bytes, " << elementCount << " elements" << std::endl;

View File

@@ -104,7 +104,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
StaticMeshComponent staticMeshComponent;
staticMeshComponent.InitFromFile(commandList, "Res/Model/Sphere.lhsm");
bool runTest = false; // set to true to run NanoVDB test
bool runTest = true; // set to true to run NanoVDB test
if (runTest) {
RunNanoVDBTest();
}