diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-04-10 17:53:03 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-10 17:53:03 -0400 |
| commit | c4004b32ca2c0effb455ec847114240db3cb993b (patch) | |
| tree | 7530f131892e2973929948e61e46e957d38510a2 /tools/render-test/shader-input-layout.h | |
| parent | 5298ccf7da486d0010c6157974d5dd9a5556f265 (diff) | |
Feature/dx12 compute (#482)
* Dx12 rendering works in test framework.
* Turn on dx12 render tests.
* Getting simpler dx12 compute tests to work.
* With expected data in test - check for specialized and then for the default, so that multiple test can share the same expected data, but specialized cases can still be set.
* Fixed construction and binding on dx12 textures.
* Control which render apis used in test from command line.
* Small aesthetic fixes in render-test/main.cpp.
* Fix binding problem for uavs/srvs dx12. Previously tried to create srv/uav for StorageBuffers (like dx11 does), but the binding breaks as you can end up with two srvs using the same register.
First pass at fixing problems with Texture creation for dx12 - assertions were hit with 3d or array textures.
* Fixes to improve Dx12 setup shader resource views for cubemaps/arrays.
* Fixed d3d12 textureSamplingTest - problem was that cubemap/array textures were not being uploaded correctly.
* Changed the order of how binding of constant buffers (as just set on the Renderer) indexes. Previously they were given the lowest indices, but they clashed with the indices from the 'Binding'. Changing this means all tests run on d3d12.
* Add code to allow use of warp (although not command line switchable yet).
Fix problem setting up raw UAV - as identified by warp.
* Added RenderApiUtil - which can detect if a render api is potentially available.
* Moved render flag testing/parsing into RenderApiUtil.
* Fix signed/unsigned warning.
* Fixes around enums prefixed with k on the review of feature/dx12 compute branch.
Diffstat (limited to 'tools/render-test/shader-input-layout.h')
| -rw-r--r-- | tools/render-test/shader-input-layout.h | 131 |
1 files changed, 69 insertions, 62 deletions
diff --git a/tools/render-test/shader-input-layout.h b/tools/render-test/shader-input-layout.h index c4c3d9d8c..0f5a54326 100644 --- a/tools/render-test/shader-input-layout.h +++ b/tools/render-test/shader-input-layout.h @@ -3,70 +3,77 @@ #include "core/basic.h" -namespace renderer_test +namespace renderer_test { + +enum class ShaderInputType +{ + Buffer, Texture, Sampler, CombinedTextureSampler +}; + +enum class InputTextureContent +{ + Zero, One, ChessBoard, Gradient +}; + +struct InputTextureDesc +{ + int dimension = 2; + int arrayLength = 0; + bool isCube = false; + bool isDepthTexture = false; + bool isRWTexture = false; + int size = 4; + InputTextureContent content = InputTextureContent::One; +}; + +enum class InputBufferType +{ + ConstantBuffer, StorageBuffer +}; + +struct InputBufferDesc +{ + InputBufferType type = InputBufferType::ConstantBuffer; + int stride = 0; // stride == 0 indicates an unstructured buffer. +}; + +struct InputSamplerDesc +{ + bool isCompareSampler = false; +}; + +class ShaderInputLayoutEntry +{ +public: + ShaderInputType type; + Slang::List<unsigned int> bufferData; + InputTextureDesc textureDesc; + InputBufferDesc bufferDesc; + InputSamplerDesc samplerDesc; + bool isOutput = false; + int hlslBinding = -1; + Slang::List<int> glslBinding; +}; + +struct TextureData +{ + Slang::List<Slang::List<unsigned int>> dataBuffer; + int textureSize; + int mipLevels; + int arraySize; +}; + +class ShaderInputLayout { - enum class ShaderInputType - { - Buffer, Texture, Sampler, CombinedTextureSampler - }; - enum class InputTextureContent - { - Zero, One, ChessBoard, Gradient - }; - struct InputTextureDesc - { - int dimension = 2; - int arrayLength = 0; - bool isCube = false; - bool isDepthTexture = false; - bool isRWTexture = false; - int size = 4; - InputTextureContent content = InputTextureContent::One; - }; - enum class InputBufferType - { - ConstantBuffer, StorageBuffer - }; - struct InputBufferDesc - { - InputBufferType type = InputBufferType::ConstantBuffer; - int stride = 0; // stride == 0 indicates an unstructured buffer. - }; - struct InputSamplerDesc - { - bool isCompareSampler = false; - }; - class ShaderInputLayoutEntry - { - public: - ShaderInputType type; - Slang::List<unsigned int> bufferData; - InputTextureDesc textureDesc; - InputBufferDesc bufferDesc; - InputSamplerDesc samplerDesc; - bool isOutput = false; - int hlslBinding = -1; - Slang::List<int> glslBinding; - - }; +public: + Slang::List<ShaderInputLayoutEntry> entries; + Slang::List<Slang::String> globalTypeArguments; + int numRenderTargets = 1; + void Parse(const char * source); +}; - struct TextureData - { - Slang::List<Slang::List<unsigned int>> dataBuffer; - int textureSize; - int mipLevels; - int arraySize; - }; - void generateTextureData(TextureData & output, const InputTextureDesc & desc); +void generateTextureData(TextureData & output, const InputTextureDesc & desc); - class ShaderInputLayout - { - public: - Slang::List<ShaderInputLayoutEntry> entries; - Slang::List<Slang::String> globalTypeArguments; - int numRenderTargets = 1; - void Parse(const char * source); - }; -} +} // namespace render_test #endif
\ No newline at end of file |
