mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-09 08:11:06 +00:00
Don't create degenerate access chain to load global variable
* This seems like it's legal, but let's not do it anyway just in case.
This commit is contained in:
@@ -3009,8 +3009,15 @@ static void CreatePSInputFetcher(rdcarray<uint32_t> &fragspv, uint32_t &structSt
|
||||
|
||||
rdcspv::Id ptrType =
|
||||
editor.DeclareType(rdcspv::Pointer(values[i].valueType, rdcspv::StorageClass::Input));
|
||||
rdcspv::Id ptr =
|
||||
ops.add(rdcspv::OpAccessChain(ptrType, editor.MakeId(), access.ID, accessIndices));
|
||||
|
||||
// if we have no access chain it's a global pointer of the type we want, so just load
|
||||
// straight out of it
|
||||
rdcspv::Id ptr;
|
||||
if(accessIndices.empty())
|
||||
ptr = access.ID;
|
||||
else
|
||||
ptr = ops.add(rdcspv::OpAccessChain(ptrType, editor.MakeId(), access.ID, accessIndices));
|
||||
|
||||
rdcspv::Id base = ops.add(rdcspv::OpLoad(values[i].valueType, editor.MakeId(), ptr));
|
||||
|
||||
values[i].data[Variant_Base] = base;
|
||||
|
||||
Reference in New Issue
Block a user