util/vbuf: add flatshade_first to vbuf context and api

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10964>
This commit is contained in:
Mike Blumenkrantz 2021-05-21 06:29:54 -04:00 committed by Marge Bot
parent 2432455390
commit f679ba562c
2 changed files with 8 additions and 0 deletions

View file

@ -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;

View file

@ -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);