mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 23:16:31 +00:00
Don't serialise size_t directly in VkDescriptorUpdateTemplateEntry
* This caused an incompatibility between 32-bit and 64-bit capture and replay.
This commit is contained in:
@@ -240,6 +240,10 @@ bool VkInitParams::IsSupportedVersion(uint64_t ver)
|
||||
if(ver == CurrentVersion)
|
||||
return true;
|
||||
|
||||
// 0xD -> 0xE - fixed serialisation directly of size_t members in VkDescriptorUpdateTemplateEntry
|
||||
if(ver == 0xD)
|
||||
return true;
|
||||
|
||||
// 0xC -> 0xD - supported multiple queues. This didn't cause a large change to the serialisation
|
||||
// but there were some slight inconsistencies that required a version bump
|
||||
if(ver == 0xC)
|
||||
|
||||
@@ -55,7 +55,7 @@ struct VkInitParams
|
||||
uint32_t GetSerialiseSize();
|
||||
|
||||
// check if a frame capture section version is supported
|
||||
static const uint64_t CurrentVersion = 0xD;
|
||||
static const uint64_t CurrentVersion = 0xE;
|
||||
static bool IsSupportedVersion(uint64_t ver);
|
||||
};
|
||||
|
||||
|
||||
@@ -2235,8 +2235,25 @@ void DoSerialise(SerialiserType &ser, VkDescriptorUpdateTemplateEntry &el)
|
||||
SERIALISE_MEMBER(dstArrayElement);
|
||||
SERIALISE_MEMBER(descriptorCount);
|
||||
SERIALISE_MEMBER(descriptorType);
|
||||
SERIALISE_MEMBER(offset);
|
||||
SERIALISE_MEMBER(stride);
|
||||
|
||||
// these fields are size_t and should not be serialised as-is. They're not used so we can just
|
||||
// serialise them as uint64_t. Unfortunately this wasn't correct initially and they were
|
||||
// serialised as-is making a 32-bit/64-bit incompatibility, so for older versions all we can do is
|
||||
// continue to serialise them as size_t as it's impossible to know which one was used.
|
||||
if(ser.VersionAtLeast(0xE))
|
||||
{
|
||||
uint64_t offset = el.offset;
|
||||
uint64_t stride = el.stride;
|
||||
ser.Serialise("offset", offset);
|
||||
ser.Serialise("stride", stride);
|
||||
el.offset = (size_t)offset;
|
||||
el.stride = (size_t)stride;
|
||||
}
|
||||
else
|
||||
{
|
||||
SERIALISE_MEMBER(offset);
|
||||
SERIALISE_MEMBER(stride);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename SerialiserType>
|
||||
|
||||
Reference in New Issue
Block a user