i965/fs: Use num_components from the SSA def in image intrinsics
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 3 Mar 2017 05:39:58 +0000 (21:39 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 14 Mar 2017 14:36:40 +0000 (07:36 -0700)
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/intel/compiler/brw_fs_nir.cpp

index d403dec53577075946a035f6b9c3e07ef26d9e45..b392895e8fd5ba035697c6012fa1964b3bb1e98f 100644 (file)
@@ -3759,8 +3759,7 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
                   type->sampler_array;
 
       /* Copy all the components. */
-      const nir_intrinsic_info *info = &nir_intrinsic_infos[instr->intrinsic];
-      for (unsigned c = 0; c < info->dest_components; ++c) {
+      for (unsigned c = 0; c < instr->dest.ssa.num_components; ++c) {
          if ((int)c >= type->coordinate_components()) {
              bld.MOV(offset(retype(dest, BRW_REGISTER_TYPE_D), bld, c),
                      brw_imm_d(1));