Centralize allocation of vertex decode buffers

This commit is contained in:
Henrik Rydgård committed 2023-04-24 12:11:58 +02:00
1 parent 321a112eff
commit 16b243b007
6 files changed
+7 -37

No files matched your search

-8
View File
@@ -75,11 +75,6 @@ DrawEngineVulkan::DrawEngineVulkan(Draw::DrawContext *draw)
decOptions_.alignOutputToWord = true;
#endif
// Allocate nicely aligned memory. Maybe graphics drivers will appreciate it.
// All this is a LOT of memory, need to see if we can cut down somehow.
decoded = (u8 *)AllocateMemoryPages(DECODED_VERTEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
decIndex = (u16 *)AllocateMemoryPages(DECODED_INDEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
indexGen.Setup(decIndex);
}
@@ -214,9 +209,6 @@ void DrawEngineVulkan::InitDeviceObjects() {
}
DrawEngineVulkan::~DrawEngineVulkan() {
FreeMemoryPages(decoded, DECODED_VERTEX_BUFFER_SIZE);
FreeMemoryPages(decIndex, DECODED_INDEX_BUFFER_SIZE);
DestroyDeviceObjects();
}