Closed Bug 1437031 Opened 8 years ago Closed 8 years ago

[Skia] No matching function for call to clamp(int, float, float, float)

Categories

(Core :: Graphics, defect, P3)

57 Branch
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: tarek, Unassigned)

Details

(Whiteboard: [gfx-noted])

Running Nightly works fine, but I am triggering this in the logs every other second. Happy to investigate if you drive me GLSL compilation error ---------------------- SKSL: 1 #version 110 2 uniform vec4 uColor_Stage0;in vec4 vQuadEdge_Stage0;void main() {vec4 outputColor_Stage0;vec4 outputCoverage_Stage0;{ // Stage 0, QuadEdge 3 outputColor_Stage0 = uColor_Stage0;float edgeAlpha;vec2 duvdx = dFdx(vQuadEdge_Stage0.xy);vec2 duvdy = dFdy(vQuadEdge_Stage0.xy);if (vQuadEdge_Stage0.z > 0.0 && vQuadEdge_Stage0.w > 0.0) {edgeAlpha = min(min(vQuadEdge_Stage0.z, vQuadEdge_Stage0.w) + 0.5, 1.0);} else {vec2 gF = vec2(2.0*vQuadEdge_Stage0.x*duvdx.x - duvdx.y, 2.0*vQuadEdge_Stage0.x*duvdy.x - duvdy.y);edgeAlpha = (vQuadEdge_Stage0.x*vQuadEdge_Stage0.x - vQuadEdge_Stage0.y);edgeAlpha = clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0);}outputCoverage_Stage0 = vec4(edgeAlpha);}{ // Xfer Processor: Porter Duff 4 sk_FragColor = outputColor_Stage0 * outputCoverage_Stage0;}} GLSL: 1 #version 110 2 3 uniform vec4 uColor_Stage0; 4 varying vec4 vQuadEdge_Stage0; 5 void main() { 6 vec4 outputColor_Stage0; 7 vec4 outputCoverage_Stage0; 8 { 9 outputColor_Stage0 = uColor_Stage0; 10 float edgeAlpha; 11 vec2 duvdx = dFdx(vQuadEdge_Stage0.xy); 12 vec2 duvdy = dFdy(vQuadEdge_Stage0.xy); 13 if (vQuadEdge_Stage0.z > 0.0 && vQuadEdge_Stage0.w > 0.0) { 14 edgeAlpha = min(min(vQuadEdge_Stage0.z, vQuadEdge_Stage0.w) + 0,5.0, 1.0); 15 } else { 16 vec2 gF = vec2((2.0 * vQuadEdge_Stage0.x) * duvdx.x - duvdx.y, (2.0 * vQuadEdge_Stage0.x) * duvdy.x - duvdy.y); 17 edgeAlpha = vQuadEdge_Stage0.x * vQuadEdge_Stage0.x - vQuadEdge_Stage0.y; 18 edgeAlpha = clamp(0,5.0 - edgeAlpha / length(gF), 0.0, 1.0); 19 } 20 outputCoverage_Stage0 = vec4(edgeAlpha); 21 } 22 { 23 gl_FragColor = outputColor_Stage0 * outputCoverage_Stage0; 24 } 25 } 26 Errors: ERROR: 0:14: '+' does not operate on 'float' and 'int' ERROR: 0:18: No matching function for call to clamp(int, float, float, float)
Lee, you may want to guide here, the fix here is pretty simple, both those lines should contain 0.0 instead of 0 for their integer literals. Figuring out exactly where this is generated inside the Skia GLSL generation code is probably the tricky bit.
Flags: needinfo?(lsalzman)
Whiteboard: [gfx-noted]
(In reply to Bas Schouten (:bas.schouten) from comment #1) > Lee, you may want to guide here, the fix here is pretty simple, both those > lines should contain 0.0 instead of 0 for their integer literals. Figuring > out exactly where this is generated inside the Skia GLSL generation code is > probably the tricky bit. That's not the problem. In the Skia code, that value is "0.5". But for some bizarre reason, some localization code, possibly outside of Skia, is changing it to "0,5.0". That "0.5" gets pumped through a format string in vsnprintf, so I don't get why it would try to screw with locale dependent formatting of said format string.
Flags: needinfo?(lsalzman)
Now that we've updated to a new version of Skia in our nightlies, is this problem fixed for you in the current nightly build?
Flags: needinfo?(tarek)
I have not seen it for a while, let's close it - in case I see it popping again I will reopen thanks all!
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(tarek)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.