From 8b67c7b3fc163156a02a40430f7038ab2f199924 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 29 May 2018 16:48:04 -0400 Subject: Feature/vulkan texture (#579) * First pass at support for textures in vulkan. * Binding state has first pass support for VkImageView VkSampler. * Split out _calcImageViewType * Fix bug in debug build around constant buffer being added but not part of the binding description for the test. * Offset recalculated for vk texture construction just store the texture size for each mip level. * When outputing a vector type with a size of 1 in GLSL, it needs to be output as the underlying type. For example vector should be output as float in GLSL. * Vulkan render-test produces right output for the test tests/compute/textureSamplingTest.slang -slang -gcompute -o tests/compute/textureSamplingTest.slang.actual.txt -vk * Small improvement around xml encoding a string. * More generalized test synthesis. * Fix image usage flags for Vulkan. * Improvements to what gets synthesized vulkan tests. * Do transition on all mip levels. * Fixing problems appearing from vulkan debug layer. * Disable Vulkan synthesized tests for now. --- tools/render-test/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tools/render-test/main.cpp') diff --git a/tools/render-test/main.cpp b/tools/render-test/main.cpp index adcad42a7..f72a05824 100644 --- a/tools/render-test/main.cpp +++ b/tools/render-test/main.cpp @@ -87,7 +87,8 @@ class RenderTestApp RefPtr m_shaderProgram; RefPtr m_bindingState; - ShaderInputLayout m_shaderInputLayout; + ShaderInputLayout m_shaderInputLayout; ///< The binding layout + int m_numAddedConstantBuffers; ///< Constant buffers can be added to the binding directly. Will be added at the end. }; // Entry point name to use for vertex/fragment shader @@ -105,6 +106,7 @@ SlangResult RenderTestApp::initialize(Renderer* renderer, ShaderCompiler* shader { SLANG_RETURN_ON_FAIL(initializeShaders(shaderCompiler)); + m_numAddedConstantBuffers = 0; m_renderer = renderer; // TODO(tfoley): use each API's reflection interface to query the constant-buffer size needed @@ -135,6 +137,8 @@ SlangResult RenderTestApp::initialize(Renderer* renderer, ShaderCompiler* shader shaderBindSet.setAll(bindingStateDesc.makeCompactSlice(0)); bindingStateDesc.addResource(BindingType::Buffer, m_constantBuffer, shaderBindSet); + + m_numAddedConstantBuffers++; } m_bindingState = m_renderer->createBindingState(bindingStateDesc); @@ -275,9 +279,9 @@ Result RenderTestApp::writeBindingOutput(const char* fileName) const BindingState::Desc& bindingStateDesc = m_bindingState->getDesc(); // Must be the same amount of entries - assert(bindingStateDesc.m_bindings.Count() == m_shaderInputLayout.entries.Count()); + assert(bindingStateDesc.m_bindings.Count() == m_shaderInputLayout.entries.Count() + m_numAddedConstantBuffers); - const int numBindings = int(bindingStateDesc.m_bindings.Count()); + const int numBindings = int(m_shaderInputLayout.entries.Count()); for (int i = 0; i < numBindings; ++i) { -- cgit v1.2.3