WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
241728
WebGL Internal error compiling shader with Metal backend.
https://bugs.webkit.org/show_bug.cgi?id=241728
Summary
WebGL Internal error compiling shader with Metal backend.
Christopher Dyken
Reported
2022-06-17 14:34:05 PDT
On Safari 15 (both MacOs 12 and iOS 15.5), my shaders have started to fail linking with the message "Internal error compiling shader with Metal backend". They work fine on chrome and firefox. I have reduced one shader to the following repro case (
https://jsfiddle.net/cdyk1/12whq53t/11/
): const canvas = document.getElementById("foo"); const gl = canvas.getContext("webgl2") const vs = gl.createShader(gl.VERTEX_SHADER); gl.shaderSource(vs, `#version 300 es precision highp float; in vec3 a_POSITION0; void main() { gl_Position = vec4(a_POSITION0, 1.0); } `); gl.compileShader(vs); console.log(gl.getShaderInfoLog(vs)); const fs = gl.createShader(gl.FRAGMENT_SHADER); gl.shaderSource(fs, `#version 300 es precision highp float; uniform MaterialParameters { float specularPower; }; layout(location=0) out vec4 fragColor; void main() { fragColor = vec4(specularPower != 0.0 ? specularPower : 80.0); } ` ); gl.compileShader(fs); console.log(gl.getShaderInfoLog(fs)); const prog = gl.createProgram(); gl.attachShader(prog, vs); gl.attachShader(prog, fs); gl.linkProgram(prog); console.log(gl.getProgramInfoLog(prog)); // Outputs "Internal error compiling shader with Metal backend."
Attachments
Failure log from Chromium with ANGLE's Metal backend
(29.13 KB, text/plain)
2022-06-17 15:50 PDT
,
Kenneth Russell
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Kenneth Russell
Comment 1
2022-06-17 15:50:47 PDT
Created
attachment 460316
[details]
Failure log from Chromium with ANGLE's Metal backend Failure log from Chromium with ANGLE's Metal backend
Kenneth Russell
Comment 2
2022-06-17 15:52:01 PDT
Attached is the failure log from top-of-tree Chromium with ANGLE's Metal backend. It looks like there's a bug in translation of the uniform block containing a single float. Hopefully Kyle's ongoing work to change how uniform blocks are translated will implicitly address this.
Christopher Dyken
Comment 3
2022-06-18 01:49:37 PDT
It looks like the failure is tied to fetching the true-expression from a uniform block: Putting more data into MaterialParameter still fails to link: ---------------------------------------- #version 300 es precision highp float; uniform MaterialParameters { vec4 bar; float specularPower; float baz; }; layout(location=0) out vec4 fragColor; void main() { fragColor = vec4(specularPower != 0.0 ? specularPower : 80.0, bar.xy, baz); } ---------------------------------------- Moving specularPower out of the block into a single uniform links successfully: ---------------------------------------- #version 300 es precision highp float; uniform MaterialParameters { vec4 bar; float baz; }; uniform float specularPower; layout(location=0) out vec4 fragColor; void main() { fragColor = vec4(specularPower != 0.0 ? specularPower : 80.0, bar.xy, baz); } ---------------------------------------- Adding a float-cast to the true-expression links successfully: ---------------------------------------- #version 300 es precision highp float; uniform MaterialParameters { float specularPower; }; layout(location=0) out vec4 fragColor; void main() { fragColor = vec4(specularPower != 0.0 ? float(specularPower) : 80.0); } ---------------------------------------- Fetching from the false-expression links successfully: ---------------------------------------- #version 300 es precision highp float; uniform MaterialParameters { float specularPower; }; layout(location=0) out vec4 fragColor; void main() { fragColor = vec4(specularPower == 0.0 ? 80.0 : specularPower); }
Radar WebKit Bug Importer
Comment 4
2022-06-24 14:35:13 PDT
<
rdar://problem/95880969
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug