This bug with the Radeon 5450 turned out to be a SKSL -> GLSL problem with assuming you can construct a mat2 from a vec4. For some reason on this very old card the runtime shader compilation fails with
`
ERROR: 0:32:
error(#53) Built-in function parameter type check fail: an operation
which requires matrix parameters is used on a non matrix type!`
It works fine on every other card / driver situation we can come up with. The patch is then in the generated sksl for the GrPathTessellationShader/GrStrokeTessellationShader to build the float2x2 eventual mat2 more directly by accessing xyzw.
the patch that works for us:
diff --git a/src/gpu/tessellate/shaders/GrPathTessellationShader.cpp b/src/gpu/tessellate/shaders/GrPathTessellationShader.cpp
index 439cf439e1..82771b92d0 100644
--- a/src/gpu/tessellate/shaders/GrPathTessellationShader.cpp
+++ b/src/gpu/tessellate/shaders/GrPathTessellationShader.cpp
@@ -124,7 +124,7 @@ void GrPathTessellationShader::Impl::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs
&affineMatrix);
fTranslateUniform = args.fUniformHandler->addUniform(nullptr, kVertex_GrShaderFlag,
kFloat2_GrSLType, "translate", &translate);
- args.fVertBuilder->codeAppendf("float2x2 AFFINE_MATRIX = float2x2(%s);", affineMatrix);
+ args.fVertBuilder->codeAppendf("float2x2 AFFINE_MATRIX = float2x2(%s.x, %s.y, %s.z, %s.w);", affineMatrix, affineMatrix, affineMatrix, affineMatrix);
args.fVertBuilder->codeAppendf("float2 TRANSLATE = %s;", translate);
this->emitVertexCode(*args.fShaderCaps,
shader,
diff --git a/src/gpu/tessellate/shaders/GrStrokeTessellationShader_HardwareImpl.cpp b/src/gpu/tessellate/shaders/GrStrokeTessellationShader_HardwareImpl.cpp
index 4b558ec07c..37134192c3 100644
--- a/src/gpu/tessellate/shaders/GrStrokeTessellationShader_HardwareImpl.cpp
+++ b/src/gpu/tessellate/shaders/GrStrokeTessellationShader_HardwareImpl.cpp
@@ -99,7 +99,7 @@ void GrStrokeTessellationShader::HardwareImpl::onEmitCode(EmitArgs& args, GrGPAr
fAffineMatrixUniform = uniHandler->addUniform(nullptr, affineMatrixVisibility, kFloat4_GrSLType,
"affineMatrix", &affineMatrixName);
if (affineMatrixVisibility & kVertex_GrShaderFlag) {
- v->codeAppendf("float2x2 AFFINE_MATRIX = float2x2(%s);\n", affineMatrixName);
+ v->codeAppendf("float2x2 AFFINE_MATRIX = float2x2(%s.x, %s.y, %s.z, %s.w);\n", affineMatrixName, affineMatrixName, affineMatrixName, affineMatrixName);
}
v->codeAppend(R"(
Hopefully this helps someone else that runs into this with the
Radeon
5450
Cheers,
Jasper