diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 57a2b77a516..f35f7ce530f 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -580,7 +580,6 @@ iris_to_brw_fs_key(const struct iris_screen *screen, .persample_interp = key->persample_interp ? INTEL_ALWAYS : INTEL_NEVER, .multisample_fbo = key->multisample_fbo ? INTEL_ALWAYS : INTEL_NEVER, .force_dual_color_blend = key->force_dual_color_blend, - .coherent_fb_fetch = key->coherent_fb_fetch, .color_outputs_valid = key->color_outputs_valid, .ignore_sample_mask_out = !key->multisample_fbo, .null_push_constant_tbimr_workaround = diff --git a/src/intel/compiler/brw/brw_compile_fs.cpp b/src/intel/compiler/brw/brw_compile_fs.cpp index 50938464acd..54743fe5923 100644 --- a/src/intel/compiler/brw/brw_compile_fs.cpp +++ b/src/intel/compiler/brw/brw_compile_fs.cpp @@ -1350,7 +1350,6 @@ run_fs(brw_shader &s, bool allow_spilling, bool do_rep_send) { const struct intel_device_info *devinfo = s.devinfo; struct brw_wm_prog_data *wm_prog_data = brw_wm_prog_data(s.prog_data); - brw_wm_prog_key *wm_key = (brw_wm_prog_key *) s.key; const brw_builder bld = brw_builder(&s); const nir_shader *nir = s.nir; @@ -1367,7 +1366,7 @@ run_fs(brw_shader &s, bool allow_spilling, bool do_rep_send) } else { if (nir->info.inputs_read > 0 || BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_FRAG_COORD) || - (nir->info.outputs_read > 0 && !wm_key->coherent_fb_fetch)) { + (nir->info.outputs_read > 0 && !brw_can_coherent_fb_fetch(devinfo))) { brw_emit_interpolation_setup(s); } @@ -1509,7 +1508,7 @@ brw_compile_fs(const struct brw_compiler *compiler, brw_nir_lower_fs_inputs(nir, devinfo, key); brw_nir_lower_fs_outputs(nir); - if (!key->coherent_fb_fetch) + if (!brw_can_coherent_fb_fetch(devinfo)) NIR_PASS(_, nir, brw_nir_lower_fs_load_output, key); NIR_PASS(_, nir, nir_opt_frag_coord_to_pixel_coord); diff --git a/src/intel/compiler/brw/brw_compiler.h b/src/intel/compiler/brw/brw_compiler.h index 5045a210741..80d9e03afdb 100644 --- a/src/intel/compiler/brw/brw_compiler.h +++ b/src/intel/compiler/brw/brw_compiler.h @@ -431,12 +431,11 @@ struct brw_wm_prog_key { /* Is provoking vertex last? */ enum intel_sometimes provoking_vertex_last:2; - bool coherent_fb_fetch:1; bool ignore_sample_mask_out:1; bool coarse_pixel:1; bool null_push_constant_tbimr_workaround:1; bool api_sample_shading:1; - unsigned pad:2; + unsigned pad:3; }; static inline bool diff --git a/src/intel/compiler/brw/brw_debug_recompile.c b/src/intel/compiler/brw/brw_debug_recompile.c index 700c983ec43..06366a0f453 100644 --- a/src/intel/compiler/brw/brw_debug_recompile.c +++ b/src/intel/compiler/brw/brw_debug_recompile.c @@ -138,7 +138,6 @@ debug_fs_recompile(const struct brw_compiler *c, void *log, found |= check("per-sample interpolation", persample_interp); found |= check("multisampled FBO", multisample_fbo); found |= check("force dual color blending", force_dual_color_blend); - found |= check("coherent fb fetch", coherent_fb_fetch); found |= check("ignore sample mask out", ignore_sample_mask_out); found |= check("coarse pixel", coarse_pixel); diff --git a/src/intel/compiler/brw/brw_from_nir.cpp b/src/intel/compiler/brw/brw_from_nir.cpp index 6f888391e2a..162b398dd75 100644 --- a/src/intel/compiler/brw/brw_from_nir.cpp +++ b/src/intel/compiler/brw/brw_from_nir.cpp @@ -3931,7 +3931,8 @@ brw_from_nir_emit_fs_intrinsic(nir_to_brw_state &ntb, const unsigned target = l - FRAG_RESULT_DATA0 + load_offset; const brw_reg tmp = bld.vgrf(dest.type, 4); - assert(reinterpret_cast(s.key)->coherent_fb_fetch); + /* Not functional after Gfx20 */ + assert(brw_can_coherent_fb_fetch(devinfo)); emit_coherent_fb_read(bld, tmp, target); brw_combine_with_vec(bld, dest, diff --git a/src/intel/compiler/brw/brw_shader.h b/src/intel/compiler/brw/brw_shader.h index bfa81f6b315..0cac6233ef2 100644 --- a/src/intel/compiler/brw/brw_shader.h +++ b/src/intel/compiler/brw/brw_shader.h @@ -251,6 +251,13 @@ void brw_print_instruction(const brw_shader &s, const brw_inst *inst, void brw_print_swsb(FILE *f, const struct intel_device_info *devinfo, const tgl_swsb swsb); +static inline bool +brw_can_coherent_fb_fetch(const struct intel_device_info *devinfo) +{ + /* Not functional after Gfx20 */ + return devinfo->ver >= 9 && devinfo->ver < 20; +} + /** * Return the flag register used in fragment shaders to keep track of live * samples. On Gfx7+ we use f1.0-f1.1 to allow discard jumps in SIMD32 @@ -406,4 +413,3 @@ brw_inst *brw_clone_inst(brw_shader &s, const brw_inst *inst); */ brw_inst *brw_transform_inst(brw_shader &s, brw_inst *inst, enum opcode new_opcode, unsigned new_num_srcs = UINT_MAX); -