Mesa (main): lavapipe: store the geometry shader prim type to render state

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 5 07:41:39 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Jul  2 10:36:04 2021 -0400

lavapipe: store the geometry shader prim type to render state

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

---

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

diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c
index b9ee469b502..c88b9dca738 100644
--- a/src/gallium/frontends/lavapipe/lvp_execute.c
+++ b/src/gallium/frontends/lavapipe/lvp_execute.c
@@ -45,6 +45,12 @@
 
 #define DOUBLE_EQ(a, b) (fabs((a) - (b)) < DBL_EPSILON)
 
+enum gs_output {
+  GS_OUTPUT_NONE,
+  GS_OUTPUT_NOT_LINES,
+  GS_OUTPUT_LINES,
+};
+
 struct rendering_state {
    struct pipe_context *pctx;
    struct cso_context *cso;
@@ -110,6 +116,7 @@ struct rendering_state {
    int num_shader_buffers[PIPE_SHADER_TYPES];
    bool iv_dirty[PIPE_SHADER_TYPES];
    bool sb_dirty[PIPE_SHADER_TYPES];
+   enum gs_output gs_output_lines : 2;
    void *ss_cso[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
    void *velems_cso;
 
@@ -381,6 +388,7 @@ static void handle_graphics_pipeline(struct lvp_cmd_buffer_entry *cmd,
       state->pctx->bind_tcs_state(state->pctx, NULL);
    if (state->pctx->bind_tes_state)
       state->pctx->bind_tes_state(state->pctx, NULL);
+   state->gs_output_lines = GS_OUTPUT_NONE;
    {
       int i;
       for (i = 0; i < pipeline->graphics_create_info.stageCount; i++) {
@@ -396,6 +404,7 @@ static void handle_graphics_pipeline(struct lvp_cmd_buffer_entry *cmd,
             break;
          case VK_SHADER_STAGE_GEOMETRY_BIT:
             state->pctx->bind_gs_state(state->pctx, pipeline->shader_cso[PIPE_SHADER_GEOMETRY]);
+            state->gs_output_lines = pipeline->gs_output_lines ? GS_OUTPUT_LINES : GS_OUTPUT_NOT_LINES;
             has_stage[PIPE_SHADER_GEOMETRY] = true;
             break;
          case VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT:



More information about the mesa-commit mailing list