Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 6aca71d

Browse files
timvpGoogleCommit Bot
authored andcommitted
Vulkan: Full support for program interface queries
When an interface block's field is determined to be active, it's possible that the field is a struct so each of that field's fields need to be marked active as well. Bug: angleproject:3596 Test: dEQP-GLES31.functional.program_interface_query.* Test: end2end ProgramInterfaceTestES31 Change-Id: I0bf550046a7a1d3c92cc08773138a40400e5e73b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1749332 Reviewed-by: Courtney Goeltzenleuchter <[email protected]> Reviewed-by: Geoff Lang <[email protected]> Commit-Queue: Tim Van Patten <[email protected]>
1 parent ca8ea0a commit 6aca71d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/compiler/translator/CollectVariables.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ VarT *FindVariable(const ImmutableString &name, std::vector<VarT> *infoList)
6868
return nullptr;
6969
}
7070

71-
// Note that this shouldn't be called for interface blocks - active information is collected for
72-
// individual fields in case of interface blocks.
7371
void MarkActive(ShaderVariable *variable)
7472
{
7573
if (!variable->active)
@@ -82,7 +80,7 @@ void MarkActive(ShaderVariable *variable)
8280
MarkActive(&field);
8381
}
8482
}
85-
ASSERT(variable->staticUse);
83+
variable->staticUse = true;
8684
variable->active = true;
8785
}
8886
}
@@ -931,8 +929,8 @@ bool CollectVariablesTraverser::visitBinary(Visit, TIntermBinary *binaryNode)
931929
// TODO(oetuaho): Would be nicer to record static use of fields of named interface blocks
932930
// more accurately at parse time - now we only mark the fields statically used if they are
933931
// active. http://anglebug.com/2440
934-
namedBlock->fields[fieldIndex].staticUse = true;
935-
namedBlock->fields[fieldIndex].active = true;
932+
// We need to mark this field and all of its sub-fields, as static/active
933+
MarkActive(&namedBlock->fields[fieldIndex]);
936934

937935
if (traverseIndexExpression)
938936
{

0 commit comments

Comments
 (0)