intel/vec4: Set channel_sizes for MOV_INDIRECT sources
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 23 Mar 2018 16:27:55 +0000 (09:27 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 31 Mar 2018 00:20:27 +0000 (17:20 -0700)
Otherwise, any indirect push constant access results in an assertion
failure when we start digging through the channel_sizes array.  This
fixes dEQP-VK.pipeline.push_constant.graphics_pipeline.dynamic_index_vert
on Haswell.  It should be a harmless no-op for GL since indirect push
constants aren't used there.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Fixes: e69e5c7006d "i965/vec4: load dvec3/4 uniforms first in the..."
src/intel/compiler/brw_vec4.cpp

index 2f352a1118f83a4234eaed5f8505801e2a55b0ed..218925ccb1263729c6dba0fe3e77f207b1020290 100644 (file)
@@ -695,8 +695,11 @@ vec4_visitor::pack_uniform_registers()
           * the next part of our packing algorithm.
           */
          int reg = inst->src[0].nr;
-         for (unsigned i = 0; i < vec4s_read; i++)
+         int channel_size = type_sz(inst->src[0].type) / 4;
+         for (unsigned i = 0; i < vec4s_read; i++) {
             chans_used[reg + i] = 4;
+            channel_sizes[reg + i] = MAX2(channel_sizes[reg + i], channel_size);
+         }
       }
    }