Mesa (main): util/primconvert: add function for setting flatshade_first

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 11 23:01:37 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri May 21 06:28:33 2021 -0400

util/primconvert: add function for setting flatshade_first

this is the value that needs to be set, not the actual rasterizer state

original function preserved to avoid driver changes

Acked-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10964>

---

 src/gallium/auxiliary/indices/u_primconvert.c | 8 +++++++-
 src/gallium/auxiliary/indices/u_primconvert.h | 2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/indices/u_primconvert.c b/src/gallium/auxiliary/indices/u_primconvert.c
index 37d33aa5d6c..b18ddce6a68 100644
--- a/src/gallium/auxiliary/indices/u_primconvert.c
+++ b/src/gallium/auxiliary/indices/u_primconvert.c
@@ -88,12 +88,18 @@ void
 util_primconvert_save_rasterizer_state(struct primconvert_context *pc,
                                        const struct pipe_rasterizer_state
                                        *rast)
+{
+   util_primconvert_save_flatshade_first(pc, rast->flatshade_first);
+}
+
+void
+util_primconvert_save_flatshade_first(struct primconvert_context *pc, bool flatshade_first)
 {
    /* if we actually translated the provoking vertex for the buffer,
     * we would actually need to save/restore rasterizer state.  As
     * it is, we just need to make note of the pv.
     */
-   pc->api_pv = rast->flatshade_first ? PV_FIRST : PV_LAST;
+   pc->api_pv = flatshade_first ? PV_FIRST : PV_LAST;
 }
 
 void
diff --git a/src/gallium/auxiliary/indices/u_primconvert.h b/src/gallium/auxiliary/indices/u_primconvert.h
index 080c68a74e7..a4e8892b845 100644
--- a/src/gallium/auxiliary/indices/u_primconvert.h
+++ b/src/gallium/auxiliary/indices/u_primconvert.h
@@ -49,6 +49,8 @@ void util_primconvert_destroy(struct primconvert_context *pc);
 void util_primconvert_save_rasterizer_state(struct primconvert_context *pc,
                                             const struct pipe_rasterizer_state
                                             *rast);
+void
+util_primconvert_save_flatshade_first(struct primconvert_context *pc, bool flatshade_first);
 void util_primconvert_draw_vbo(struct primconvert_context *pc,
                                const struct pipe_draw_info *info,
                                unsigned drawid_offset,



More information about the mesa-commit mailing list