diff --git a/renderdoc/driver/vulkan/vk_serialise.cpp b/renderdoc/driver/vulkan/vk_serialise.cpp index 4f225b5b8a..5ab13dd36e 100644 --- a/renderdoc/driver/vulkan/vk_serialise.cpp +++ b/renderdoc/driver/vulkan/vk_serialise.cpp @@ -2460,8 +2460,8 @@ void DoSerialise(SerialiserType &ser, VkBufferViewCreateInfo &el) SERIALISE_MEMBER_VKFLAGS(VkBufferViewCreateFlags, flags); SERIALISE_MEMBER(buffer).Important(); SERIALISE_MEMBER(format).Important(); - SERIALISE_MEMBER(offset); - SERIALISE_MEMBER(range); + SERIALISE_MEMBER(offset).OffsetOrSize(); + SERIALISE_MEMBER(range).OffsetOrSize(); } template <> @@ -2541,10 +2541,10 @@ void Deserialise(const VkImageViewCreateInfo &el) template void DoSerialise(SerialiserType &ser, VkSparseMemoryBind &el) { - SERIALISE_MEMBER(resourceOffset); - SERIALISE_MEMBER(size); + SERIALISE_MEMBER(resourceOffset).OffsetOrSize(); + SERIALISE_MEMBER(size).OffsetOrSize(); SERIALISE_MEMBER(memory); - SERIALISE_MEMBER(memoryOffset); + SERIALISE_MEMBER(memoryOffset).OffsetOrSize(); SERIALISE_MEMBER_VKFLAGS(VkSparseMemoryBindFlags, flags); } @@ -2580,10 +2580,10 @@ template void DoSerialise(SerialiserType &ser, VkSparseImageMemoryBind &el) { SERIALISE_MEMBER(subresource); - SERIALISE_MEMBER(offset); + SERIALISE_MEMBER(offset).OffsetOrSize(); SERIALISE_MEMBER(extent); SERIALISE_MEMBER(memory); - SERIALISE_MEMBER(memoryOffset); + SERIALISE_MEMBER(memoryOffset).OffsetOrSize(); SERIALISE_MEMBER_VKFLAGS(VkSparseMemoryBindFlags, flags); } @@ -2828,7 +2828,7 @@ void DoSerialise(SerialiserType &ser, VkVertexInputAttributeDescription &el) SERIALISE_MEMBER(location); SERIALISE_MEMBER(binding); SERIALISE_MEMBER(format); - SERIALISE_MEMBER(offset); + SERIALISE_MEMBER(offset).OffsetOrSize(); } template @@ -3239,14 +3239,14 @@ template void DoSerialise(SerialiserType &ser, VkSpecializationMapEntry &el) { SERIALISE_MEMBER(constantID); - SERIALISE_MEMBER(offset); + SERIALISE_MEMBER(offset).OffsetOrSize(); // this was accidentally duplicated - hide it from the UI SERIALISE_MEMBER(constantID).Hidden(); // don't serialise size_t, otherwise capture/replay between different bit-ness won't work { uint64_t size = el.size; - ser.Serialise("size"_lit, size); + ser.Serialise("size"_lit, size).OffsetOrSize(); if(ser.IsReading()) el.size = (size_t)size; } @@ -3388,7 +3388,7 @@ void DoSerialise(SerialiserType &ser, VkMemoryAllocateInfo &el) RDCASSERT(ser.IsReading() || el.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO); SerialiseNext(ser, el.sType, el.pNext); - SERIALISE_MEMBER(allocationSize).Important(); + SERIALISE_MEMBER(allocationSize).Important().OffsetOrSize(); SERIALISE_MEMBER(memoryTypeIndex).Important(); } @@ -3431,8 +3431,8 @@ void DoSerialise(SerialiserType &ser, VkBufferMemoryBarrier &el) SERIALISE_MEMBER_TYPED(int32_t, srcQueueFamilyIndex); SERIALISE_MEMBER_TYPED(int32_t, dstQueueFamilyIndex); SERIALISE_MEMBER(buffer).Important(); - SERIALISE_MEMBER(offset); - SERIALISE_MEMBER(size); + SERIALISE_MEMBER(offset).OffsetOrSize(); + SERIALISE_MEMBER(size).OffsetOrSize(); } template <> @@ -3802,8 +3802,8 @@ void DoSerialise(SerialiserType &ser, VkDescriptorBufferInfo &el) OPTIONAL_RESOURCES(); SERIALISE_MEMBER(buffer); - SERIALISE_MEMBER(offset); - SERIALISE_MEMBER(range); + SERIALISE_MEMBER(offset).OffsetOrSize(); + SERIALISE_MEMBER(range).OffsetOrSize(); } template @@ -3928,8 +3928,8 @@ template void DoSerialise(SerialiserType &ser, VkPushConstantRange &el) { SERIALISE_MEMBER_VKFLAGS(VkShaderStageFlags, stageFlags); - SERIALISE_MEMBER(offset); - SERIALISE_MEMBER(size); + SERIALISE_MEMBER(offset).OffsetOrSize(); + SERIALISE_MEMBER(size).OffsetOrSize(); } template @@ -3994,8 +3994,8 @@ void DoSerialise(SerialiserType &ser, VkMappedMemoryRange &el) SerialiseNext(ser, el.sType, el.pNext); SERIALISE_MEMBER(memory).Important(); - SERIALISE_MEMBER(offset); - SERIALISE_MEMBER(size); + SERIALISE_MEMBER(offset).OffsetOrSize(); + SERIALISE_MEMBER(size).OffsetOrSize(); } template <> @@ -4007,7 +4007,7 @@ void Deserialise(const VkMappedMemoryRange &el) template void DoSerialise(SerialiserType &ser, VkBufferImageCopy &el) { - SERIALISE_MEMBER(bufferOffset); + SERIALISE_MEMBER(bufferOffset).OffsetOrSize(); SERIALISE_MEMBER(bufferRowLength); SERIALISE_MEMBER(bufferImageHeight); SERIALISE_MEMBER(imageSubresource); @@ -4018,9 +4018,9 @@ void DoSerialise(SerialiserType &ser, VkBufferImageCopy &el) template void DoSerialise(SerialiserType &ser, VkBufferCopy &el) { - SERIALISE_MEMBER(srcOffset); - SERIALISE_MEMBER(dstOffset); - SERIALISE_MEMBER(size); + SERIALISE_MEMBER(srcOffset).OffsetOrSize(); + SERIALISE_MEMBER(dstOffset).OffsetOrSize(); + SERIALISE_MEMBER(size).OffsetOrSize(); } template @@ -5126,8 +5126,8 @@ void DoSerialise(SerialiserType &ser, DescriptorSetSlot &el) { VkDeviceSize offset = el.offset; VkDeviceSize range = el.GetRange(); - SERIALISE_ELEMENT(offset); - SERIALISE_ELEMENT(range); + SERIALISE_ELEMENT(offset).OffsetOrSize(); + SERIALISE_ELEMENT(range).OffsetOrSize(); el.offset = offset; el.range = range; } @@ -5313,8 +5313,8 @@ void DoSerialise(SerialiserType &ser, VkDescriptorUpdateTemplateEntry &el) offset = el.offset; stride = el.stride; } - ser.Serialise("offset"_lit, offset); - ser.Serialise("stride"_lit, stride); + ser.Serialise("offset"_lit, offset).OffsetOrSize(); + ser.Serialise("stride"_lit, stride).OffsetOrSize(); if(ser.IsReading()) { el.offset = (size_t)offset; @@ -5324,8 +5324,8 @@ void DoSerialise(SerialiserType &ser, VkDescriptorUpdateTemplateEntry &el) #if DISABLED(RDOC_APPLE) else { - SERIALISE_MEMBER(offset); - SERIALISE_MEMBER(stride); + SERIALISE_MEMBER(offset).OffsetOrSize(); + SERIALISE_MEMBER(stride).OffsetOrSize(); } #endif } @@ -5379,7 +5379,7 @@ void DoSerialise(SerialiserType &ser, VkBindBufferMemoryInfo &el) SERIALISE_MEMBER(buffer).Important(); SERIALISE_MEMBER(memory).Important(); - SERIALISE_MEMBER(memoryOffset); + SERIALISE_MEMBER(memoryOffset).OffsetOrSize(); } template <> @@ -5396,7 +5396,7 @@ void DoSerialise(SerialiserType &ser, VkBindImageMemoryInfo &el) SERIALISE_MEMBER(image).Important(); SERIALISE_MEMBER(memory).Important(); - SERIALISE_MEMBER(memoryOffset); + SERIALISE_MEMBER(memoryOffset).OffsetOrSize(); } template <> @@ -7861,9 +7861,9 @@ void DoSerialise(SerialiserType &ser, VkBufferCopy2 &el) RDCASSERT(ser.IsReading() || el.sType == VK_STRUCTURE_TYPE_BUFFER_COPY_2); SerialiseNext(ser, el.sType, el.pNext); - SERIALISE_MEMBER(srcOffset); - SERIALISE_MEMBER(dstOffset); - SERIALISE_MEMBER(size); + SERIALISE_MEMBER(srcOffset).OffsetOrSize(); + SERIALISE_MEMBER(dstOffset).OffsetOrSize(); + SERIALISE_MEMBER(size).OffsetOrSize(); } template <> @@ -7937,7 +7937,7 @@ void DoSerialise(SerialiserType &ser, VkBufferImageCopy2 &el) RDCASSERT(ser.IsReading() || el.sType == VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2); SerialiseNext(ser, el.sType, el.pNext); - SERIALISE_MEMBER(bufferOffset); + SERIALISE_MEMBER(bufferOffset).OffsetOrSize(); SERIALISE_MEMBER(bufferRowLength); SERIALISE_MEMBER(bufferImageHeight); SERIALISE_MEMBER(imageSubresource); @@ -10492,8 +10492,8 @@ void DoSerialise(SerialiserType &ser, VkBufferMemoryBarrier2 &el) SERIALISE_MEMBER_TYPED(int32_t, srcQueueFamilyIndex); SERIALISE_MEMBER_TYPED(int32_t, dstQueueFamilyIndex); SERIALISE_MEMBER(buffer).Important(); - SERIALISE_MEMBER(offset); - SERIALISE_MEMBER(size); + SERIALISE_MEMBER(offset).OffsetOrSize(); + SERIALISE_MEMBER(size).OffsetOrSize(); } template <> @@ -11157,7 +11157,7 @@ void DoSerialise(SerialiserType &ser, VkConditionalRenderingBeginInfoEXT &el) SerialiseNext(ser, el.sType, el.pNext); SERIALISE_MEMBER(buffer).Important(); - SERIALISE_MEMBER(offset); + SERIALISE_MEMBER(offset).OffsetOrSize(); SERIALISE_MEMBER_VKFLAGS(VkConditionalRenderingFlagsEXT, flags); } diff --git a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp index b42447c249..479af210eb 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp @@ -3710,9 +3710,9 @@ bool WrappedVulkan::Serialise_vkCmdBindVertexBuffers2( SERIALISE_ELEMENT(firstBinding).Important(); SERIALISE_ELEMENT(bindingCount); SERIALISE_ELEMENT_ARRAY(pBuffers, bindingCount).Important(); - SERIALISE_ELEMENT_ARRAY(pOffsets, bindingCount); - SERIALISE_ELEMENT_ARRAY(pSizes, bindingCount); - SERIALISE_ELEMENT_ARRAY(pStrides, bindingCount); + SERIALISE_ELEMENT_ARRAY(pOffsets, bindingCount).OffsetOrSize(); + SERIALISE_ELEMENT_ARRAY(pSizes, bindingCount).OffsetOrSize(); + SERIALISE_ELEMENT_ARRAY(pStrides, bindingCount).OffsetOrSize(); Serialise_DebugMessages(ser); @@ -3817,7 +3817,7 @@ bool WrappedVulkan::Serialise_vkCmdBindIndexBuffer(SerialiserType &ser, { SERIALISE_ELEMENT(commandBuffer); SERIALISE_ELEMENT(buffer).Important(); - SERIALISE_ELEMENT(offset); + SERIALISE_ELEMENT(offset).OffsetOrSize(); SERIALISE_ELEMENT(indexType).Important(); Serialise_DebugMessages(ser); @@ -4463,8 +4463,8 @@ bool WrappedVulkan::Serialise_vkCmdCopyQueryPoolResults( SERIALISE_ELEMENT(firstQuery); SERIALISE_ELEMENT(queryCount); SERIALISE_ELEMENT(destBuffer).Important(); - SERIALISE_ELEMENT(destOffset); - SERIALISE_ELEMENT(destStride); + SERIALISE_ELEMENT(destOffset).OffsetOrSize(); + SERIALISE_ELEMENT(destStride).OffsetOrSize(); SERIALISE_ELEMENT_TYPED(VkQueryResultFlagBits, flags).TypedAs("VkQueryResultFlags"_lit); Serialise_DebugMessages(ser); @@ -5949,7 +5949,7 @@ bool WrappedVulkan::Serialise_vkCmdWriteBufferMarkerAMD(SerialiserType &ser, SERIALISE_ELEMENT(commandBuffer); SERIALISE_ELEMENT(pipelineStage); SERIALISE_ELEMENT(dstBuffer).Important(); - SERIALISE_ELEMENT(dstOffset); + SERIALISE_ELEMENT(dstOffset).OffsetOrSize(); SERIALISE_ELEMENT(marker).Important(); Serialise_DebugMessages(ser); @@ -6016,7 +6016,7 @@ bool WrappedVulkan::Serialise_vkCmdWriteBufferMarker2AMD(SerialiserType &ser, SERIALISE_ELEMENT(commandBuffer); SERIALISE_ELEMENT_TYPED(VkPipelineStageFlagBits2, stage).TypedAs("VkPipelineStageFlags2"_lit); SERIALISE_ELEMENT(dstBuffer).Important(); - SERIALISE_ELEMENT(dstOffset); + SERIALISE_ELEMENT(dstOffset).OffsetOrSize(); SERIALISE_ELEMENT(marker).Important(); Serialise_DebugMessages(ser); @@ -6340,8 +6340,8 @@ bool WrappedVulkan::Serialise_vkCmdBindTransformFeedbackBuffersEXT( SERIALISE_ELEMENT(firstBinding).Important(); SERIALISE_ELEMENT(bindingCount); SERIALISE_ELEMENT_ARRAY(pBuffers, bindingCount).Important(); - SERIALISE_ELEMENT_ARRAY(pOffsets, bindingCount); - SERIALISE_ELEMENT_ARRAY(pSizes, bindingCount); + SERIALISE_ELEMENT_ARRAY(pOffsets, bindingCount).OffsetOrSize(); + SERIALISE_ELEMENT_ARRAY(pSizes, bindingCount).OffsetOrSize(); Serialise_DebugMessages(ser); @@ -6440,7 +6440,7 @@ bool WrappedVulkan::Serialise_vkCmdBeginTransformFeedbackEXT( SERIALISE_ELEMENT(firstBuffer).Important(); SERIALISE_ELEMENT(bufferCount).Important(); SERIALISE_ELEMENT_ARRAY(pCounterBuffers, bufferCount); - SERIALISE_ELEMENT_ARRAY(pCounterBufferOffsets, bufferCount); + SERIALISE_ELEMENT_ARRAY(pCounterBufferOffsets, bufferCount).OffsetOrSize(); Serialise_DebugMessages(ser); @@ -6535,7 +6535,7 @@ bool WrappedVulkan::Serialise_vkCmdEndTransformFeedbackEXT( SERIALISE_ELEMENT(firstBuffer).Important(); SERIALISE_ELEMENT(bufferCount).Important(); SERIALISE_ELEMENT_ARRAY(pCounterBuffers, bufferCount); - SERIALISE_ELEMENT_ARRAY(pCounterBufferOffsets, bufferCount); + SERIALISE_ELEMENT_ARRAY(pCounterBufferOffsets, bufferCount).OffsetOrSize(); Serialise_DebugMessages(ser); diff --git a/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp index 5282adfecf..5f24dda2fe 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp @@ -343,9 +343,9 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu { SERIALISE_ELEMENT(commandBuffer); SERIALISE_ELEMENT(buffer).Important(); - SERIALISE_ELEMENT(offset); + SERIALISE_ELEMENT(offset).OffsetOrSize(); SERIALISE_ELEMENT(count).Important(); - SERIALISE_ELEMENT(stride); + SERIALISE_ELEMENT(stride).OffsetOrSize(); Serialise_DebugMessages(ser); @@ -751,9 +751,9 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, { SERIALISE_ELEMENT(commandBuffer); SERIALISE_ELEMENT(buffer).Important(); - SERIALISE_ELEMENT(offset); + SERIALISE_ELEMENT(offset).OffsetOrSize(); SERIALISE_ELEMENT(count).Important(); - SERIALISE_ELEMENT(stride); + SERIALISE_ELEMENT(stride).OffsetOrSize(); Serialise_DebugMessages(ser); @@ -1206,7 +1206,7 @@ bool WrappedVulkan::Serialise_vkCmdDispatchIndirect(SerialiserType &ser, { SERIALISE_ELEMENT(commandBuffer); SERIALISE_ELEMENT(buffer).Important(); - SERIALISE_ELEMENT(offset); + SERIALISE_ELEMENT(offset).OffsetOrSize(); Serialise_DebugMessages(ser); @@ -2053,8 +2053,8 @@ bool WrappedVulkan::Serialise_vkCmdUpdateBuffer(SerialiserType &ser, VkCommandBu { SERIALISE_ELEMENT(commandBuffer); SERIALISE_ELEMENT(destBuffer).Important(); - SERIALISE_ELEMENT(destOffset); - SERIALISE_ELEMENT(dataSize); + SERIALISE_ELEMENT(destOffset).OffsetOrSize(); + SERIALISE_ELEMENT(dataSize).OffsetOrSize(); // serialise as void* so it goes through as a buffer, not an actual array of integers. const void *Data = (const void *)pData; @@ -2151,8 +2151,8 @@ bool WrappedVulkan::Serialise_vkCmdFillBuffer(SerialiserType &ser, VkCommandBuff { SERIALISE_ELEMENT(commandBuffer); SERIALISE_ELEMENT(destBuffer).Important(); - SERIALISE_ELEMENT(destOffset); - SERIALISE_ELEMENT(fillSize); + SERIALISE_ELEMENT(destOffset).OffsetOrSize(); + SERIALISE_ELEMENT(fillSize).OffsetOrSize(); SERIALISE_ELEMENT(data).Important(); Serialise_DebugMessages(ser); @@ -2738,11 +2738,11 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectCount(SerialiserType &ser, { SERIALISE_ELEMENT(commandBuffer); SERIALISE_ELEMENT(buffer).Important(); - SERIALISE_ELEMENT(offset); + SERIALISE_ELEMENT(offset).OffsetOrSize(); SERIALISE_ELEMENT(countBuffer).Important(); - SERIALISE_ELEMENT(countBufferOffset); + SERIALISE_ELEMENT(countBufferOffset).OffsetOrSize(); SERIALISE_ELEMENT(maxDrawCount).Important(); - SERIALISE_ELEMENT(stride); + SERIALISE_ELEMENT(stride).OffsetOrSize(); Serialise_DebugMessages(ser); @@ -3085,11 +3085,11 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirectCount( { SERIALISE_ELEMENT(commandBuffer); SERIALISE_ELEMENT(buffer).Important(); - SERIALISE_ELEMENT(offset); + SERIALISE_ELEMENT(offset).OffsetOrSize(); SERIALISE_ELEMENT(countBuffer).Important(); - SERIALISE_ELEMENT(countBufferOffset); + SERIALISE_ELEMENT(countBufferOffset).OffsetOrSize(); SERIALISE_ELEMENT(maxDrawCount).Important(); - SERIALISE_ELEMENT(stride); + SERIALISE_ELEMENT(stride).OffsetOrSize(); Serialise_DebugMessages(ser); @@ -3437,9 +3437,9 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectByteCountEXT( SERIALISE_ELEMENT(instanceCount).Important(); SERIALISE_ELEMENT(firstInstance); SERIALISE_ELEMENT(counterBuffer).Important(); - SERIALISE_ELEMENT(counterBufferOffset); - SERIALISE_ELEMENT(counterOffset); - SERIALISE_ELEMENT(vertexStride); + SERIALISE_ELEMENT(counterBufferOffset).OffsetOrSize(); + SERIALISE_ELEMENT(counterOffset).OffsetOrSize(); + SERIALISE_ELEMENT(vertexStride).OffsetOrSize(); Serialise_DebugMessages(ser); diff --git a/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp index 53249aec6f..3c31625469 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp @@ -909,8 +909,8 @@ bool WrappedVulkan::Serialise_vkUnmapMemory(SerialiserType &ser, VkDevice device MapData = (byte *)state->cpuReadPtr + MapOffset; } - SERIALISE_ELEMENT(MapOffset); - SERIALISE_ELEMENT(MapSize); + SERIALISE_ELEMENT(MapOffset).OffsetOrSize(); + SERIALISE_ELEMENT(MapSize).OffsetOrSize(); bool directStream = true; @@ -1384,7 +1384,7 @@ bool WrappedVulkan::Serialise_vkBindBufferMemory(SerialiserType &ser, VkDevice d SERIALISE_ELEMENT(device); SERIALISE_ELEMENT(buffer).Important(); SERIALISE_ELEMENT(memory).Important(); - SERIALISE_ELEMENT(memoryOffset); + SERIALISE_ELEMENT(memoryOffset).OffsetOrSize(); SERIALISE_CHECK_READ_ERRORS(); @@ -1509,7 +1509,7 @@ bool WrappedVulkan::Serialise_vkBindImageMemory(SerialiserType &ser, VkDevice de SERIALISE_ELEMENT(device); SERIALISE_ELEMENT(image).Important(); SERIALISE_ELEMENT(memory).Important(); - SERIALISE_ELEMENT(memoryOffset); + SERIALISE_ELEMENT(memoryOffset).OffsetOrSize(); SERIALISE_CHECK_READ_ERRORS();