Mesa (main): util/vbuf: add flatshade_first to vbuf context and api

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


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

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

util/vbuf: add flatshade_first to vbuf context and api

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10964>

---

 src/gallium/auxiliary/util/u_vbuf.c | 7 +++++++
 src/gallium/auxiliary/util/u_vbuf.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
index eed1c506641..9e5f2e2366e 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -152,6 +152,8 @@ struct u_vbuf {
    struct translate_cache *translate_cache;
    struct cso_cache cso_cache;
 
+   bool flatshade_first;
+
    /* This is what was set in set_vertex_buffers.
     * May contain user buffers. */
    struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
@@ -379,6 +381,11 @@ void u_vbuf_set_vertex_elements(struct u_vbuf *mgr,
    mgr->ve = u_vbuf_set_vertex_elements_internal(mgr, velems);
 }
 
+void u_vbuf_set_flatshade_first(struct u_vbuf *mgr, bool flatshade_first)
+{
+   mgr->flatshade_first = flatshade_first;
+}
+
 void u_vbuf_unset_vertex_elements(struct u_vbuf *mgr)
 {
    mgr->ve = NULL;
diff --git a/src/gallium/auxiliary/util/u_vbuf.h b/src/gallium/auxiliary/util/u_vbuf.h
index 70aaee71698..3ec93e662a7 100644
--- a/src/gallium/auxiliary/util/u_vbuf.h
+++ b/src/gallium/auxiliary/util/u_vbuf.h
@@ -71,6 +71,7 @@ u_vbuf_create(struct pipe_context *pipe, struct u_vbuf_caps *caps);
 void u_vbuf_destroy(struct u_vbuf *mgr);
 
 /* State and draw functions. */
+void u_vbuf_set_flatshade_first(struct u_vbuf *mgr, bool flatshade_first);
 void u_vbuf_set_vertex_elements(struct u_vbuf *mgr,
                                 const struct cso_velems_state *velems);
 void u_vbuf_unset_vertex_elements(struct u_vbuf *mgr);



More information about the mesa-commit mailing list