summaryrefslogtreecommitdiffstats
path: root/tools/render-test/shader-input-layout.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-09-01 13:47:26 -0700
committerGitHub <noreply@github.com>2020-09-01 13:47:26 -0700
commit5c56479c7b742f94ebf4a97d93826b2a5e4f279d (patch)
treefdd348b67d09b7af5603532d4015036bee588062 /tools/render-test/shader-input-layout.cpp
parent69025ad82238a7402b18d9c566fac1574faef684 (diff)
Support dynamic existential shader parameters in render-test (#1525)
* Support dynamic existential shader parameters in render-test * Fix linux build error. * Fixes. * Fix code review issues. * Fix gcc error. * More fixes. * More fixes.
Diffstat (limited to 'tools/render-test/shader-input-layout.cpp')
-rw-r--r--tools/render-test/shader-input-layout.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/render-test/shader-input-layout.cpp b/tools/render-test/shader-input-layout.cpp
index 5e487f1ad..edf617f76 100644
--- a/tools/render-test/shader-input-layout.cpp
+++ b/tools/render-test/shader-input-layout.cpp
@@ -398,8 +398,37 @@ namespace renderer_test
parser.Read("=");
parser.Read("[");
+ uint32_t offset = 0;
while (!parser.IsEnd() && !parser.LookAhead("]"))
{
+ RTTIDataEntry rttiEntry;
+ if (parser.LookAhead("rtti"))
+ {
+ parser.ReadToken();
+ parser.Read("(");
+ rttiEntry.type = RTTIDataEntryType::RTTIObject;
+ rttiEntry.typeName = parser.ReadWord();
+ rttiEntry.offset = offset;
+ parser.Read(")");
+ offset += 8;
+ entry.rttiEntries.add(rttiEntry);
+ continue;
+ }
+ else if (parser.LookAhead("witness"))
+ {
+ parser.ReadToken();
+ parser.Read("(");
+ rttiEntry.type = RTTIDataEntryType::WitnessTable;
+ rttiEntry.typeName = parser.ReadWord();
+ parser.Read(",");
+ rttiEntry.interfaceName = parser.ReadWord();
+ rttiEntry.offset = offset;
+ parser.Read(")");
+ offset += 8;
+ entry.rttiEntries.add(rttiEntry);
+ continue;
+ }
+
bool negate = false;
if(parser.NextToken().Type == TokenType::OpSub)
{
@@ -419,6 +448,7 @@ namespace renderer_test
if(negate) floatNum = -floatNum;
entry.bufferData.add(*(unsigned int*)&floatNum);
}
+ offset += 4;
}
parser.Read("]");
}