From 662721ba4ab0e38924701df4c876a86eb8390968 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 15 Jan 2020 14:58:45 -0500 Subject: Bind Location (#1166) * First pass at BindLocation. * Added BindSet::init - for initializing with two input constant buffers. Needs better name, and perhaps should be another class. * Fix handling of constant buffer stripping. Improved initialization. * Trying to generalize BindLocation a little more. Split out CPULikeBindRoot. * More work to make BindLocation et al work with non uniform bindings. * Added parsing to a location. * WIP: Trying to get CPU working with BindLocation. * Describe problem of knowing the type of the reference point in the binding table. * More ideas on getBindings fix. * Remove BindSet as member of BindLocation. * Added BindLocation::Invalid * Made BindLocation able to be key in hash * Use BindLocation for bindings on BindingSet. * Added cuda and nvrtc categories to test infrastructure. Disabled CUDA synthetic tests by default. Fixed such that all tests now produce something in BindLocation style. * Use m_userIndex instead of m_userData on Resource. Move the binding setup out of cpu-compute-util (as no longer CPU specific) * Removed CPUBinding - used BindLocation/BindSet instead. Fixed some bugs around indexOf around uniform indirection. * Renamed BindSet::Resource -> BindSet::Value. * Document BindLocation. * Fixes for Clang/GCC Improve invariant requirement handling when constructing from BindPoints. --- tools/render-test/cpu-compute-util.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (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 index 179985f6f..21c40ba43 100644 --- a/tools/render-test/cpu-compute-util.h +++ b/tools/render-test/cpu-compute-util.h @@ -1,10 +1,11 @@ #ifndef CPU_COMPUTE_UTIL_H #define CPU_COMPUTE_UTIL_H -#include "cpu-memory-binding.h" #include "slang-support.h" #include "options.h" +#include "bind-location.h" + #include "../../source/core/slang-smart-pointer.h" namespace renderer_test { @@ -28,11 +29,11 @@ struct CPUComputeUtil struct Context { /// Holds the binding information - CPUMemoryBinding binding; + BindSet m_bindSet; + CPULikeBindRoot m_bindRoot; + /// 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; + List m_buffers; }; struct ExecuteInfo @@ -53,12 +54,12 @@ struct CPUComputeUtil static SlangResult checkStyleConsistency(ISlangSharedLibrary* sharedLib, const uint32_t dispatchSize[3], const ShaderCompilerUtil::OutputAndLayout& compilationAndLayout); 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); - static SlangResult writeBindings(const ShaderInputLayout& layout, const List& buffers, const Slang::String& fileName); + static SlangResult writeBindings(const ShaderInputLayout& layout, const List& buffers, const Slang::String& fileName); }; -- cgit v1.2.3