From 1e0aabf4b28f48bfbfee7b1a9c08031892c004d0 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 2 Jan 2018 22:04:50 -0800 Subject: no-codegen compile flag and global generics reflection (#347) * no-codegen compile flag and global generics reflection 1. Add SLANG_COMPILE_FLAG_NO_CODEGEN (-no-codegen) compiler flag to skip code generation stage, so that a shader that uses global generic type parmameters can be parsed, checked and introspected without knowing the final specialization. 2. Add reflection API to query for global generic type parameters, global parameters of generic type, and the generic type parameter index related to a global generic parameter. 3. Add a reflection test case for global generic type parameters. * add expected result for global-type-params test case. * fix reflection json output. * fix branch condition errors * fix expected result for global-type-params.slang * fix expected test case output --- source/slang/options.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/slang/options.cpp') diff --git a/source/slang/options.cpp b/source/slang/options.cpp index 97deeb544..a5ed8eca6 100644 --- a/source/slang/options.cpp +++ b/source/slang/options.cpp @@ -278,6 +278,10 @@ struct OptionsParser { flags |= SLANG_COMPILE_FLAG_NO_MANGLING; } + else if (argStr == "-no-codegen") + { + flags |= SLANG_COMPILE_FLAG_NO_CODEGEN; + } else if(argStr == "-dump-ir" ) { requestImpl->shouldDumpIR = true; -- cgit v1.2.3