Mesa (main): lavapipe: fix dynamic patchControlPoints

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 2 14:05:37 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Jun  1 16:25:58 2022 -0400

lavapipe: fix dynamic patchControlPoints

the dynamic state value is independent of whether tesselation is used

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16824>

---

 src/gallium/frontends/lavapipe/lvp_execute.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c
index 3983bda698c..10875cb0945 100644
--- a/src/gallium/frontends/lavapipe/lvp_execute.c
+++ b/src/gallium/frontends/lavapipe/lvp_execute.c
@@ -898,13 +898,14 @@ static void handle_graphics_pipeline(struct vk_cmd_queue_entry *cmd,
          state->info.primitive_restart = ia->primitiveRestartEnable;
    }
 
-   if (pipeline->graphics_create_info.pTessellationState) {
-      if (!dynamic_states[conv_dynamic_state_idx(VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT)]) {
+   if (!dynamic_states[conv_dynamic_state_idx(VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT)]) {
+      if (pipeline->graphics_create_info.pTessellationState) {
          const VkPipelineTessellationStateCreateInfo *ts = pipeline->graphics_create_info.pTessellationState;
          state->patch_vertices = ts->patchControlPoints;
+      } else {
+         state->patch_vertices = 0;
       }
-   } else
-      state->patch_vertices = 0;
+   }
 
    bool halfz_changed = false;
    if (!pipeline->negative_one_to_one != clip_halfz) {



More information about the mesa-commit mailing list