mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
radv: add support for load_pixel_coord
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31864>
This commit is contained in:
parent
2f830f9b94
commit
a2a9e93e72
5 changed files with 9 additions and 2 deletions
|
|
@ -2107,6 +2107,7 @@ radv_consider_force_vrs(const struct radv_graphics_state_key *gfx_state, const s
|
|||
*/
|
||||
nir_shader *fs_shader = fs_stage->nir;
|
||||
if (fs_shader && (BITSET_TEST(fs_shader->info.system_values_read, SYSTEM_VALUE_FRAG_COORD) ||
|
||||
BITSET_TEST(fs_shader->info.system_values_read, SYSTEM_VALUE_PIXEL_COORD) ||
|
||||
fs_shader->info.fs.sample_interlock_ordered || fs_shader->info.fs.sample_interlock_unordered ||
|
||||
fs_shader->info.fs.pixel_interlock_ordered || fs_shader->info.fs.pixel_interlock_unordered)) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -3393,7 +3393,8 @@ radv_compute_spi_ps_input(const struct radv_physical_device *pdev, const struct
|
|||
S_0286CC_LINEAR_CENTROID_ENA(info->ps.reads_linear_centroid) |
|
||||
S_0286CC_LINEAR_SAMPLE_ENA(info->ps.reads_linear_sample) |
|
||||
S_0286CC_PERSP_PULL_MODEL_ENA(info->ps.reads_barycentric_model) |
|
||||
S_0286CC_FRONT_FACE_ENA(info->ps.reads_front_face);
|
||||
S_0286CC_FRONT_FACE_ENA(info->ps.reads_front_face) |
|
||||
S_0286CC_POS_FIXED_PT_ENA(info->ps.reads_pixel_coord);
|
||||
|
||||
if (info->ps.reads_frag_coord_mask || info->ps.reads_sample_pos_mask) {
|
||||
uint8_t mask = info->ps.reads_frag_coord_mask | info->ps.reads_sample_pos_mask;
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ declare_ps_input_vgprs(const struct radv_shader_info *info, struct radv_shader_a
|
|||
ac_add_arg(&args->ac, AC_ARG_VGPR, 1, AC_ARG_INT, &args->ac.front_face);
|
||||
ac_add_arg(&args->ac, AC_ARG_VGPR, 1, AC_ARG_INT, &args->ac.ancillary);
|
||||
ac_add_arg(&args->ac, AC_ARG_VGPR, 1, AC_ARG_INT, &args->ac.sample_coverage);
|
||||
ac_add_arg(&args->ac, AC_ARG_VGPR, 1, AC_ARG_INT, NULL); /* fixed pt */
|
||||
ac_add_arg(&args->ac, AC_ARG_VGPR, 1, AC_ARG_INT, &args->ac.pos_fixed_pt);
|
||||
|
||||
if (args->remap_spi_ps_input)
|
||||
ac_compact_ps_vgpr_args(&args->ac, info->ps.spi_ps_input_ena);
|
||||
|
|
|
|||
|
|
@ -270,6 +270,9 @@ gather_intrinsic_info(const nir_shader *nir, const nir_intrinsic_instr *instr, s
|
|||
}
|
||||
break;
|
||||
}
|
||||
case nir_intrinsic_load_pixel_coord:
|
||||
info->ps.reads_pixel_coord = true;
|
||||
break;
|
||||
case nir_intrinsic_load_frag_coord:
|
||||
info->ps.reads_frag_coord_mask |= nir_def_components_read(&instr->def);
|
||||
break;
|
||||
|
|
@ -963,6 +966,7 @@ gather_shader_info_fs(const struct radv_device *device, const nir_shader *nir,
|
|||
!(uses_persp_or_linear_interp || info->ps.needs_sample_positions || info->ps.reads_frag_shading_rate ||
|
||||
info->ps.writes_memory || nir->info.fs.needs_quad_helper_invocations ||
|
||||
BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_FRAG_COORD) ||
|
||||
BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_PIXEL_COORD) ||
|
||||
BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_POINT_COORD) ||
|
||||
BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_SAMPLE_ID) ||
|
||||
BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_SAMPLE_POS) ||
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ struct radv_shader_info {
|
|||
bool reads_linear_center;
|
||||
bool reads_linear_centroid;
|
||||
bool reads_fully_covered;
|
||||
bool reads_pixel_coord;
|
||||
uint8_t reads_frag_coord_mask;
|
||||
uint8_t reads_sample_pos_mask;
|
||||
uint8_t depth_layout;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue