Bug 79724 - switch statement type check
Summary: switch statement type check
Status: RESOLVED FIXED
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
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
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:


Attachments

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 : ...
default:
}
--- 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:
http://lists.freedesktop.org/archives/piglit/2014-June/011076.html
Comment 3 Tapani Pälli 2014-06-09 11:30:29 UTC
I sent a patch proposal to fix this:
http://lists.freedesktop.org/archives/mesa-dev/2014-June/061018.html
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.