i965/fs: Handle compact outputs.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 4 Oct 2016 08:59:33 +0000 (01:59 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 22 Nov 2016 08:29:24 +0000 (00:29 -0800)
We need to calculate the number of vec4 slots correctly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index e770502b7231f1d338edbcfee9142b4a9f3513d4..82e22c27310b1e71bf95e67df24b8db46d0fb82e 100644 (file)
@@ -55,7 +55,9 @@ fs_visitor::nir_setup_outputs()
       return;
 
    nir_foreach_variable(var, &nir->outputs) {
-      const unsigned vec4s = type_size_vec4(var->type);
+      const unsigned vec4s =
+         var->data.compact ? DIV_ROUND_UP(glsl_get_length(var->type), 4)
+                           : type_size_vec4(var->type);
       fs_reg reg = bld.vgrf(BRW_REGISTER_TYPE_F, 4 * vec4s);
       for (unsigned i = 0; i < vec4s; i++) {
          if (outputs[var->data.driver_location + i].file == BAD_FILE)