Fix NanoVDBLoader: reset command list before use
This commit is contained in:
12
main.cpp
12
main.cpp
@@ -17,26 +17,32 @@ LPCWSTR gWindowClassName = L"BattleFire";
|
||||
|
||||
void RunNanoVDBTest() {
|
||||
ID3D12GraphicsCommandList* commandList = GetCommandList();
|
||||
ID3D12CommandAllocator* commandAllocator = GetCommandAllocator();
|
||||
const char* vdbFiles[] = {
|
||||
"Res/NanoVDB/bunny.nvdb"
|
||||
};
|
||||
|
||||
NanoVDBData vdbData = {};
|
||||
|
||||
for (int i = 0; i < sizeof(vdbFiles) / sizeof(vdbFiles[0]); i++) {
|
||||
const char* currentVdbFile = vdbFiles[i];
|
||||
printf("[NanoVDB Test] Loading: %s\n", currentVdbFile);
|
||||
|
||||
NanoVDBData vdbData;
|
||||
bool loadSuccess = LoadNanoVDB(currentVdbFile, vdbData, commandList);
|
||||
bool loadSuccess = LoadNanoVDB(currentVdbFile, vdbData, commandList, commandAllocator);
|
||||
if (loadSuccess) {
|
||||
printf(" SUCCESS - %llu bytes, %llu elements\n",
|
||||
(unsigned long long)vdbData.byteSize,
|
||||
(unsigned long long)vdbData.elementCount);
|
||||
FreeNanoVDB(vdbData);
|
||||
} else {
|
||||
printf(" FAILED\n");
|
||||
}
|
||||
}
|
||||
printf("[NanoVDB Test] Done.\n");
|
||||
|
||||
FreeNanoVDB(vdbData);
|
||||
|
||||
EndCommandList();
|
||||
WaitForCompletionOfCommandList();
|
||||
}
|
||||
|
||||
LRESULT CALLBACK WindowProc(HWND inHWND, UINT inMSG, WPARAM inWParam, LPARAM inLParam) {
|
||||
|
||||
Reference in New Issue
Block a user