diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2021-03-17 12:55:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-17 12:55:30 -0700 |
| commit | 6e5d85efb9fa5f647f7f0c7ef784a9fd09b29023 (patch) | |
| tree | 6206ef11502a1a5d9c1dc00df359be9aececffdf /tools/render-test/cpu-compute-util.h | |
| parent | b64a23cccfe9876d53cda773afc796bd975fa7e5 (diff) | |
Remove old code paths from render-test (#1760)
* Remove old code paths from render-test
Historically, the `render-test` tool was using three different code paths:
* One based on `gfx` and manual (non-reflection-based) parameter setting, used for OpenGL, D3D11, D3D12, and Vulkan
* One for CPU that used reflection-based parameter setting but shared no code with the first
* One for CUDA that used reflection-based parameter setting and shared some, but not all, code with the CPU path
Recently we've updated `render-test` to include a fourth option:
* Using `gfx` and the "shader object" system it exposes for a unified reflection-based parameter-setting system taht works across OpenGL, D3D11, D3D12, Vulkan, CUDA, and CPU
This change removes the first three options and leaves only the single unified path. A sa result, a bunch of code in `render-test` is no longer needed, and the codebase no longer relies on things like the `IDescriptorSet`-related APIs in `gfx`.
Several existing tests had to be disabled to make this change possible. Those tests will need to be audited and either re-enabled once we fix issues in the shader object system, or permanently removed if they don't test stuff we intend to support in the long run (e.g., global-scope type parameters, which aren't a clear necessity).
* fixup: CUDA detection logic
Diffstat (limited to 'tools/render-test/cpu-compute-util.h')
| -rw-r--r-- | tools/render-test/cpu-compute-util.h | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/tools/render-test/cpu-compute-util.h b/tools/render-test/cpu-compute-util.h deleted file mode 100644 index b1de6ce85..000000000 --- a/tools/render-test/cpu-compute-util.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef CPU_COMPUTE_UTIL_H -#define CPU_COMPUTE_UTIL_H - -#include "slang-support.h" -#include "options.h" - -#include "bind-location.h" - -#include "../../source/core/slang-basic.h" - -namespace renderer_test { - -struct CPUComputeUtil -{ - enum class ExecuteStyle - { - Unknown, - Thread, - Group, - GroupRange, - }; - - struct Resource : public Slang::RefObject - { - void* getInterface() const { return m_interface; } - void* m_interface; - }; - - struct Context - { - /// Holds the binding information - BindSet m_bindSet; - CPULikeBindRoot m_bindRoot; - - /// Buffers are held in same order as entries in layout (useful for dumping out bindings) - Slang::List<BindSet::Value*> m_buffers; - - /// Bindless resource objects - Slang::OrderedDictionary<Slang::String, Slang::RefPtr<Resource>> m_bindlessResources; - }; - - struct ExecuteInfo - { - typedef void (*Func)(); - - ExecuteStyle m_style; - Func m_func; - uint32_t m_dispatchSize[3]; - uint32_t m_numThreadsPerAxis[3]; - - void* m_uniformState; - void* m_uniformEntryPointParams; - }; - - /// True if this feature is available on CPU - static bool hasFeature(const Slang::UnownedStringSlice& feature); - - /// Runs code across run styles and makes sure output buffers match - static SlangResult checkStyleConsistency(ISlangSharedLibrary* sharedLib, const uint32_t dispatchSize[3], const ShaderCompilerUtil::OutputAndLayout& compilationAndLayout); - - static SlangResult createBindlessResources(ShaderCompilerUtil::OutputAndLayout& compilationAndLayout, Context& context); - - /// Query and fill in the RTTI pointer and runtime resource handle values in data buffers. - static SlangResult fillRuntimeHandleInBuffers( - ShaderCompilerUtil::OutputAndLayout& compilationAndLayout, - Context& context, - ISlangSharedLibrary* sharedLib); - - static SlangResult calcBindings(const ShaderCompilerUtil::OutputAndLayout& compilationAndLayout, Context& outContext); - - static SlangResult calcExecuteInfo(ExecuteStyle style, ISlangSharedLibrary* sharedLib, const uint32_t dispatchSize[3], const ShaderCompilerUtil::OutputAndLayout& compilationAndLayout, Context& context, ExecuteInfo& out); - - static SlangResult execute(const ExecuteInfo& info); -}; - - -} // renderer_test - -#endif //CPU_COMPUTE_UTIL_H |
