v3dv: fix incorrect key setup
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 1 Aug 2023 09:43:15 +0000 (11:43 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 3 Aug 2023 06:32:40 +0000 (06:32 +0000)
We had this incorrectly included inside the body of loop over
the subpass attachments so when all attachments are unused we
would not set this correctly.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24396>

src/broadcom/vulkan/v3dv_pipeline.c

index 1518d13..eac5bbe 100644 (file)
@@ -1089,6 +1089,17 @@ pipeline_populate_v3d_fs_key(struct v3d_fs_key *key,
    key->is_points = (topology == MESA_PRIM_POINTS);
    key->is_lines = (topology >= MESA_PRIM_LINES &&
                     topology <= MESA_PRIM_LINE_STRIP);
+
+   if (key->is_points) {
+      /* This mask represents state for GL_ARB_point_sprite which is not
+       * relevant to Vulkan.
+       */
+      key->point_sprite_mask = 0;
+
+      /* Vulkan mandates upper left. */
+      key->point_coord_upper_left = true;
+   }
+
    key->has_gs = has_geometry_shader;
 
    const VkPipelineColorBlendStateCreateInfo *cb_info =
@@ -1165,16 +1176,6 @@ pipeline_populate_v3d_fs_key(struct v3d_fs_key *key,
          else if (util_format_is_pure_sint(fb_pipe_format))
             key->int_color_rb |= 1 << i;
       }
-
-      if (key->is_points) {
-         /* This mask represents state for GL_ARB_point_sprite which is not
-          * relevant to Vulkan.
-          */
-         key->point_sprite_mask = 0;
-
-         /* Vulkan mandates upper left. */
-         key->point_coord_upper_left = true;
-      }
    }
 }