Bug 16856 - GLSL indexing of unsized array results in assertion failure
GLSL indexing of unsized array results in assertion failure
Status: RESOLVED FIXED
Product: Mesa
Classification: Unclassified
Component: Mesa core
git
Other All
: medium normal
Assigned To: mesa-dev
:
Depends on:
Blocks: 29044
  Show dependency treegraph
 
Reported: 2008-07-25 17:53 UTC by Ian Romanick
Modified: 2010-08-17 09:03 UTC (History)
1 user (show)

See Also:


Attachments
Offending shader code (283 bytes, text/plain)
2008-07-25 17:53 UTC, Ian Romanick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Romanick 2008-07-25 17:53:40 UTC
Created attachment 17902 [details]
Offending shader code

Compiling the attached vertex shader results in:

vstest: shader/slang/slang_emit.c:194: storage_to_dst_reg: Assertion `st->Index >= 0' failed.

Adding '#define SEGV_INSTEAD' eliminates the assertion failure but results in a segfault instead.
Comment 1 Brian Paul 2008-07-29 15:59:52 UTC
I believe I've fixed this assertion/segfault on the gallium-0.1 branch.  There's a number of GLSL things on that branch I should bring into 7.1... I probably won't have time for a 7.1 release until next week anyway.
Comment 2 Brian Paul 2008-07-29 16:52:45 UTC
OK, I've brought over the GLSL fixes to master from gallium-0.1.

This shader still doesn't compile however, because we don't yet support indexing a vec4 with a variable index.  A mat4 is basically an array[4] of vec4.
Comment 3 ajax at nwnk dot net 2009-08-24 12:30:44 UTC
Mass version move, cvs -> git
Comment 4 Eric Anholt 2010-08-17 09:03:56 UTC
After fixing the shader to use a constant expression for the array sizing, it looks like glsl2 is fine with this.