Bug 79724

Summary: switch statement type check
Product: Mesa Reporter: Tapani Pälli <lemody>
Component: glsl-compilerAssignee: Tapani Pälli <lemody>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

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.