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

glsl non-empty case statements must have break or return for ANGLE #1044

Closed
sotaroikeda opened this issue Mar 31, 2017 · 8 comments
Closed

glsl non-empty case statements must have break or return for ANGLE #1044

sotaroikeda opened this issue Mar 31, 2017 · 8 comments

Comments

@sotaroikeda
Copy link
Contributor

@sotaroikeda sotaroikeda commented Mar 31, 2017

ps_border.fs.glsl and ps_border.vs.glsl has non-empty case statements must have break or return, it causes failures of compiling the shaders. I faced the problem on gecko webrender on graphics branch on Windows. When I tested on windows, "discard;" also seemed to request break/return

The following are actual error log.

C:\fakepath(4586,1): error X3533: non-empty case statements must have break or return
C:\fakepath(4589,1): error X3533: non-empty case statements must have break or return

@sotaroikeda
Copy link
Contributor Author

@sotaroikeda sotaroikeda commented Mar 31, 2017

#749 fixed the same problem in the past.

@emilio
Copy link
Member

@emilio emilio commented Mar 31, 2017

didn't we have angle running in CI for this?

@kvark
Copy link
Member

@kvark kvark commented Mar 31, 2017

Yes, it was added in #713, and CI still passes successfully: https://travis-ci.org/servo/webrender/jobs/217127497#L626
I also checked cd webrender && cargo test locally and got:

Shader translated succesfully: ps_border.vs
Shader translated succesfully: ps_border.vs

So either we are not setting Angle up correctly, or it just behaves differently on Linux vs Windows?..

@sotaroikeda
Copy link
Contributor Author

@sotaroikeda sotaroikeda commented Mar 31, 2017

It seems like Windows specific.

@sotaroikeda
Copy link
Contributor Author

@sotaroikeda sotaroikeda commented Mar 31, 2017

I faced the problem during investigating https://bugzilla.mozilla.org/show_bug.cgi?id=1352287

@sotaroikeda
Copy link
Contributor Author

@sotaroikeda sotaroikeda commented Mar 31, 2017

The following are actual log out when the problem happened.

WebRender - OpenGL version new OpenGL ES 3.0 (ANGLE 2.1.0.2a250c8a0e15)
[Child 2468] WARNING: pipe error: 109: file c:/quantum_gfx_src_1/graphics/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 2468] WARNING: pipe error: 109: file c:/quantum_gfx_src_1/graphics/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
WebRender - OpenGL version new OpenGL ES 3.0 (ANGLE 2.1.0.2a250c8a0e15)
Failed to link shader program: C:\fakepath(889,25-35): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\fakepath(889,41-51): warning X3556: integer divides may be much slower, try using uints if possible.
C:\fakepath(914,24-35): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\fakepath(914,41-52): warning X3556: integer divides may be much slower, try using uints if possible.
C:\fakepath(964,24-35): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\fakepath(964,41-52): warning X3556: integer divides may be much slower, try using uints if possible.
C:\fakepath(864,20-31): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\fakepath(864,37-48): warning X3556: integer divides may be much slower, try using uints if possible.

C:\fakepath(976,1): error X3533: non-empty case statements must have break or return
C:\fakepath(979,1): error X3533: non-empty case statements must have break or return
C:\fakepath(977,8): 
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Link("C:\\fakepath(889,25-35): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\\fakepath(889,41-51): warning X3556: integer divides may be much slower, try using uints if possible.
C:\\fakepath(914,24-35): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\\fakepath(914,41-52): warning X3556: integer divides may be much slower, try using uints if possible.
C:\\fakepath(964,24-35): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\\fakepath(964,41-52): warning X3556: integer divides may be much slower, try using uints if possible.
C:\\fakepath(864,20-31): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\\fakepath(864,37-48): warning X3556: integer divides may be much slower, try using uints if possible.

C:\\fakepath(976,1): error X3533: non-empty case statements must have break or return
C:\\fakepath(979,1): error X3533: non-empty case statements must have break or return
C:\\fakepath(977,8): ")', src\libcore\result.rs:860
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: gleam::gl::{{impl}}::draw_elements_instanced
             at ./third_party\rust\gleam\src\gles_fns.rs:723
@sotaroikeda
Copy link
Contributor Author

@sotaroikeda sotaroikeda commented Apr 3, 2017

The following did not work on windows

   case BORDER_STYLE_HIDDEN:
     discard;

The following works on windows, but it did not work on linux

   case BORDER_STYLE_HIDDEN:
     discard;
     break;
@staktrace
Copy link
Contributor

@staktrace staktrace commented Apr 3, 2017

See also https://bugzilla.mozilla.org/show_bug.cgi?id=1352878 (note the unwrap_failed<webrender::device::ShaderError> in comment 0 of that bug)

bors-servo added a commit that referenced this issue Apr 4, 2017
Make non-empty case statements have break or return

Fixes  #1044

<!-- 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/1054)
<!-- 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.

None yet
4 participants
You can’t perform that action at this time.