When patching mesh shaders only consider globals for its entry point

* For shaders with multiple entry points we can't process outputs for other
  entry points that may not be arrayed.
This commit is contained in:
baldurk committed 2024-06-04 10:08:08 +01:00
1 parent af67b951de
commit a7e9a60280
1 file changed
+8
+8
View File
@@ -2222,11 +2222,15 @@ static void AddMeshShaderOutputStores(const ShaderReflection &refl,
}
rdcspv::Id entryID;
rdcarray<rdcspv::Id> entryInterface;
for(const rdcspv::EntryPoint &entry : editor.GetEntries())
{
if(entry.name == entryName && entry.executionModel == rdcspv::ExecutionModel::MeshEXT)
{
entryID = entry.id;
entryInterface = entry.usedIds;
}
}
RDCASSERT(entryID);
@@ -2308,6 +2312,10 @@ static void AddMeshShaderOutputStores(const ShaderReflection &refl,
if(var.storage != rdcspv::StorageClass::Output)
continue;
// skip variables that aren't for us
if(!entryInterface.contains(var.id))
continue;
const rdcspv::Decorations &d = editor.GetDecorations(var.id);
// global variables are all pointers
const rdcspv::DataType &pointerType = editor.GetDataType(editor.GetIDType(var.id));