From 4644c5292773095b8ee30483aaf6e017bba3c713 Mon Sep 17 00:00:00 2001 From: nmzik Date: Wed, 21 Oct 2026 05:03:34 +0200 Subject: [PATCH] graphics: initialize BDA tables before first buffer registration Co-authored-by: Leandro Bras --- src/graphics/host_gpu/renderer/cache/bufferCache.cpp | 4 ++++ src/graphics/host_gpu/renderer/commandScheduler.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/graphics/host_gpu/renderer/cache/bufferCache.cpp b/src/graphics/host_gpu/renderer/cache/bufferCache.cpp index d452db969..bad5188af 100644 --- a/src/graphics/host_gpu/renderer/cache/bufferCache.cpp +++ b/src/graphics/host_gpu/renderer/cache/bufferCache.cpp @@ -256,6 +256,10 @@ BufferCache::BufferCache(GraphicContext& graphics, CommandScheduler& scheduler, m_gds_buffer.Flush(0, m_gds_buffer.Size()); SetVulkanObjectNameF(m_graphics.device, m_bda_pagetable_buffer.Handle(), "BDA Page Table Buffer"); + m_scheduler.BeginCommand(); + for (auto* buffer: {&m_bda_pagetable_buffer, m_fault_manager.GetFaultBuffer()}) { + buffer->Fill(0, buffer->Size(), 0); + } const auto null_id = m_slot_buffers.insert(m_graphics, m_scheduler, MemoryUsage::DeviceLocal, 0, AllFlags, 16); EXIT_IF(null_id != NULL_BUFFER_ID); diff --git a/src/graphics/host_gpu/renderer/commandScheduler.cpp b/src/graphics/host_gpu/renderer/commandScheduler.cpp index afab5519e..4ae2b36c4 100644 --- a/src/graphics/host_gpu/renderer/commandScheduler.cpp +++ b/src/graphics/host_gpu/renderer/commandScheduler.cpp @@ -327,7 +327,7 @@ void CommandScheduler::CheckActive() const { } CommandBuffer& CommandScheduler::Current() { - CheckActive(); + EXIT_IF(m_command.IsInvalid()); return m_command; }