Mesa (master): i965: Fix "handle nir_intrinsic_image_size"

Martin Peres mperes at kemper.freedesktop.org
Thu Aug 20 12:29:57 UTC 2015


Module: Mesa
Branch: master
Commit: 56ebd3314bfc5895fab47586fc8cda024aac4fd8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=56ebd3314bfc5895fab47586fc8cda024aac4fd8

Author: Martin Peres <martin.peres at linux.intel.com>
Date:   Thu Aug 20 15:15:56 2015 +0300

i965: Fix "handle nir_intrinsic_image_size"

I pushed a half-baked version of "i965: handle nir_intrinsic_image_size" by
accident. Not having the Reviewed-by: tags on the last two commits should
have been a red flag but I somehow missed it after the QA check.

This patch should fix image-size for non-int images. I will add support to
the piglit test for all the other image types.

Sorry for the noise.

Signed-off-by: Martin Peres <martin.peres at linux.intel.com>
Reviewed-by: Francisco Jerez <currojerez at riseup.net>

---

 src/mesa/drivers/dri/i965/brw_fs_nir.cpp |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index 12471fb..c726c72 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -1410,7 +1410,6 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
       /* Get the referenced image variable and type. */
       const nir_variable *var = instr->variables[0]->var;
       const glsl_type *type = var->type->without_array();
-      const brw_reg_type base_type = get_image_base_type(type);
 
       /* Get the size of the image. */
       const fs_reg image = get_nir_image_deref(instr->variables[0]);
@@ -1437,14 +1436,14 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
              bld.MOV(offset(retype(dest, BRW_REGISTER_TYPE_D), bld, c),
                      fs_reg(1));
          } else if (c == 1 && is_1d_array_image) {
-            bld.MOV(offset(retype(dest, base_type), bld, c),
+            bld.MOV(offset(retype(dest, BRW_REGISTER_TYPE_D), bld, c),
                     offset(size, bld, 2));
          } else if (c == 2 && is_cube_array_image) {
             bld.emit(SHADER_OPCODE_INT_QUOTIENT,
-                     offset(retype(dest, base_type), bld, c),
+                     offset(retype(dest, BRW_REGISTER_TYPE_D), bld, c),
                      offset(size, bld, c), fs_reg(6));
          } else {
-            bld.MOV(offset(retype(dest, base_type), bld, c),
+            bld.MOV(offset(retype(dest, BRW_REGISTER_TYPE_D), bld, c),
                     offset(size, bld, c));
          }
        }




More information about the mesa-commit mailing list