[Bug 79373] New: Non-const initializers for matrix and vector constructors

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed May 28 07:57:47 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=79373

          Priority: medium
            Bug ID: 79373
          Assignee: idr at freedesktop.org
           Summary: Non-const initializers for matrix and vector
                    constructors
        QA Contact: intel-3d-bugs at lists.freedesktop.org
          Severity: normal
    Classification: Unclassified
                OS: Linux (All)
          Reporter: cody at lunarg.com
          Hardware: x86-64 (AMD64)
            Status: NEW
           Version: git
         Component: glsl-compiler
           Product: Mesa

Ran into a problem with ARB_shading_language_420pack on master.  I've got an
app that uses non-const initializers for a matrix.  In debug, the compiler
aborts during IR validation.  In release, it gets the incorrect answer.

The below patch to an existing piglit test shows the problem.  It may affect
other data types, I've only tested with matrices and vectors.

I did enough triage on it to figure out that process_vec_mat_constructor() is
trying to index into a vector, and that doesn't get poofed away by
lower_vector_insert() before validation.  I don't know if the right answer is
to call vector constructors or try to insert with a mask right there.

Anyway, if the original authors could take a look.  The current piglit tests
get constant folded away.

Thanks,

-C


diff --git
a/tests/spec/arb_shading_language_420pack/execution/aggregate-initializer-matrix.shader_test
b/tests/spec/arb_shading_language_420pack/execution/aggregate-initializer-matrix.shader_test
index f5da4c9..0af82f1 100644
---
a/tests/spec/arb_shading_language_420pack/execution/aggregate-initializer-matrix.shader_test
+++
b/tests/spec/arb_shading_language_420pack/execution/aggregate-initializer-matrix.shader_test
@@ -19,9 +19,9 @@ out vec4 color;

 void main()
 {
-    mat2x2 a = mat2(  vec2( 1.0, 0.0 ), vec2( 0.0, 1.0 ) );
-    mat2x2 b =      { vec2( 1.0, 0.0 ), vec2( 0.0, 1.0 ) };
-    mat2x2 c =      {     { 1.0, 0.0 },     { 0.0, 1.0 } };
+    mat2x2 a = mat2(  vec2( 1.0, vertex.x ), vec2( 0.0, 1.0 ) );
+    mat2x2 b =      { vec2( 1.0, vertex.x ), vec2( 0.0, 1.0 ) };
+    mat2x2 c =      {     { 1.0, vertex.x },     { 0.0, 1.0 } };

     color = vec4(0.0, 1.0, 0.0, 1.0);

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20140528/52b9a223/attachment-0001.html>


More information about the intel-3d-bugs mailing list