From 31c7abcc27a33d63ac8d335387a0ce7b3ad74954 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 18 Sep 2019 11:40:59 -0400 Subject: Improvements to testing and ABI for CPU (#1057) * WIP: Improving CPU performance/ABI * Optionally output code on CPU for groupThreadID and groupID. * Added ability to set compute dispatch size on command line for render-test. Dispatch compute tests taking into account dispatch size. Added test for semantics are working. * Test using GroupRange. * Fix problem with adding \n for externa diagnostic - to do it if there isn't a \n at the end. Change the ouput order (put result before) so last value is diagnostic string. * Made GroupRange the default exposed CPU ABI entry point style. Removed CPU_EXECUTE test style -as tested via the now cross platform render-test * Split out execution from setup for execution to improve perf. * For better code coverage/testing test all styles of CPU compute entry point. * Improve documentation for ABI changes for CPU code. Add 'expecting' to error message from review. * Fix small typos. --- prelude/slang-cpp-types.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'prelude/slang-cpp-types.h') diff --git a/prelude/slang-cpp-types.h b/prelude/slang-cpp-types.h index c79465032..ab87c6208 100644 --- a/prelude/slang-cpp-types.h +++ b/prelude/slang-cpp-types.h @@ -226,21 +226,28 @@ struct Texture2D }; /* Varying input for Compute */ -struct ComputeVaryingInput + +/* Used when running a single thread */ +struct ComputeThreadVaryingInput { uint3 groupID; uint3 groupThreadID; }; -struct GroupComputeVaryingInput +struct ComputeVaryingInput { uint3 startGroupID; ///< start groupID 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. */ +found via reflection or defined such that it matches the shader appropriately. +*/ struct UniformEntryPointParams; +struct UniformState; + +typedef void(*ComputeThreadFunc)(ComputeThreadVaryingInput* varyingInput, UniformEntryPointParams* uniformEntryPointParams, UniformState* uniformState); +typedef void(*ComputeFunc)(ComputeVaryingInput* varyingInput, UniformEntryPointParams* uniformEntryPointParams, UniformState* uniformState); #ifdef SLANG_PRELUDE_NAMESPACE } -- cgit v1.2.3