diff options
| author | lucy96chen <47800040+lucy96chen@users.noreply.github.com> | 2022-01-10 11:00:50 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-10 11:00:50 -0800 |
| commit | aee4aa3528072e4b5e95ccc4e571868716b47d50 (patch) | |
| tree | 3621d7e5cd67e09581d7fe001e359df12167889b /tools/platform | |
| parent | 8919c19440dea9a62578905d365fe80bcd58e316 (diff) | |
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
Diffstat (limited to 'tools/platform')
| -rw-r--r-- | tools/platform/gui.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/platform/gui.cpp b/tools/platform/gui.cpp index 5b72bd087..5f7992abd 100644 --- a/tools/platform/gui.cpp +++ b/tools/platform/gui.cpp @@ -107,6 +107,7 @@ GUI::GUI( {"U", 2, Format::R8G8B8A8_UNORM, offsetof(ImDrawVert, col) }, }; auto inputLayout = device->createInputLayout( + sizeof(ImDrawVert), &inputElements[0], SLANG_COUNT_OF(inputElements)); @@ -287,7 +288,7 @@ void GUI::endFrame(ITransientResourceHeap* transientHeap, IFramebuffer* framebuf renderEncoder->bindPipeline(pipelineState); - renderEncoder->setVertexBuffer(0, vertexBuffer, sizeof(ImDrawVert)); + renderEncoder->setVertexBuffer(0, vertexBuffer); renderEncoder->setIndexBuffer( indexBuffer, sizeof(ImDrawIdx) == 2 ? Format::R16_UINT : Format::R32_UINT); renderEncoder->setPrimitiveTopology(PrimitiveTopology::TriangleList); @@ -319,7 +320,7 @@ void GUI::endFrame(ITransientResourceHeap* transientHeap, IFramebuffer* framebuf // TODO: set parameter into root shader object. - renderEncoder->drawIndexed(command->ElemCount, indexOffset, vertexOffset); + renderEncoder->drawIndexed(command->ElemCount, (uint32_t)indexOffset, (uint32_t)vertexOffset); } indexOffset += command->ElemCount; } |
