diff options
| author | YONGH\yongh <yonghe@outlook.com> | 2017-10-20 18:24:30 -0400 |
|---|---|---|
| committer | YONGH\yongh <yonghe@outlook.com> | 2017-10-20 18:24:30 -0400 |
| commit | 0ee4d4b54732239b946bae7fde32bb21aa5a3ec3 (patch) | |
| tree | 0c5f4a7f6f43e60802d354aa98a3983994f4f4bd /tools/render-test/shader-input-layout.h | |
| parent | 5a18dc704a2f5eecebcbdd77682a40ba8316d253 (diff) | |
in-progress work: allow render-test to generate and bind various resource inputs for running test shaders with arbitrary parameter definitions.
This commit contains the parser of the resource input definition.
Diffstat (limited to 'tools/render-test/shader-input-layout.h')
| -rw-r--r-- | tools/render-test/shader-input-layout.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/tools/render-test/shader-input-layout.h b/tools/render-test/shader-input-layout.h new file mode 100644 index 000000000..788a72224 --- /dev/null +++ b/tools/render-test/shader-input-layout.h @@ -0,0 +1,52 @@ +#ifndef SLANG_TEST_SHADER_INPUT_LAYOUT_H +#define SLANG_TEST_SHADER_INPUT_LAYOUT_H + +#include "core/basic.h" + +namespace renderer_test +{ + enum class ShaderInputType + { + Buffer, Texture, Sampler, CombinedTextureSampler + }; + struct InputTextureDesc + { + int dimension = 2; + int arrayLength = 0; + bool isCube = false; + bool isDepthTexture = false; + }; + 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; + int hlslRegister = -1; + int glslBinding = -1; + int glslLocation = -1; + }; + class ShaderInputLayout + { + public: + Slang::List<ShaderInputLayoutEntry> entries; + void Parse(const char * source); + }; +} + +#endif
\ No newline at end of file |
