From 7cb8ab6efde472921dfdaced550f1d912e6d4edc Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Thu, 18 Jan 2024 18:39:48 +0100 Subject: [PATCH] D3D11: correctly handle non-square matrices with mColumnMajorMatrices = false --- RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp b/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp index edde3ef574f..2ac9f6021d9 100644 --- a/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp +++ b/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp @@ -1171,6 +1171,9 @@ namespace Ogre { } // columns break; case D3D10_SVT_FLOAT: + if(d3dDesc.Rows > 1 && mColumnMajorMatrices) + std::swap(d3dDesc.Rows, d3dDesc.Columns); + switch(d3dDesc.Rows) { case 1: