Summary: | [GLSL 1.20] initialized uniform array considered as "unsized" | ||
---|---|---|---|
Product: | Mesa | Reporter: | Gordon Jin <gordon.jin> |
Component: | glsl-compiler | Assignee: | Ian Romanick <idr> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | minor | ||
Priority: | medium | ||
Version: | 7.9 | ||
Hardware: | All | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | new test case for piglit shader_runner |
Test case (attachment id=40658) committed to piglit. commit 4a80100f8c735bc055bde1f18e4052c311f20eb3 Author: Gordon Jin <gordon.jin@intel.com> Date: Fri Dec 3 22:58:07 2010 -0800 glsl-array-uniform-length: Add test case from FDO bug 31985. The piglit test array-compare-04.vert (bug #32035) also hits this issue. Fixed by: commit 7bdaa2c5ad7ef02c1c97367839962ec03361c528 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Tue Dec 7 16:27:22 2010 -0800 glsl: Inherrit type of declared variable from initializer Types of declared variables and their initializer must match excatly except for unsized arrays. Previously the type inherritance for unsized arrays happened implicitly in the emitted assignment. However, this assignment is never emitted for uniforms. Now that type is explicitly copied unconditionally. Fixes piglit test array-compare-04.vert (bugzilla #32035) and glsl-array-uniform-length (bugzilla #31985). NOTE: This is a candidate for the 7.9 branch. verified oh, forgot this is being tracked for 7.9. commit 7b6b66d617b1f14f79fb7af2dad268a68e35b9e3 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Fri Dec 17 13:50:40 2010 -0800 glsl: Inherrit type of declared variable from initializer after processing a do_assignment may apply implicit conversions to coerce the base type of initializer to the base type of the variable being declared. Fixes piglit test glsl-implicit-conversion-02 (bugzilla #32287). This probably also fixes bugzilla #32273. NOTE: This is a candidate for the 7.9 branch and the 7.10 branch. (cherry picked from commit d7f27e2e76eac9bc2ee0fa36f52542fdcb9563dd) Conflicts: src/glsl/ast_to_hir.cpp (In reply to comment #5) > commit 7b6b66d617b1f14f79fb7af2dad268a68e35b9e3 > Author: Ian Romanick <ian.d.romanick@intel.com> > Date: Fri Dec 17 13:50:40 2010 -0800 > > glsl: Inherrit type of declared variable from initializer after processing > a > > do_assignment may apply implicit conversions to coerce the base type > of initializer to the base type of the variable being declared. Fixes > piglit test glsl-implicit-conversion-02 (bugzilla #32287). This > probably also fixes bugzilla #32273. > > NOTE: This is a candidate for the 7.9 branch and the 7.10 branch. > (cherry picked from commit d7f27e2e76eac9bc2ee0fa36f52542fdcb9563dd) > > Conflicts: > > src/glsl/ast_to_hir.cpp Apologies. That was the wrong commit. This is the commit in the 7.9 branch that fixes this issue: commit 2b4277dcf32a88d72fd4e89f3be61e7298c71637 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Tue Dec 7 16:27:22 2010 -0800 glsl: Inherrit type of declared variable from initializer Types of declared variables and their initializer must match excatly except for unsized arrays. Previously the type inherritance for unsized arrays happened implicitly in the emitted assignment. However, this assignment is never emitted for uniforms. Now that type is explicitly copied unconditionally. Fixes piglit test array-compare-04.vert (bugzilla #32035) and glsl-array-uniform-length (bugzilla #31985). NOTE: This is a candidate for the 7.9 branch. (cherry picked from commit b0fc5103cbc9116806a9888f747baed4b8166246) |
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.
Created attachment 40658 [details] new test case for piglit shader_runner below array is declared with implicit size, but after initialization (so it should be explicitly sized) it's still (wrongly) considered as unsized. uniform float a[] = float[](0,1,2,3,4); The attached case fails with below error: Failed to compile FS: 0:5(15): error: length called on unsized array. PIGLIT: {'result': 'fail' } It will pass if the array is local variable instead of uniform variable. Tested on Piketon (i965) with mesa master.