summaryrefslogtreecommitdiff
path: root/prelude
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-06-18 11:38:30 -0400
committerGitHub <noreply@github.com>2020-06-18 11:38:30 -0400
commit5a86cd4880f8f086631352cb5d67d60c58c087f4 (patch)
tree2f65acc5158f4c6632f299de6f4600f20b93c35a /prelude
parent31ae3467242995ab822a29c4148c2e86df2f1eb8 (diff)
Improvements around C++ code generation (#1396)
* * Remove UniformState and UniformEntryPointParams types * Put all output C++ source in an anonymous namespace * If SLANG_PRELUDE_NAMESPACE is set, make what it defines available in generated file. * Fix signature issue in performance-profile.slang * Context -> KernelContext to avoid ambiguity. * Fix issues around dynamic dispatch and anonymous namespace. * Fix typo.
Diffstat (limited to 'prelude')
-rw-r--r--prelude/slang-cpp-prelude.h4
-rw-r--r--prelude/slang-cpp-types.h11
2 files changed, 5 insertions, 10 deletions
diff --git a/prelude/slang-cpp-prelude.h b/prelude/slang-cpp-prelude.h
index 2e680f824..7da613024 100644
--- a/prelude/slang-cpp-prelude.h
+++ b/prelude/slang-cpp-prelude.h
@@ -38,6 +38,4 @@
# define SLANG_UNROLL
#endif
-#endif
-
-struct Context; \ No newline at end of file
+#endif \ No newline at end of file
diff --git a/prelude/slang-cpp-types.h b/prelude/slang-cpp-types.h
index 311fa667d..7e951fd63 100644
--- a/prelude/slang-cpp-types.h
+++ b/prelude/slang-cpp-types.h
@@ -822,14 +822,11 @@ struct ComputeVaryingInput
uint3 endGroupID; ///< Non inclusive end groupID
};
-/* Type that defines the uniform entry point params. The actual content of this type is dependent on the entry point parameters, and can be
-found via reflection or defined such that it matches the shader appropriately.
-*/
-struct UniformEntryPointParams;
-struct UniformState;
+// The uniformEntryPointParams and uniformState must be set to structures that match layout that the kernel expects.
+// This can be determined via reflection for example.
-typedef void(*ComputeThreadFunc)(ComputeThreadVaryingInput* varyingInput, UniformEntryPointParams* uniformEntryPointParams, UniformState* uniformState);
-typedef void(*ComputeFunc)(ComputeVaryingInput* varyingInput, UniformEntryPointParams* uniformEntryPointParams, UniformState* uniformState);
+typedef void(*ComputeThreadFunc)(ComputeThreadVaryingInput* varyingInput, void* uniformEntryPointParams, void* uniformState);
+typedef void(*ComputeFunc)(ComputeVaryingInput* varyingInput, void* uniformEntryPointParams, void* uniformState);
#ifdef SLANG_PRELUDE_NAMESPACE
}