From dcd67adad454dd97bf4f17eb29014cc0bbc27461 Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Sun, 1 Mar 2026 01:27:52 +0100 Subject: [PATCH] fix: shader arg matrix row count --- src/ObjCompiling/Techset/CommonShaderArgCreator.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ObjCompiling/Techset/CommonShaderArgCreator.cpp b/src/ObjCompiling/Techset/CommonShaderArgCreator.cpp index 03621a69..9f0c5c10 100644 --- a/src/ObjCompiling/Techset/CommonShaderArgCreator.cpp +++ b/src/ObjCompiling/Techset/CommonShaderArgCreator.cpp @@ -203,15 +203,14 @@ namespace if (!maybeInfo) return result::Unexpected("Could not find info for code constant"); + const auto isMatrix = maybeInfo->transposedMatrix.has_value(); techset::CommonShaderArgCodeConstValue value{ .m_index = 0, .m_first_row = 0, - .m_row_count = 1, + .m_row_count = isMatrix ? 4u : 1u, }; - // All matrices have a transposed version - // this checks whether this is a matrix - if (maybeInfo->transposedMatrix) + if (isMatrix) { if (sourceIndex >= 4) return result::Unexpected(std::format("Index for matrix code const is out of bounds: {} (must be < 4)", sourceIndex));