Bug 36669 - EmitNoMainReturn set to 1 doesn't make the GLSL compiler lower all the RET opcodes
EmitNoMainReturn set to 1 doesn't make the GLSL compiler lower all the RET op...
Status: RESOLVED FIXED
Product: Mesa
Classification: Unclassified
Component: glsl-compiler
git
x86-64 (AMD64) Linux (All)
: medium normal
Assigned To: Paul Berry
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-29 04:36 UTC by Lauri Kasanen
Modified: 2011-07-08 10:09 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Simple fragment shader (118 bytes, text/plain)
2011-04-29 04:36 UTC, Lauri Kasanen
Details
Proposed fix (2.74 KB, patch)
2011-07-05 14:38 UTC, Paul Berry
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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