KhronosGroup/OpenXR-Tutorials

Incorrect Vertex Input in void GraphicsAPI_D3D11::SetPipeline(void *pipeline)?

emaschino opened this issue · 2 comments

Hi,

I think that element.SemanticIndex is incorrectly set to attribute.bindingIndex. Shouldn't it be rather set to attribute.attribIndex?

diff --git a/Common/GraphicsAPI_D3D11.cpp b/Common/GraphicsAPI_D3D11.cpp
index 5573e91..954848f 100755
--- a/Common/GraphicsAPI_D3D11.cpp
+++ b/Common/GraphicsAPI_D3D11.cpp
@@ -761,7 +761,7 @@ void GraphicsAPI_D3D11::SetPipeline(void *pipeline) {
         for (const VertexInputAttribute &attribute : pipelineCI.vertexInputState.attributes) {
             D3D11_INPUT_ELEMENT_DESC element{};
             element.SemanticName = attribute.semanticName;
-            element.SemanticIndex = attribute.bindingIndex;
+            element.SemanticIndex = attribute.attribIndex;
             element.Format = ToDXGI_FORMAT(attribute.vertexType);
             element.InputSlot = attribute.bindingIndex;
             element.AlignedByteOffset = (UINT)attribute.offset;

Yeah that is right. #121

Published v1.0.3 of the site, which fixes this issue.