From 0a8d05c555438fe37066abe8c9a2b3822370fd81 Mon Sep 17 00:00:00 2001 From: falia18 Date: Thu, 8 Feb 2024 22:09:33 +0100 Subject: [PATCH] D3D12: fix D3D12_VERTEX_BUFFER_VIEW stride when both vertex layout handles are valid --- src/renderer_d3d12.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 3cb55629a..7d1b4532c 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -4253,7 +4253,7 @@ namespace bgfx { namespace d3d12 VertexBufferD3D12& vb = s_renderD3D12->m_vertexBuffers[handle]; vb.setState(_commandList, D3D12_RESOURCE_STATE_GENERIC_READ); - const uint16_t layoutIdx = !isValid(vb.m_layoutHandle) ? stream.m_layoutHandle.idx : vb.m_layoutHandle.idx; + const uint16_t layoutIdx = isValid(stream.m_layoutHandle) ? stream.m_layoutHandle.idx : vb.m_layoutHandle.idx; const VertexLayout& layout = s_renderD3D12->m_vertexLayouts[layoutIdx]; const uint32_t stride = layout.m_stride;