Do not access baseResourceMem on unbound buffer

This commit is contained in:
Cam Mannett
2024-11-02 11:45:32 +00:00
committed by Baldur Karlsson
parent 0193703037
commit 38a61a2ec6
+4
View File
@@ -42,6 +42,10 @@ GPUAddressRange WrappedVulkan::CreateAddressRange(VkDevice device, VkBuffer buff
VkResourceRecord *record = GetRecord(buffer);
VkResourceRecord *memrecord = GetResourceManager()->GetResourceRecord(record->baseResourceMem);
// Just in case this is called when a buffer is being destroyed without being bound
if(!memrecord)
return {};
const VkBufferDeviceAddressInfo addrInfo = {
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO,
NULL,