KhronosGroup / OpenXR-Tutorials

OpenXR Tutorials
https://www.openxr-tutorial.com/
Apache License 2.0
72 stars 15 forks source link

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

Closed emaschino closed 6 months ago

emaschino commented 6 months ago

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;
rbessems commented 6 months ago

Yeah that is right. https://github.com/KhronosGroup/OpenXR-Tutorials/pull/121

rbessems commented 6 months ago

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