Mesa (main): panvk: Ignore point size for !points

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 2 13:28:48 UTC 2022


Module: Mesa
Branch: main
Commit: 9d84caa4d5876e85c43aa8f7d38256bfdce59798
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d84caa4d5876e85c43aa8f7d38256bfdce59798

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Mon Apr 25 12:24:04 2022 -0400

panvk: Ignore point size for !points

Otherwise wide lines break. The alternative approach is to eliminate the points
writes when not drawing points since we do have topology information at compile
time. I'm admittedly stuck in my GL mindset. That's the approach we'll need for
Valhall anyway.

Fixes dEQP-VK.rasterization.interpolation.basic.lines_wide

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16204>

---

 src/panfrost/ci/deqp-panfrost-g52-vk.toml |  1 +
 src/panfrost/vulkan/panvk_vX_cmd_buffer.c |  2 +-
 src/panfrost/vulkan/panvk_vX_pipeline.c   | 13 +++++++++++--
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/panfrost/ci/deqp-panfrost-g52-vk.toml b/src/panfrost/ci/deqp-panfrost-g52-vk.toml
index 1f33d7b24df..c47fa2f493d 100644
--- a/src/panfrost/ci/deqp-panfrost-g52-vk.toml
+++ b/src/panfrost/ci/deqp-panfrost-g52-vk.toml
@@ -24,6 +24,7 @@ include = [
     "dEQP-VK.image.load_store.with_format.*",
     "dEQP-VK.pipeline.input_assembly.*",
     "dEQP-VK.pipeline.sampler.view_type.*.format.r*.address_modes.all_mode_clamp_to_border*",
+    "dEQP-VK.rasterization.interpolation.*",
     "dEQP-VK.spirv_assembly.instruction.compute.opquantize.*",
     "dEQP-VK.spirv_assembly.instruction.compute.shader_default_output.*",
     "dEQP-VK.spirv_assembly.instruction.compute.workgroup_memory.*",
diff --git a/src/panfrost/vulkan/panvk_vX_cmd_buffer.c b/src/panfrost/vulkan/panvk_vX_cmd_buffer.c
index 37f1606ce09..a15ebb5dea8 100644
--- a/src/panfrost/vulkan/panvk_vX_cmd_buffer.c
+++ b/src/panfrost/vulkan/panvk_vX_cmd_buffer.c
@@ -661,7 +661,7 @@ panvk_draw_prepare_varyings(struct panvk_cmd_buffer *cmdbuf,
                        varyings->varying[VARYING_SLOT_POS].offset;
    }
 
-   if (BITSET_TEST(varyings->active, VARYING_SLOT_PSIZ)) {
+   if (pipeline->ia.writes_point_size) {
       draw->psiz = varyings->buf[varyings->varying[VARYING_SLOT_PSIZ].buf].address +
                        varyings->varying[VARYING_SLOT_POS].offset;
    } else if (pipeline->ia.topology == MALI_DRAW_MODE_LINES ||
diff --git a/src/panfrost/vulkan/panvk_vX_pipeline.c b/src/panfrost/vulkan/panvk_vX_pipeline.c
index e4568fd14a5..880f698dbf2 100644
--- a/src/panfrost/vulkan/panvk_vX_pipeline.c
+++ b/src/panfrost/vulkan/panvk_vX_pipeline.c
@@ -338,8 +338,17 @@ panvk_pipeline_builder_init_shaders(struct panvk_pipeline_builder *builder,
       if (shader->has_img_access)
          pipeline->img_access_mask |= BITFIELD_BIT(i);
 
-      if (i == MESA_SHADER_VERTEX && shader->info.vs.writes_point_size)
-         pipeline->ia.writes_point_size = true;
+      if (i == MESA_SHADER_VERTEX && shader->info.vs.writes_point_size) {
+         VkPrimitiveTopology topology =
+            builder->create_info.gfx->pInputAssemblyState->topology;
+         bool points = (topology == VK_PRIMITIVE_TOPOLOGY_POINT_LIST);
+
+         /* Even if the vertex shader writes point size, we only consider the
+          * pipeline to write point size when we're actually drawing points.
+          * Otherwise the point size write would conflict with wide lines.
+          */
+         pipeline->ia.writes_point_size = points;
+      }
 
       mali_ptr shader_ptr = 0;
 



More information about the mesa-commit mailing list