From f679ba562c89c1c5985f0504de30ea9d32334674 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 21 May 2021 06:29:54 -0400 Subject: [PATCH] util/vbuf: add flatshade_first to vbuf context and api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- 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);