summaryrefslogtreecommitdiff
path: root/slang.h
diff options
context:
space:
mode:
Diffstat (limited to 'slang.h')
-rw-r--r--slang.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/slang.h b/slang.h
index 1a6cc2211..645b995de 100644
--- a/slang.h
+++ b/slang.h
@@ -1297,6 +1297,43 @@ extern "C"
int genericArgCount,
char const** genericArgs);
+ /** Specify the concrete type to be used for a global "existential slot."
+
+ Every shader parameter (or leaf field of a `struct`-type shader parameter)
+ that has an interface or array-of-interface type introduces an existential
+ slot. The number of slots consumed by a shader parameter, and the starting
+ slot of each parameter can be queried via the reflection API using
+ `SLANG_PARAMETER_CATEGORY_EXISTENTIAL_SLOT`.
+
+ In order to generate specialized code, a concrete type needs to be specified
+ for each existential slot. This function specifies the name of the type
+ (or in general a type *expression*) to use for a specific slot at the
+ global scope.
+ */
+ SLANG_API SlangResult spSetTypeNameForGlobalExistentialSlot(
+ SlangCompileRequest* request,
+ int slotIndex,
+ char const* typeName);
+
+ /** Specify the concrete type to be used for an entry-point "existential slot."
+
+ Every shader parameter (or leaf field of a `struct`-type shader parameter)
+ that has an interface or array-of-interface type introduces an existential
+ slot. The number of slots consumed by a shader parameter, and the starting
+ slot of each parameter can be queried via the reflection API using
+ `SLANG_PARAMETER_CATEGORY_EXISTENTIAL_SLOT`.
+
+ In order to generate specialized code, a concrete type needs to be specified
+ for each existential slot. This function specifies the name of the type
+ (or in general a type *expression*) to use for a specific slot at the
+ entry-point scope.
+ */
+ SLANG_API SlangResult spSetTypeNameForEntryPointExistentialSlot(
+ SlangCompileRequest* request,
+ int entryPointIndex,
+ int slotIndex,
+ char const* typeName);
+
/** Execute the compilation request.
@returns SlangResult, SLANG_OK on success. Use SLANG_SUCCEEDED() and SLANG_FAILED() to test SlangResult.
@@ -1517,6 +1554,12 @@ extern "C"
SLANG_PARAMETER_CATEGORY_CALLABLE_PAYLOAD,
SLANG_PARAMETER_CATEGORY_SHADER_RECORD,
+ // A parameter of interface or array-of-interface type introduces
+ // one existential slot, into which a concrete type must be plugged
+ // to enable specialized code generation.
+ //
+ SLANG_PARAMETER_CATEGORY_EXISTENTIAL_SLOT,
+
//
SLANG_PARAMETER_CATEGORY_COUNT,
@@ -1896,6 +1939,8 @@ namespace slang
ShaderRecord = SLANG_PARAMETER_CATEGORY_SHADER_RECORD,
+ ExistentialSlot = SLANG_PARAMETER_CATEGORY_EXISTENTIAL_SLOT,
+
// DEPRECATED:
VertexInput = SLANG_PARAMETER_CATEGORY_VERTEX_INPUT,
FragmentOutput = SLANG_PARAMETER_CATEGORY_FRAGMENT_OUTPUT,