summaryrefslogtreecommitdiffstats
path: root/tools/render-test/render-test-main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/render-test/render-test-main.cpp')
-rw-r--r--tools/render-test/render-test-main.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp
index c04d6db00..5c8011889 100644
--- a/tools/render-test/render-test-main.cpp
+++ b/tools/render-test/render-test-main.cpp
@@ -341,6 +341,26 @@ struct AssignValsFromLayoutContext
SLANG_RETURN_ON_FAIL(assign(ShaderCursor(shaderObject), srcVal->contentVal));
+ if (srcVal->specializationArgs.getCount())
+ {
+ List<slang::SpecializationArg> args;
+ for (auto srcArg : srcVal->specializationArgs)
+ {
+ auto argType = slangReflection->findTypeByName(srcArg.getBuffer());
+ if (argType)
+ {
+ slang::SpecializationArg arg = slang::SpecializationArg::fromType(argType);
+ args.add(arg);
+ }
+ else
+ {
+ StdWriters::getError().print(
+ "error: could not find shader type '%s'\n", srcArg.getBuffer());
+ return SLANG_E_INVALID_ARG;
+ }
+ }
+ shaderObject->setSpecializationArgs(args.getBuffer(), args.getCount());
+ }
dstCursor.setObject(shaderObject);
return SLANG_OK;
}