Mesa (main): lavapipe: don't read line stipple info in pipeline creation if stipple is disabled

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 16 22:23:55 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Jul 16 16:59:37 2021 -0400

lavapipe: don't read line stipple info in pipeline creation if stipple is disabled

otherwise these values may be (harmlessly) garbage

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

---

 src/gallium/frontends/lavapipe/lvp_pipeline.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c b/src/gallium/frontends/lavapipe/lvp_pipeline.c
index 11747abd982..0c1c30315c6 100644
--- a/src/gallium/frontends/lavapipe/lvp_pipeline.c
+++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c
@@ -816,9 +816,14 @@ lvp_graphics_pipeline_init(struct lvp_pipeline *pipeline,
       pipeline->disable_multisample = line_state->lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT ||
                                       line_state->lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT;
       pipeline->line_rectangular = line_state->lineRasterizationMode != VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT;
-      if (!dynamic_state_contains(pipeline->graphics_create_info.pDynamicState, VK_DYNAMIC_STATE_LINE_STIPPLE_EXT)) {
-         pipeline->line_stipple_factor = line_state->lineStippleFactor - 1;
-         pipeline->line_stipple_pattern = line_state->lineStipplePattern;
+      if (pipeline->line_stipple_enable) {
+         if (!dynamic_state_contains(pipeline->graphics_create_info.pDynamicState, VK_DYNAMIC_STATE_LINE_STIPPLE_EXT)) {
+            pipeline->line_stipple_factor = line_state->lineStippleFactor - 1;
+            pipeline->line_stipple_pattern = line_state->lineStipplePattern;
+         } else {
+            pipeline->line_stipple_factor = 0;
+            pipeline->line_stipple_pattern = UINT16_MAX;
+         }
       }
    } else
       pipeline->line_rectangular = true;



More information about the mesa-commit mailing list