tu: DS primitive stride does not use patch control points
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 21 Sep 2022 12:38:21 +0000 (14:38 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 4 Oct 2022 15:39:43 +0000 (15:39 +0000)
Previously we would use patch control points if there was no GS, but
it wasn't immediately obvious that this driver param is unused if there
is no GS. Make it output 0 instead, making it clear that we can emit it
even if we don't know the patch control points. This change in the
cmdstream is split out from the next commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18773>

src/freedreno/vulkan/tu_pipeline.c

index eaacc37..804776e 100644 (file)
@@ -1772,13 +1772,11 @@ tu6_emit_geom_tess_consts(struct tu_cs *cs,
       uint32_t hs_param_dwords = MIN2((hs->constlen - hs_base) * 4, ARRAY_SIZE(hs_params));
       tu6_emit_const(cs, CP_LOAD_STATE6_GEOM, hs_base, SB6_HS_SHADER, 0,
                      hs_param_dwords, hs_params);
-      if (gs)
-         num_vertices = gs->gs.vertices_in;
 
       uint32_t ds_params[8] = {
-         ds->output_size * num_vertices * 4,  /* ds primitive stride */
-         ds->output_size * 4,                 /* ds vertex stride */
-         hs->output_size,                     /* hs vertex stride (dwords) */
+         gs ? ds->output_size * gs->gs.vertices_in * 4 : 0,  /* ds primitive stride */
+         ds->output_size * 4,                                /* ds vertex stride */
+         hs->output_size,                                    /* hs vertex stride (dwords) */
          hs->tess.tcs_vertices_out,
          tess_param_iova,
          tess_param_iova >> 32,
@@ -3978,7 +3976,6 @@ tu_pipeline_builder_parse_tessellation(struct tu_pipeline_builder *builder,
          vk_find_struct_const(tess_info->pNext, PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO);
    pipeline->tess.upper_left_domain_origin = !domain_info ||
          domain_info->domainOrigin == VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT;
-   const struct ir3_shader_variant *hs = builder->variants[MESA_SHADER_TESS_CTRL];
 }
 
 static void