From aee4aa3528072e4b5e95ccc4e571868716b47d50 Mon Sep 17 00:00:00 2001 From: lucy96chen <47800040+lucy96chen@users.noreply.github.com> Date: Mon, 10 Jan 2022 11:00:50 -0800 Subject: Draw call tests for Vulkan (#2073) * Added instancing support to Vulkan, drawInstanced() test image is upside-down * Fixed inverted drawInstanced() test output by changing Vulkan viewport convention * Replaced vkCmdDraw with vkCmdDrawIndexed in all non-indirect indexed draws, drawIndexedIndirect test now working for Vulkan * Moved index and vertex buffer binding into setIndexBuffer and setVertexBuffers; Defaulted countBuffer to nullptr and countOffset to 0 and added a check for non-null countBuffer to drawIndirect and drawIndexedIndirect in Vulkan; All Vulkan draw tests working (but D3D12 tests broken) * Added support for drawInstanced and drawIndexedInstanced to D3D11 and added tests for both, however D3D11 tests are currently disabled due to readTextureResource assuming a fixed pixel size (among other possible problems); Fixed issues causing D3D12 tests to fail after major back-end fixes to get Vulkan up and running * Removed testing function for dumping images and some other commented out code * Removed some commented out code * Fix initializer list causing builds to fail (attempt 1) * Removed initializer list for VertexStreamDesc in createInputLayout() and fill in struct fields normally (build fix attempt 2) * Removed default values from VertexStreamDesc and changed all initializer lists to reflect this change * Moved applyBinding before setVertexBuffer in RenderTestApp::renderFrame() to ensure the pipeline has already been bound before vertex buffers are * Changed D3D11's readTextureResource to calculate pixel size using format-specific size information; Removed wrapper around D3D11 instanced and indexed instanced draw tests --- tools/gfx/debug-layer.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tools/gfx/debug-layer.cpp') diff --git a/tools/gfx/debug-layer.cpp b/tools/gfx/debug-layer.cpp index 80c04bd1f..2855ee2f4 100644 --- a/tools/gfx/debug-layer.cpp +++ b/tools/gfx/debug-layer.cpp @@ -584,15 +584,14 @@ Result DebugDevice::createSwapchain( } Result DebugDevice::createInputLayout( - const InputElementDesc* inputElements, - UInt inputElementCount, + IInputLayout::Desc const& desc, IInputLayout** outLayout) { SLANG_GFX_API_FUNC; RefPtr outObject = new DebugInputLayout(); auto result = baseObject->createInputLayout( - inputElements, inputElementCount, outObject->baseObject.writeRef()); + desc, outObject->baseObject.writeRef()); if (SLANG_FAILED(result)) return result; returnComPtr(outLayout, outObject); @@ -1096,7 +1095,6 @@ void DebugRenderCommandEncoder::setVertexBuffers( uint32_t startSlot, uint32_t slotCount, IBufferResource* const* buffers, - const uint32_t* strides, const uint32_t* offsets) { SLANG_GFX_API_FUNC; @@ -1106,7 +1104,7 @@ void DebugRenderCommandEncoder::setVertexBuffers( { innerBuffers.add(static_cast(buffers[i])->baseObject.get()); } - baseObject->setVertexBuffers(startSlot, slotCount, innerBuffers.getBuffer(), strides, offsets); + baseObject->setVertexBuffers(startSlot, slotCount, innerBuffers.getBuffer(), offsets); } void DebugRenderCommandEncoder::setIndexBuffer( -- cgit v1.2.3