mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-06-09 02:31:07 +00:00
Compile fix for checking vulkan handle directly as bool
This commit is contained in:
@@ -815,7 +815,7 @@ bool WrappedVulkan::Serialise_InitialState(SerialiserType &ser, ResourceId id, W
|
||||
ser.Serialise("Contents", Contents, ContentsSize, SerialiserFlags::NoFlags);
|
||||
|
||||
// unmap the resource we mapped before - we need to do this on read and on write.
|
||||
if(!IsStructuredExporting(m_State) && mappedMem)
|
||||
if(!IsStructuredExporting(m_State) && mappedMem != VK_NULL_HANDLE)
|
||||
ObjDisp(d)->UnmapMemory(Unwrap(d), Unwrap(mappedMem));
|
||||
|
||||
SERIALISE_CHECK_READ_ERRORS();
|
||||
|
||||
@@ -548,7 +548,7 @@ bool WrappedVulkan::Serialise_SparseBufferInitialState(
|
||||
ser.Serialise("Contents", Contents, ContentsSize, SerialiserFlags::NoFlags);
|
||||
|
||||
// unmap the resource we mapped before - we need to do this on read and on write.
|
||||
if(!IsStructuredExporting(m_State) && mappedMem)
|
||||
if(!IsStructuredExporting(m_State) && mappedMem != VK_NULL_HANDLE)
|
||||
ObjDisp(d)->UnmapMemory(Unwrap(d), Unwrap(mappedMem));
|
||||
|
||||
SERIALISE_CHECK_READ_ERRORS();
|
||||
@@ -653,7 +653,7 @@ bool WrappedVulkan::Serialise_SparseImageInitialState(SerialiserType &ser, Resou
|
||||
ser.Serialise("Contents", Contents, ContentsSize, SerialiserFlags::NoFlags);
|
||||
|
||||
// unmap the resource we mapped before - we need to do this on read and on write.
|
||||
if(!IsStructuredExporting(m_State) && mappedMem)
|
||||
if(!IsStructuredExporting(m_State) && mappedMem != VK_NULL_HANDLE)
|
||||
ObjDisp(d)->UnmapMemory(Unwrap(d), Unwrap(mappedMem));
|
||||
|
||||
SERIALISE_CHECK_READ_ERRORS();
|
||||
|
||||
@@ -604,7 +604,7 @@ bool WrappedVulkan::Serialise_vkUnmapMemory(SerialiserType &ser, VkDevice device
|
||||
SERIALISE_ELEMENT(MapOffset);
|
||||
SERIALISE_ELEMENT(MapSize);
|
||||
|
||||
if(IsReplayingAndReading() && memory)
|
||||
if(IsReplayingAndReading() && memory != VK_NULL_HANDLE)
|
||||
{
|
||||
VkResult vkr = ObjDisp(device)->MapMemory(Unwrap(device), Unwrap(memory), MapOffset, MapSize, 0,
|
||||
(void **)&MapData);
|
||||
@@ -616,7 +616,7 @@ bool WrappedVulkan::Serialise_vkUnmapMemory(SerialiserType &ser, VkDevice device
|
||||
// directly into upload memory
|
||||
ser.Serialise("MapData", MapData, MapSize, SerialiserFlags::NoFlags);
|
||||
|
||||
if(IsReplayingAndReading() && MapData && memory)
|
||||
if(IsReplayingAndReading() && MapData && memory != VK_NULL_HANDLE)
|
||||
ObjDisp(device)->UnmapMemory(Unwrap(device), Unwrap(memory));
|
||||
|
||||
SERIALISE_CHECK_READ_ERRORS();
|
||||
@@ -727,7 +727,7 @@ bool WrappedVulkan::Serialise_vkFlushMappedMemoryRanges(SerialiserType &ser, VkD
|
||||
MappedData = state->mappedPtr + (size_t)MemRange.offset;
|
||||
}
|
||||
|
||||
if(IsReplayingAndReading() && MemRange.memory)
|
||||
if(IsReplayingAndReading() && MemRange.memory != VK_NULL_HANDLE)
|
||||
{
|
||||
VkResult ret =
|
||||
ObjDisp(device)->MapMemory(Unwrap(device), Unwrap(MemRange.memory), MemRange.offset,
|
||||
@@ -740,7 +740,7 @@ bool WrappedVulkan::Serialise_vkFlushMappedMemoryRanges(SerialiserType &ser, VkD
|
||||
// directly into upload memory
|
||||
ser.Serialise("MappedData", MappedData, memRangeSize, SerialiserFlags::NoFlags);
|
||||
|
||||
if(IsReplayingAndReading() && MappedData && MemRange.memory)
|
||||
if(IsReplayingAndReading() && MappedData && MemRange.memory != VK_NULL_HANDLE)
|
||||
ObjDisp(device)->UnmapMemory(Unwrap(device), Unwrap(MemRange.memory));
|
||||
|
||||
SERIALISE_CHECK_READ_ERRORS();
|
||||
|
||||
Reference in New Issue
Block a user