Add render resource handling for geometry

This commit is contained in:
Georg Hagen
2024-08-21 14:33:45 +02:00
parent b13c1c54ae
commit 2d08b3ab91
6 changed files with 59 additions and 68 deletions

View File

@@ -20,13 +20,12 @@ namespace OpenVulkano::Vulkan
{
SimpleDrawable* drawable = static_cast<SimpleDrawable*>(instance);
Geometry* mesh = drawable->GetMesh();
VulkanGeometry* renderGeo = static_cast<VulkanGeometry*>(mesh->renderGeo);
VulkanGeometry* renderGeo = mesh->GetRenderResource();
if (!renderGeo) renderGeo = drawContext->renderer->GetResourceManager().PrepareGeometry(mesh);
renderGeo->RecordBind(drawContext->commandBuffer);
if (drawable->GetBuffer())
{
VulkanUniformBuffer* vkBuffer = drawable->GetBuffer()->GetRenderResource();
if (!vkBuffer)
{