diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-09-09 13:54:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-09 13:54:31 -0400 |
| commit | 047daae9300c8a94d28383cf992ce00e3ad2da1e (patch) | |
| tree | 520025463f6493b31d859a812af8a1384a23f715 /tools/render-test/cpu-compute-util.h | |
| parent | 4fc07614d6407e49a0c34e7483d410153c0b269a (diff) | |
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.
Diffstat (limited to 'tools/render-test/cpu-compute-util.h')
| -rw-r--r-- | tools/render-test/cpu-compute-util.h | 40 |
1 files changed, 40 insertions, 0 deletions
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<CPUMemoryBinding::Buffer> buffers; + /// Holds the resources created (in calcBindings) + List<RefPtr<Resource> > 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<CPUMemoryBinding::Buffer>& buffers, const Slang::String& fileName); +}; + + +} // renderer_test + +#endif //CPU_MEMORY_BINDING_H |
