Commit ac0a267b by Jamie Madill

Fix non-square matrix vertex attributes.

When we generate an input signature for a vertex shader, we should use the transpose of the matrix type instead of the matrix type itself. This was breaking dEQP tests 'shaders.functions.datatypes'. BUG=angle:594 Change-Id: Ia945ffd865d7255500f7a62394bcd5bdfbbedef4 Reviewed-on: https://chromium-review.googlesource.com/191461Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 12bea0a9
...@@ -393,9 +393,9 @@ std::string DynamicHLSL::generateInputLayoutHLSL(const VertexFormat inputLayout[ ...@@ -393,9 +393,9 @@ std::string DynamicHLSL::generateInputLayoutHLSL(const VertexFormat inputLayout[
} }
initHLSL += ";\n"; initHLSL += ";\n";
}
inputIndex += VariableRowCount(shaderAttribute.type); inputIndex += VariableRowCount(TransposeMatrixType(shaderAttribute.type));
}
} }
return "struct VS_INPUT\n" return "struct VS_INPUT\n"
......
...@@ -61,14 +61,16 @@ void GetInputLayoutFromShader(const std::vector<sh::Attribute> &shaderAttributes ...@@ -61,14 +61,16 @@ void GetInputLayoutFromShader(const std::vector<sh::Attribute> &shaderAttributes
if (shaderAttr.type != GL_NONE) if (shaderAttr.type != GL_NONE)
{ {
for (size_t rowIndex = 0; static_cast<int>(rowIndex) < VariableRowCount(shaderAttr.type); rowIndex++, layoutIndex++) GLenum transposedType = TransposeMatrixType(shaderAttr.type);
for (size_t rowIndex = 0; static_cast<int>(rowIndex) < VariableRowCount(transposedType); rowIndex++, layoutIndex++)
{ {
VertexFormat *defaultFormat = &inputLayout[layoutIndex]; VertexFormat *defaultFormat = &inputLayout[layoutIndex];
defaultFormat->mType = UniformComponentType(shaderAttr.type); defaultFormat->mType = UniformComponentType(transposedType);
defaultFormat->mNormalized = false; defaultFormat->mNormalized = false;
defaultFormat->mPureInteger = (defaultFormat->mType != GL_FLOAT); // note: inputs can not be bool defaultFormat->mPureInteger = (defaultFormat->mType != GL_FLOAT); // note: inputs can not be bool
defaultFormat->mComponents = VariableColumnCount(shaderAttr.type); defaultFormat->mComponents = VariableColumnCount(transposedType);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment