summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authortareksander <57038324+tareksander@users.noreply.github.com>2024-11-11 20:32:00 +0100
committerGitHub <noreply@github.com>2024-11-11 11:32:00 -0800
commit7e51180ed80ce1c5718b65c6625dc12fe64c8bfa (patch)
tree6a6451b388d52ba01e8b4190dc498b435c5ea978 /include
parent98dab05e80a90ddf64c9d31420a3b49ec49e31d1 (diff)
Reflection compiler option (#5507)
* Moved the pretty writer code from slang-reflection-test into core * Moved reflection test code into the slang codebase and added the compiler option -reflection-json to store the reflection data in a separate file. * Documented -reflection-json command line option * moved PrettyWriter from core to compiler-core * Fixed variable shadowing warning * Use File::writeAllText instead of OSFilesystem and write to stdout if - is used as the path * format code * Fixed linker error * Fix COM Ptr life time issues. * Move enum to the end. * Fix formatting. --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'include')
-rw-r--r--include/slang-deprecated.h5
-rw-r--r--include/slang.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/include/slang-deprecated.h b/include/slang-deprecated.h
index 1c1350f9f..3ce8f61bc 100644
--- a/include/slang-deprecated.h
+++ b/include/slang-deprecated.h
@@ -853,6 +853,11 @@ extern "C"
// Shader Reflection
+ SLANG_API SlangResult spReflection_ToJson(
+ SlangReflection* reflection,
+ SlangCompileRequest* request,
+ ISlangBlob** outBlob);
+
SLANG_API unsigned spReflection_GetParameterCount(SlangReflection* reflection);
SLANG_API SlangReflectionParameter* spReflection_GetParameterByIndex(
SlangReflection* reflection,
diff --git a/include/slang.h b/include/slang.h
index 2999996e9..0e6724373 100644
--- a/include/slang.h
+++ b/include/slang.h
@@ -1003,6 +1003,8 @@ typedef uint32_t SlangSizeT;
// Add this new option to the end of the list to avoid breaking ABI as much as possible.
// Setting of EmitSpirvDirectly or EmitSpirvViaGLSL will turn into this option internally.
EmitSpirvMethod, // enum SlangEmitSpirvMethod
+
+ EmitReflectionJSON, // bool
CountOf,
};