summaryrefslogtreecommitdiffstats
path: root/tools/render-test/main.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-05-29 16:48:04 -0400
committerTim Foley <tfoleyNV@users.noreply.github.com>2018-05-29 13:48:04 -0700
commit8b67c7b3fc163156a02a40430f7038ab2f199924 (patch)
tree3444b632f787b6655c71385333074e22c4f5e5c0 /tools/render-test/main.cpp
parente7a83323bfc4dd698ef491375a37c65c83915951 (diff)
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<float,1> 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.
Diffstat (limited to 'tools/render-test/main.cpp')
-rw-r--r--tools/render-test/main.cpp10
1 files changed, 7 insertions, 3 deletions
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<ShaderProgram> m_shaderProgram;
RefPtr<BindingState> 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)
{