From d154eaafa9ead9534cfc64a9d666b8dfd1c115e3 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Sat, 21 Sep 2024 16:39:41 +0200 Subject: [PATCH] Make instanced rendering work --- .../Graphics5/Direct3D12/Sources/kope/direct3d12/pipeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/pipeline.cpp b/Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/pipeline.cpp index efa5fa679..1a3ff140b 100644 --- a/Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/pipeline.cpp +++ b/Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/pipeline.cpp @@ -139,7 +139,7 @@ void kope_d3d12_render_pipeline_init(kope_d3d12_device *device, kope_d3d12_rende for (size_t buffer_index = 0; buffer_index < parameters->vertex.buffers_count; ++buffer_index) { for (size_t attribute_index = 0; attribute_index < parameters->vertex.buffers[buffer_index].attributes_count; ++attribute_index) { input_elements[input_element_index].SemanticName = "TEXCOORD"; - input_elements[input_element_index].SemanticIndex = (UINT)attribute_index; + input_elements[input_element_index].SemanticIndex = parameters->vertex.buffers[buffer_index].attributes[attribute_index].shader_location; input_elements[input_element_index].InputSlot = (UINT)buffer_index; input_elements[input_element_index].AlignedByteOffset = (attribute_index == 0) ? 0 : D3D12_APPEND_ALIGNED_ELEMENT; input_elements[input_element_index].InputSlotClass = parameters->vertex.buffers[buffer_index].step_mode == KOPE_D3D12_VERTEX_STEP_MODE_INSTANCE