From 08c582ea6968b81aae08352188fb1f1d0d13d04d Mon Sep 17 00:00:00 2001 From: Vitaliy Triang3l Kuzmin Date: Sat, 3 Jun 2023 00:26:31 +0300 Subject: [PATCH] radv: Detect the use of Primitive Ordered Pixel Shading MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Samuel Pitoiset Reviewed-by: Timur Kristóf Signed-off-by: Vitaliy Triang3l Kuzmin Part-of: --- src/amd/vulkan/radv_shader.h | 2 ++ src/amd/vulkan/radv_shader_info.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 2759fda..0cf51d2 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -374,6 +374,8 @@ struct radv_shader_info { uint8_t reads_sample_pos_mask; uint8_t depth_layout; bool allow_flat_shading; + bool pops; /* Uses Primitive Ordered Pixel Shading (fragment shader interlock) */ + bool pops_is_per_sample; bool has_epilog; bool mrt0_is_dual_src; unsigned spi_ps_input; diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c index eb7607d..f8daad6 100644 --- a/src/amd/vulkan/radv_shader_info.c +++ b/src/amd/vulkan/radv_shader_info.c @@ -231,6 +231,9 @@ gather_intrinsic_info(const nir_shader *nir, const nir_intrinsic_instr *instr, s case nir_intrinsic_load_poly_line_smooth_enabled: info->ps.needs_poly_line_smooth = true; break; + case nir_intrinsic_begin_invocation_interlock: + info->ps.pops = true; + break; default: break; } @@ -587,6 +590,9 @@ gather_shader_info_fs(const struct radv_device *device, const nir_shader *nir, BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_SAMPLE_MASK_IN) || BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_HELPER_INVOCATION)); + info->ps.pops_is_per_sample = + info->ps.pops && (nir->info.fs.sample_interlock_ordered || nir->info.fs.sample_interlock_unordered); + info->ps.spi_ps_input = radv_compute_spi_ps_input(pipeline_key, info); info->ps.has_epilog = pipeline_key->ps.has_epilog && info->ps.colors_written; -- 2.7.4