Bug 16856

Summary: GLSL indexing of unsized array results in assertion failure
Product: Mesa Reporter: Ian Romanick <idr>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: gordon.jin
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 29044    
Attachments: Offending shader code

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 Adam Jackson 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.

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.