| Summary: | WebGL Internal error compiling shader with Metal backend. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Christopher Dyken <cdyk-bugzilla> | ||||
| Component: | WebGL | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | NEW --- | ||||||
| Severity: | Normal | CC: | dino, geofflang, gman, jonahr, kbr, kkinnunen, kpiddington, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | Safari 15 | ||||||
| Hardware: | Mac (Intel) | ||||||
| OS: | macOS 12 | ||||||
| Attachments: |
|
||||||
|
Description
Christopher Dyken
2022-06-17 14:34:05 PDT
Created attachment 460316 [details]
Failure log from Chromium with ANGLE's Metal backend
Failure log from Chromium with ANGLE's Metal backend
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. 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);
}
|