diff --git a/src/intel/compiler/brw/brw_nir_lower_fs_load_output.c b/src/intel/compiler/brw/brw_nir_lower_fs_load_output.c index a73d3a3b515..3871f30d0bc 100644 --- a/src/intel/compiler/brw/brw_nir_lower_fs_load_output.c +++ b/src/intel/compiler/brw/brw_nir_lower_fs_load_output.c @@ -49,22 +49,15 @@ brw_nir_lower_fs_load_output_instr(nir_builder *b, nir_def *coord = nir_vec(b, coords, 3); - nir_def *tex = - key->multisample_fbo == INTEL_NEVER ? - nir_build_tex(b, nir_texop_txf, coord, - .texture_index = target, - .dim = GLSL_SAMPLER_DIM_2D, - .is_array = true, - .dest_type = nir_type_uint32) : - nir_build_tex(b, nir_texop_txf_ms, coord, - .texture_index = target, - .dim = GLSL_SAMPLER_DIM_MS, - .is_array = true, - .ms_index = nir_load_sample_id(b), - .dest_type = nir_type_uint32); + bool msaa = key->multisample_fbo != INTEL_NEVER; + nir_def *tex = nir_txf(b, coord, + .texture_index = target, + .ms_index = msaa ? nir_load_sample_id(b) : NULL, + .dim = msaa ? GLSL_SAMPLER_DIM_MS : GLSL_SAMPLER_DIM_2D, + .is_array = true, + .dest_type = nir_type_uint32); nir_def_replace(&intrin->def, tex); - return true; }