From 4cf46e5c8b2af8a4ea4db15cd402aae4145a614c Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 20 Feb 2018 18:50:41 -0500 Subject: bug fix: witnessTable's subTypeDeclRef should have default substitution for getSpecailizedMangledName to work properly. --- source/slang/lower-to-ir.cpp | 1 + tools/render-test/slang-support.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/slang/lower-to-ir.cpp b/source/slang/lower-to-ir.cpp index 53cb2e772..b99e2713f 100644 --- a/source/slang/lower-to-ir.cpp +++ b/source/slang/lower-to-ir.cpp @@ -2870,6 +2870,7 @@ struct DeclLoweringVisitor : DeclVisitor if (parentDecl->ParentDecl) witnessTable->genericDecl = dynamic_cast(parentDecl->ParentDecl); witnessTable->subTypeDeclRef = makeDeclRef(parentDecl); + witnessTable->subTypeDeclRef.substitutions = createDefaultSubstitutions(context->getSession(), parentDecl); witnessTable->supTypeDeclRef = inheritanceDecl->base.type->AsDeclRefType()->declRef; // Register the value now, rather than later, to avoid diff --git a/tools/render-test/slang-support.cpp b/tools/render-test/slang-support.cpp index 2a6401d5b..5599a3396 100644 --- a/tools/render-test/slang-support.cpp +++ b/tools/render-test/slang-support.cpp @@ -99,8 +99,9 @@ struct SlangShaderCompilerWrapper : public ShaderCompiler spFindProfile(slangSession, request.computeShader.profile), (int)rawTypeNames.Count(), rawTypeNames.Buffer()); - int compileErr = spCompile(slangRequest); + spSetLineDirectiveMode(slangRequest, SLANG_LINE_DIRECTIVE_MODE_NONE); + int compileErr = spCompile(slangRequest); if (auto diagnostics = spGetDiagnosticOutput(slangRequest)) { fprintf(stderr, "%s", diagnostics); -- cgit v1.2.3