diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-04-20 14:59:17 -0400 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-04-20 11:59:17 -0700 |
| commit | c73ccbc5616dff16ecacb9198f725f498a7e6c84 (patch) | |
| tree | 539d28904ecb6970632a396aa6f914d47b9b1175 /tools/render-test/shader-renderer-util.h | |
| parent | 4c751df1680c30fac0369171a9b8dd4bb5bb5b9f (diff) | |
Fixes/improvements based on feature/render-binding-resource (#511)
* Dx12 rendering works in test framework.
* Turn on dx12 render tests.
* Split out functions for construction or Renderer types into ShaderRendererUtil. Removed the serialization of buffers code into test-render
* Improvements in documentation and typename in BindingState types.
RegisterSet -> CompactBindIndexSlice
RegisterList -> BindIndexSlice
RegisterDesc -> ShaderBindSet
* Fix debug build break.
Diffstat (limited to 'tools/render-test/shader-renderer-util.h')
| -rw-r--r-- | tools/render-test/shader-renderer-util.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/render-test/shader-renderer-util.h b/tools/render-test/shader-renderer-util.h new file mode 100644 index 000000000..b481d52db --- /dev/null +++ b/tools/render-test/shader-renderer-util.h @@ -0,0 +1,27 @@ +// shader-renderer-util.h +#pragma once + +#include "render.h" +#include "shader-input-layout.h" + +namespace renderer_test { + +/// Utility class containing functions that construct items on the renderer using the ShaderInputLayout representation +struct ShaderRendererUtil +{ + /// Generate a texture using the InputTextureDesc and construct a TextureResource using the Renderer with the contents + static Slang::Result generateTextureResource(const InputTextureDesc& inputDesc, int bindFlags, Renderer* renderer, Slang::RefPtr<TextureResource>& textureOut); + + /// Create texture resource using inputDesc, and texData to describe format, and contents + static Slang::Result createTextureResource(const InputTextureDesc& inputDesc, const TextureData& texData, int bindFlags, Renderer* renderer, Slang::RefPtr<TextureResource>& textureOut); + + /// Create the BufferResource using the renderer from the contents of inputDesc + static Slang::Result createBufferResource(const InputBufferDesc& inputDesc, bool isOutput, size_t bufferSize, const void* initData, Renderer* renderer, Slang::RefPtr<BufferResource>& bufferOut); + + /// Create BindingState::Desc from the contents of layout + static Slang::Result createBindingStateDesc(const ShaderInputLayout& layout, Renderer* renderer, BindingState::Desc& descOut); + /// Create BindingState::Desc from a list of ShaderInputLayout entries + static Slang::Result createBindingStateDesc(ShaderInputLayoutEntry* srcEntries, int numEntries, Renderer* renderer, BindingState::Desc& descOut); +}; + +} // renderer_test |
