i965/fs: Use UD type for offsets in VARYING_PULL_CONSTANT_LOAD
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 25 Nov 2015 17:59:03 +0000 (09:59 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 14 Apr 2016 21:24:57 +0000 (14:24 -0700)
Reveiewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index 954f7823558ba1a878c1a8bcfe8390fc39d96540..944ad4d8a98dcf270c825b3cccdb6ded6d2e6553 100644 (file)
@@ -174,7 +174,7 @@ fs_visitor::VARYING_PULL_CONSTANT_LOAD(const fs_builder &bld,
     * CSE can later notice that those loads are all the same and eliminate
     * the redundant ones.
     */
-   fs_reg vec4_offset = vgrf(glsl_type::int_type);
+   fs_reg vec4_offset = vgrf(glsl_type::uint_type);
    bld.ADD(vec4_offset, varying_offset, brw_imm_ud(const_offset & ~0xf));
 
    int scale = 1;
index 9b929686b942afb930d719458472f98b9ce40138..698894be1223179625ea89a2cdde6af10dacda70 100644 (file)
@@ -2679,7 +2679,8 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
          assert(const_offset->u32[0] % 4 == 0);
          src.reg_offset = const_offset->u32[0] / 4;
       } else {
-         src.reladdr = new(mem_ctx) fs_reg(get_nir_src(instr->src[0]));
+         src.reladdr = new(mem_ctx) fs_reg(retype(get_nir_src(instr->src[0]),
+                                                  BRW_REGISTER_TYPE_UD));
       }
 
       for (unsigned j = 0; j < instr->num_components; j++) {
@@ -2718,7 +2719,7 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
       nir_const_value *const_offset = nir_src_as_const_value(instr->src[1]);
       if (const_offset == NULL) {
          fs_reg base_offset = retype(get_nir_src(instr->src[1]),
-                                     BRW_REGISTER_TYPE_D);
+                                     BRW_REGISTER_TYPE_UD);
 
          for (int i = 0; i < instr->num_components; i++)
             VARYING_PULL_CONSTANT_LOAD(bld, offset(dest, bld, i), surf_index,