diff --git a/renderdoc/driver/gl/gl_shaderdebug.cpp b/renderdoc/driver/gl/gl_shaderdebug.cpp index 4d2047d56..71a000b05 100644 --- a/renderdoc/driver/gl/gl_shaderdebug.cpp +++ b/renderdoc/driver/gl/gl_shaderdebug.cpp @@ -2463,10 +2463,12 @@ struct ResultData uvec4 helperBallot; uint numSubgroups; - // split out because we use std140 packing which won't pack {uint, uvec3} + uint shadRate; // unused, matches declaration & vulkan uint pad1; uint pad2; - uint pad3; + + // padding so overall struct size is 8-byte aligned for if LaneData contains 8-byte data + uvec4 paddingForDoubles; LaneData laneData[NUMLANES]; }; @@ -2479,6 +2481,9 @@ layout(std140) buffer Output uint hit_count; uint total_count; uvec2 pad; + + // extra padding so the offset of ResultData is 8-byte aligned in case we have user 8-byte inputs + uvec4 paddingForDoubles; ResultData hits[]; } outbuffer; @@ -3133,7 +3138,7 @@ ShaderDebugTrace *GLReplay::DebugVertex(uint32_t eventId, uint32_t vertid, uint3 (void)hit_count; // RDCASSERTMSG("Should only get one hit for vertex shaders", hit_count == 1, hit_count); - base += sizeof(Vec4f); + base += offsetof(rdcspv::ResultBaseBuffer, hits); rdcspv::ResultDataBase *winner = (rdcspv::ResultDataBase *)base; @@ -3547,7 +3552,7 @@ ShaderDebugTrace *GLReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, hit_count = maxHits; } - base += sizeof(Vec4f); + base += offsetof(rdcspv::ResultBaseBuffer, hits); rdcspv::ResultDataBase *winner = NULL; @@ -4007,7 +4012,7 @@ ShaderDebugTrace *GLReplay::DebugThread(uint32_t eventId, const rdcfixedarray }; } -struct HitStorage -{ - uint32_t hit_count; - uint32_t total_count; - uint32_t dummy; - uint32_t padding; - - // extra padding so the offset of LaneData is 8-byte aligned in case we have user 8-byte inputs - Vec4u paddingForDoubles; - - // dummy entry, used only for offsets of LaneData hits[]; - byte hits; -}; - // should match the descriptor set layout created in ShaderDebugData::Init() enum class ShaderDebugBind { @@ -4408,12 +4394,13 @@ static void CreateInputFetcher(rdcarray &spv, const rdcarray