diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2022-12-12 14:13:46 +0100 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2022-12-14 20:47:02 +0000 |
commit | a8911c50c81c025e733e7ff2c19b8275f827ff60 (patch) | |
tree | 517c367e5a20a9e0f35f1ddf7b6cc550faa90d25 | |
parent | a9b3fee4b037ff43ce957b0bddc5ed3b0a7d7952 (diff) | |
download | mesa-a8911c50c81c025e733e7ff2c19b8275f827ff60.tar.gz |
radv: do not remove the PointSize built-in for polygon mode as points
Determine if it can be removed when generating the graphics pipeline
key because of dynamic states.
Fixes new CTS dEQP-VK.rasterization.polygon_as_large_points.* and also
spec@!opengl 1.1@polygon-offset with Zink/RADV.
Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20073>
(cherry picked from commit b4f940913d386bad0e25a1e224d0f39631124593)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/amd/vulkan/radv_pipeline.c | 19 | ||||
-rw-r--r-- | src/amd/vulkan/radv_shader.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/zink/ci/zink-radv-fails.txt | 1 |
4 files changed, 12 insertions, 11 deletions
diff --git a/.pick_status.json b/.pick_status.json index 7000b3ef7c3..68507344f59 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -571,7 +571,7 @@ "description": "radv: do not remove the PointSize built-in for polygon mode as points", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index ee24e1c446e..db90a0f058a 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -2322,16 +2322,9 @@ radv_remove_point_size(const struct radv_pipeline_key *pipeline_key, if (producer->xfb_info) return; - /* Do not remove PSIZ for vertex shaders when the topology is unknown. */ - if (producer->info.stage == MESA_SHADER_VERTEX && - pipeline_key->vs.topology == V_008958_DI_PT_NONE) - return; - /* Do not remove PSIZ if the rasterization primitive uses points. */ if (consumer->info.stage == MESA_SHADER_FRAGMENT && - ((producer->info.stage == MESA_SHADER_VERTEX && - pipeline_key->vs.topology == V_008958_DI_PT_POINTLIST) || - (producer->info.stage == MESA_SHADER_TESS_EVAL && producer->info.tess.point_mode) || + ((producer->info.stage == MESA_SHADER_TESS_EVAL && producer->info.tess.point_mode) || (producer->info.stage == MESA_SHADER_GEOMETRY && producer->info.gs.output_primitive == SHADER_PRIM_POINTS) || (producer->info.stage == MESA_SHADER_MESH && @@ -2500,7 +2493,8 @@ radv_pipeline_link_shaders(const struct radv_device *device, /* Remove PSIZ from shaders when it's not needed. * This is typically produced by translation layers like Zink or D9VK. */ - radv_remove_point_size(pipeline_key, producer, consumer); + if (pipeline_key->enable_remove_point_size) + radv_remove_point_size(pipeline_key, producer, consumer); if (nir_link_opt_varyings(producer, consumer)) { nir_validate_shader(producer, "after nir_link_opt_varyings"); @@ -2960,6 +2954,13 @@ radv_generate_graphics_pipeline_key(const struct radv_graphics_pipeline *pipelin key.dynamic_rasterization_samples = !!(pipeline->active_stages & VK_SHADER_STAGE_FRAGMENT_BIT) && !state->ms; + if (!(pipeline->dynamic_states & RADV_DYNAMIC_PRIMITIVE_TOPOLOGY) && + state->ia && state->ia->primitive_topology != VK_PRIMITIVE_TOPOLOGY_POINT_LIST && + !(pipeline->dynamic_states & RADV_DYNAMIC_POLYGON_MODE) && + state->rs && state->rs->polygon_mode != VK_POLYGON_MODE_POINT) { + key.enable_remove_point_size = true; + } + return key; } diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 8d7d6df3948..0e3eeea9d6b 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -64,6 +64,7 @@ struct radv_pipeline_key { uint32_t primitives_generated_query : 1; uint32_t dynamic_patch_control_points : 1; uint32_t dynamic_rasterization_samples : 1; + uint32_t enable_remove_point_size : 1; struct { uint32_t instance_rate_inputs; diff --git a/src/gallium/drivers/zink/ci/zink-radv-fails.txt b/src/gallium/drivers/zink/ci/zink-radv-fails.txt index 2f268627846..2683aef9bcf 100644 --- a/src/gallium/drivers/zink/ci/zink-radv-fails.txt +++ b/src/gallium/drivers/zink/ci/zink-radv-fails.txt @@ -379,7 +379,6 @@ spec@!opengl 1.1@polygon-mode-offset@config 6: Expected blue pixel in center,Fai spec@!opengl 1.1@polygon-mode-offset@config 6: Expected white pixel on right edge,Fail spec@!opengl 1.1@polygon-mode-offset@config 6: Expected white pixel on top edge,Fail spec@!opengl 1.1@polygon-mode-offset,Fail -spec@!opengl 1.1@polygon-offset,Fail spec@!opengl 1.5@depth-tex-compare,Fail spec@!opengl 2.0@depth-tex-modes-glsl,Fail spec@!opengl 2.0@gl-2.0-edgeflag,Fail |