Compile fix for checking vulkan handle directly as bool

This commit is contained in:
baldurk
2017-11-24 18:25:43 +00:00
parent ea77204580
commit 58ac0ccfb2
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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();