Bug 36669

Summary: EmitNoMainReturn set to 1 doesn't make the GLSL compiler lower all the RET opcodes
Product: Mesa Reporter: Lauri Kasanen <cand>
Component: glsl-compilerAssignee: Paul Berry <stereotype441>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Simple fragment shader
Proposed fix

Description Lauri Kasanen 2011-04-29 04:36:04 UTC
Created attachment 46150 [details]
Simple fragment shader

The attached shader creates an error on r600g:
EE r600_shader.c:827 tgsi_unsupported - 64 tgsi opcode unsupported

The opcode is ret, but nothing should be generated, since the function is of type void and return is the last line.
Comment 1 Paul Berry 2011-06-28 14:09:15 UTC
I'll look into this.
Comment 2 Paul Berry 2011-07-05 14:38:41 UTC
Created attachment 48788 [details] [review]
Proposed fix
Comment 3 Paul Berry 2011-07-05 14:40:55 UTC
Lauri--

Can you please try the patch I've attached and let me know if it fixes the problem?  I believe the patch is correct, but I don't have an r600g to test with.

I'll be submitting a broader patch series to the mesa mailing list soon, which will include this fix as well as other improvements to lower_jumps.cpp.
Comment 4 Lauri Kasanen 2011-07-06 07:45:09 UTC
Hello Paul

I saw the full set. Unfortunately I can't test for the time being, as I don't have such hardware right now either.
Comment 5 Paul Berry 2011-07-06 07:56:22 UTC
(In reply to comment #4)

Ok, thanks Lauri.  I have plenty of other evidence that the patch works, so there is no rush.  I will proceed under the assumption that the fix is working once I have code review from the list.
Comment 6 Paul Berry 2011-07-08 10:09:01 UTC
Fixed with commit afc9a50fba39df520046019c6993d7b7559329ea

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.