Store shader interface variables as per query spec

GLES 3.1 section 7.3.1.1 specifies how active variable entries should
be generated and how active variables are named. The specs for program
interface variable queries are built on top of this section.

ANGLE has already followed this spec for the most part for generating
variable lists in ProgramState, but now we also follow the naming spec
for arrays and include [0] at the end of the stored name.

This will make implementing arrays of arrays more straightforward.
Most logic for variable queries will just keep working as is when
arrays of arrays are added instead of needing more complex logic for
handling array indexing.

BUG=angleproject:2125
TEST=angle_end2end_tests

Change-Id: I3acd14253153e10bc312114b0303065da2efb506
Reviewed-on: https://chromium-review.googlesource.com/739826
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
This commit is contained in:
Olli Etuaho authored and Commit Bot committed 2017-11-03 15:52:26 +00:00
1 parent c67323a9de
commit d255123c63
15 files changed
+383 -157

No files matched your search

+10
View File
@@ -158,6 +158,11 @@ Optional<std::vector<wchar_t>> WidenString(size_t length, const char *cString)
return Optional<std::vector<wchar_t>>(wcstring);
}
bool BeginsWith(const std::string &str, const std::string &prefix)
{
return strncmp(str.c_str(), prefix.c_str(), prefix.length()) == 0;
}
bool BeginsWith(const std::string &str, const char *prefix)
{
return strncmp(str.c_str(), prefix, strlen(prefix)) == 0;
@@ -168,6 +173,11 @@ bool BeginsWith(const char *str, const char *prefix)
return strncmp(str, prefix, strlen(prefix)) == 0;
}
bool BeginsWith(const std::string &str, const std::string &prefix, const size_t prefixLength)
{
return strncmp(str.c_str(), prefix.c_str(), prefixLength) == 0;
}
bool EndsWith(const std::string &str, const char *suffix)
{
const auto len = strlen(suffix);