Bug 79724 - switch statement type check
Summary: switch statement type check
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Tapani Pälli
QA Contact: Intel 3D Bugs Mailing List
Depends on:
Reported: 2014-06-06 12:13 UTC by Tapani Pälli
Modified: 2014-06-17 05:17 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Note You need to log in before you can comment on or make changes to this bug.
Description Tapani Pälli 2014-06-06 12:13:25 UTC
Switch statement needs to do type checking in following condition. Following example should not fail miserably:

--- 8< ---
uint x = 2u;

switch (x) {
case 1 : ...
case 2 : ...
case 3 : ...
--- 8< ---

Right now the glsl_type of switch cases will be 'int' but the expression is 'uint' and things fail later on.
Comment 1 Tapani Pälli 2014-06-06 12:15:14 UTC
I can try to tackle this after reading GLSL spec more carefully.
Comment 2 Tapani Pälli 2014-06-06 12:27:11 UTC
I sent a Piglit test for this:
Comment 3 Tapani Pälli 2014-06-09 11:30:29 UTC
I sent a patch proposal to fix this:
Comment 4 Tapani Pälli 2014-06-17 05:17:02 UTC
patch pushed to master

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.