mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 10:00:40 +00:00
Use entry point interface ID list if available over building our own
This commit is contained in:
@@ -524,7 +524,8 @@ void Processor::RegisterOp(Iter it)
|
||||
else if(opdata.op == Op::EntryPoint)
|
||||
{
|
||||
OpEntryPoint decoded(it);
|
||||
entries.push_back(EntryPoint(decoded.executionModel, decoded.entryPoint, decoded.name));
|
||||
entries.push_back(
|
||||
EntryPoint(decoded.executionModel, decoded.entryPoint, decoded.name, decoded.iface));
|
||||
}
|
||||
else if(opdata.op == Op::ExecutionMode)
|
||||
{
|
||||
|
||||
@@ -418,11 +418,15 @@ struct ExecutionModes
|
||||
struct EntryPoint
|
||||
{
|
||||
EntryPoint() = default;
|
||||
EntryPoint(ExecutionModel e, Id i, rdcstr n) : executionModel(e), id(i), name(n) {}
|
||||
EntryPoint(ExecutionModel e, Id i, rdcstr n, const rdcarray<Id> &ids)
|
||||
: executionModel(e), id(i), name(n), usedIds(ids)
|
||||
{
|
||||
}
|
||||
ExecutionModel executionModel;
|
||||
Id id;
|
||||
rdcstr name;
|
||||
ExecutionModes executionModes;
|
||||
rdcarray<Id> usedIds;
|
||||
|
||||
bool operator<(const EntryPoint &o) const
|
||||
{
|
||||
|
||||
@@ -737,6 +737,15 @@ void Reflector::MakeReflection(const GraphicsAPI sourceAPI, const ShaderStage st
|
||||
}
|
||||
}
|
||||
|
||||
if(m_MajorVersion > 1 || m_MinorVersion >= 4)
|
||||
{
|
||||
// from SPIR-V 1.4 onwards we can trust the entry point interface list to give us all used
|
||||
// global variables. We still use the above heuristic so we can remove unused members of
|
||||
// gl_PerVertex in structs.
|
||||
usedIds.clear();
|
||||
usedIds.insert(entry->usedIds.begin(), entry->usedIds.end());
|
||||
}
|
||||
|
||||
// arrays of elements, which can be appended to in any order and then sorted
|
||||
rdcarray<SigParameter> inputs;
|
||||
rdcarray<SigParameter> outputs;
|
||||
|
||||
Reference in New Issue
Block a user