From 047daae9300c8a94d28383cf992ce00e3ad2da1e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 9 Sep 2019 13:54:31 -0400 Subject: CPU compute testing on non windows targets (#1045) * WIP: Refactor of CPUCompute and stand alone cpu-render-test * Fix compilation on CygWin. * Make CPU compute tests run on non windows targets. * Check that C/C++ compiler is available for CPU compute. * Fix some tabbing issues. * Add -fPIC on gfx * Use dxcompiler_47.dll from slang-binaries on windows. * make https for git module slang-binaries * Fix comment in premake5.lua around d3dcompiler_47.dll * Add resources to the CPUComputeUtil::Context to keep in scope. * Fixes problem compiling on cygwin where dx12 is included in build of gfx lib. --- tools/render-test/cpu-compute-util.h | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tools/render-test/cpu-compute-util.h (limited to 'tools/render-test/cpu-compute-util.h') diff --git a/tools/render-test/cpu-compute-util.h b/tools/render-test/cpu-compute-util.h new file mode 100644 index 000000000..cbc4e6e58 --- /dev/null +++ b/tools/render-test/cpu-compute-util.h @@ -0,0 +1,40 @@ +#ifndef CPU_COMPUTE_UTIL_H +#define CPU_COMPUTE_UTIL_H + +#include "cpu-memory-binding.h" +#include "slang-support.h" +#include "options.h" + +#include "../../source/core/slang-smart-pointer.h" + +namespace renderer_test { + +struct CPUComputeUtil +{ + struct Resource : public RefObject + { + void* getInterface() const { return m_interface; } + void* m_interface; + }; + + struct Context + { + /// Holds the binding information + CPUMemoryBinding binding; + /// Buffers are held in same order as entries in layout (useful for dumping out bindings) + List buffers; + /// Holds the resources created (in calcBindings) + List > m_resources; + }; + + static SlangResult calcBindings(const ShaderCompilerUtil::OutputAndLayout& compilationAndLayout, Context& outContext); + + static SlangResult execute(const ShaderCompilerUtil::OutputAndLayout& compilationAndLayout, Context& outContext); + + static SlangResult writeBindings(const ShaderInputLayout& layout, const List& buffers, const Slang::String& fileName); +}; + + +} // renderer_test + +#endif //CPU_MEMORY_BINDING_H -- cgit v1.2.3