panvk: Ignore point size for !points
authorAlyssa Rosenzweig <alyssa@collabora.com>
Mon, 25 Apr 2022 16:24:04 +0000 (12:24 -0400)
committerMarge Bot <emma+marge@anholt.net>
Mon, 2 May 2022 13:12:31 +0000 (13:12 +0000)
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@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16204>

src/panfrost/ci/deqp-panfrost-g52-vk.toml
src/panfrost/vulkan/panvk_vX_cmd_buffer.c
src/panfrost/vulkan/panvk_vX_pipeline.c

index 1f33d7b..c47fa2f 100644 (file)
@@ -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.*",
index 37f1606..a15ebb5 100644 (file)
@@ -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 ||
index e4568fd..880f698 100644 (file)
@@ -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;