Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shader compilation error on some windows hardware #1206

Closed
staktrace opened this issue May 5, 2017 · 4 comments
Closed

Shader compilation error on some windows hardware #1206

staktrace opened this issue May 5, 2017 · 4 comments

Comments

@staktrace
Copy link
Contributor

@staktrace staktrace commented May 5, 2017

In this try push the windows 8 mochitest-bc failures happen because WR fails to startup. The log has this shader compilation error:

WebRender - OpenGL version new OpenGL ES 3.0 (ANGLE 2.1.0.dec065540d5f)
...
08:11:31     INFO - GECKO(4672) | Failed to link shader program: C:\fakepath(2369,1-2): error X3004: undeclared identifier 's3'
08:11:31     INFO - GECKO(4672) | Warning: D3D shader compilation failed with default flags. (vs_5_0)
08:11:31     INFO - GECKO(4672) |  Retrying with skip validation
08:11:31     INFO - GECKO(4672) | C:\fakepath(2369,1-2): error X3004: undeclared identifier 's3'
08:11:31     INFO - GECKO(4672) | Warning: D3D shader compilation failed with skip validation flags. (vs_5_0)
08:11:31     INFO - GECKO(4672) |  Retrying with skip optimization
08:11:31     INFO - GECKO(4672) | C:\fakepath(2369,1-2): error X3004: undeclared identifier 's3'
08:11:31     INFO - GECKO(4672) | Warning: D3D shader compilation failed with skip optimization flags. (vs_5_0)
08:11:31     INFO - GECKO(4672) | Failed to create D3D shaders.

Note however that this compilation failure happens pretty late in the log. AFAICT WebRender is initialized numerous times before that successfully. It might just be a shader that we're loading lazily and only gets loaded by particular tests.

Also note that the regular mochitest suite in the same try push must be running on different hardware because it seems to start WR just fine.

bors-servo added a commit that referenced this issue May 9, 2017
Add the shader name to link errors.

Very simple change that should help with figuring out issues like #1206.

r? @kvark

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1214)
<!-- Reviewable:end -->
@mephisto41
Copy link
Contributor

@mephisto41 mephisto41 commented May 22, 2017

I had same problem here. mark 1 and 2 fixed problem but I didn't know why. Maybe dump the d3d shader code which is generated by ANGLE to see what happened here.

@mephisto41
Copy link
Contributor

@mephisto41 mephisto41 commented May 22, 2017

This is compiled shader for write_color

void _write_color_float4(in float4 _color, in float _style, in bool _flip)
{
float2 _modulate = {0, 0};
switch (ivec1(_style)) {
case (6):
s3;
if (_flip)
{
(s3 = float2(1.3, 0.69999999));
}
else
{
(s3 = float2(0.69999999, 1.3));
}
(_modulate = s3);
break;
;
case (7):
s4;
if (_flip)
{
(s4 = float2(0.69999999, 1.3));
}
else
{
(s4 = float2(1.3, 0.69999999));
}
(_modulate = s4);
break;
;
default:
(_modulate = float2(1.0, 1.0));
break;
;
}
;
(_vColor0 = vec4((_color.xyz * _modulate.x), _color.w));
(_vColor1 = vec4((_color.xyz * _modulate.y), _color.w));
}

@mephisto41
Copy link
Contributor

@mephisto41 mephisto41 commented May 22, 2017

Looks like ANGLE code generator generated s3 and s4 without type.

@mephisto41
Copy link
Contributor

@mephisto41 mephisto41 commented May 23, 2017

ANGLE will replace declaration with symbol for statement of switch-case in 1 which I don't know why. I have a workaround that surround the statement by bracket. I'll upload patch.

bors-servo added a commit that referenced this issue May 23, 2017
Surround the statement if switch-case block contains declarations.

This fix #1206 .

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1285)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.