From ac2d419d41f5ebff22480a9e43398022113073d6 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 17 Jul 2017 16:42:32 -0700 Subject: Make sure to treat imported modules as Slang - When generating parameter binding/reflection info, treated imported modules as Slang code, instead of the source language of the outer translation unit - This fixes an issue where global-scope shader parameters in a `.slang` file were getting ignored for binding-generation purposes when imported by a GLSL file --- source/slang/parameter-binding.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/slang/parameter-binding.cpp') diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp index 8a8a993cd..fbafdd555 100644 --- a/source/slang/parameter-binding.cpp +++ b/source/slang/parameter-binding.cpp @@ -1177,6 +1177,9 @@ static void collectModuleParameters( context->stage = Stage::Unknown; + // All imported modules are implicitly Slang code + context->sourceLanguage = SourceLanguage::Slang; + // A loaded module cannot define entry points that // we'll expose (for now), so we just need to // consider global-scope parameters. -- cgit v1.2.3