vulkan: Add alternatives when nullDescriptor is not supported. (#1001)

* vulkan: Add alternatives when nullDescriptor is not supported.

* vulkan: Set identifying name on null image/image view/buffer
This commit is contained in:
squidbus
2024-09-20 17:50:57 -07:00
committed by GitHub
parent eaa92b5a65
commit 4fe81231f6
8 changed files with 46 additions and 6 deletions

View File

@@ -31,7 +31,11 @@ BufferCache::BufferCache(const Vulkan::Instance& instance_, Vulkan::Scheduler& s
Vulkan::SetObjectName(instance.GetDevice(), gds_buffer.Handle(), "GDS Buffer");
// Ensure the first slot is used for the null buffer
void(slot_buffers.insert(instance, scheduler, MemoryUsage::DeviceLocal, 0, ReadFlags, 1));
const auto null_id =
slot_buffers.insert(instance, scheduler, MemoryUsage::DeviceLocal, 0, ReadFlags, 1);
ASSERT(null_id.index == 0);
const vk::Buffer& null_buffer = slot_buffers[null_id].buffer;
Vulkan::SetObjectName(instance.GetDevice(), null_buffer, "Null Buffer");
}
BufferCache::~BufferCache() = default;

View File

@@ -62,6 +62,11 @@ public:
return &gds_buffer;
}
/// Retrieves the buffer with the specified id.
[[nodiscard]] Buffer& GetBuffer(BufferId id) {
return slot_buffers[id];
}
/// Invalidates any buffer in the logical page range.
void InvalidateMemory(VAddr device_addr, u64 size);