Pass matrix packing qualifier data back from the shader translator to the GLES API.
TRAC #23271
Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Authored-by: Jamie Madill
diff --git a/src/compiler/OutputHLSL.cpp b/src/compiler/OutputHLSL.cpp
index d117a30..6aab921 100644
--- a/src/compiler/OutputHLSL.cpp
+++ b/src/compiler/OutputHLSL.cpp
@@ -3435,19 +3435,23 @@
if (!structure)
{
- output.push_back(Uniform(glVariableType(type), glVariablePrecision(type), name.c_str(), (unsigned int)type.getArraySize(), (unsigned int)index));
+ const bool isRowMajorMatrix = (type.isMatrix() && type.getLayoutQualifier().matrixPacking == EmpRowMajor);
+ output.push_back(Uniform(glVariableType(type), glVariablePrecision(type), name.c_str(), (unsigned int)type.getArraySize(), (unsigned int)index, isRowMajorMatrix));
}
else
{
- Uniform structUniform(GL_NONE, GL_NONE, name.c_str(), (unsigned int)type.getArraySize(), (unsigned int)index);
+ Uniform structUniform(GL_NONE, GL_NONE, name.c_str(), (unsigned int)type.getArraySize(), (unsigned int)index, false);
int fieldIndex = index;
for (size_t i = 0; i < structure->size(); i++)
{
- const TType &fieldType = *(*structure)[i].type;
+ TType fieldType = *(*structure)[i].type;
const TString &fieldName = fieldType.getFieldName();
+ // make sure to copy matrix packing information
+ fieldType.setLayoutQualifier(type.getLayoutQualifier());
+
declareUniformToList(fieldType, fieldName, fieldIndex, structUniform.fields);
fieldIndex += fieldType.totalRegisterCount();
}