diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 2b9ff7ac932..46552fe4dfa 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -7303,7 +7303,7 @@ brw_nir_move_interpolation_to_top(nir_shader *nir) } static void -brw_nir_populate_wm_prog_data(const nir_shader *shader, +brw_nir_populate_wm_prog_data(nir_shader *shader, const struct intel_device_info *devinfo, const struct brw_wm_prog_key *key, struct brw_wm_prog_data *prog_data, @@ -7412,6 +7412,35 @@ brw_nir_populate_wm_prog_data(const nir_shader *shader, prog_data->coarse_pixel_dispatch = BRW_NEVER; } + /* ICL PRMs, Volume 9: Render Engine, Shared Functions Pixel Interpolater, + * Message Descriptor : + * + * "Message Type. Specifies the type of message being sent when + * pixel-rate evaluation is requested : + * + * Format = U2 + * 0: Per Message Offset (eval_snapped with immediate offset) + * 1: Sample Position Offset (eval_sindex) + * 2: Centroid Position Offset (eval_centroid) + * 3: Per Slot Offset (eval_snapped with register offset) + * + * Message Type. Specifies the type of message being sent when + * coarse-rate evaluation is requested : + * + * Format = U2 + * 0: Coarse to Pixel Mapping Message (internal message) + * 1: Reserved + * 2: Coarse Centroid Position (eval_centroid) + * 3: Per Slot Coarse Pixel Offset (eval_snapped with register offset)" + * + * The Sample Position Offset is marked as reserved for coarse rate + * evaluation and leads to hangs if we try to use it. So disable coarse + * pixel shading if we have any intrinsic that will result in a pixel + * interpolater message at sample. + */ + if (brw_nir_pulls_at_sample(shader)) + prog_data->coarse_pixel_dispatch = BRW_NEVER; + /* We choose to always enable VMask prior to XeHP, as it would cause * us to lose out on the eliminate_find_live_channel() optimization. */ diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index f346d840fe7..4f82fa042d8 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -2083,3 +2083,23 @@ brw_nir_load_global_const(nir_builder *b, nir_intrinsic_instr *load_uniform, return sysval; } + +bool +brw_nir_pulls_at_sample(nir_shader *shader) +{ + nir_foreach_function_impl(impl, shader) { + nir_foreach_block(block, impl) { + nir_foreach_instr(instr, block) { + if (instr->type != nir_instr_type_intrinsic) + continue; + + nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr); + + if (intrin->intrinsic == nir_intrinsic_load_barycentric_at_sample) + return true; + } + } + } + + return false; +} diff --git a/src/intel/compiler/brw_nir.h b/src/intel/compiler/brw_nir.h index 9ddf702f220..84d1ee081d3 100644 --- a/src/intel/compiler/brw_nir.h +++ b/src/intel/compiler/brw_nir.h @@ -270,6 +270,8 @@ nir_shader *brw_nir_create_passthrough_tcs(void *mem_ctx, const struct brw_compiler *compiler, const struct brw_tcs_prog_key *key); +bool brw_nir_pulls_at_sample(nir_shader *shader); + #define BRW_NIR_FRAG_OUTPUT_INDEX_SHIFT 0 #define BRW_NIR_FRAG_OUTPUT_INDEX_MASK INTEL_MASK(0, 0) #define BRW_NIR_FRAG_OUTPUT_LOCATION_SHIFT 1