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@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10964>
This commit is contained in:
Mike Blumenkrantz 2021-05-21 06:28:33 -04:00 committed by Marge Bot
parent ca5131638d
commit 2432455390
2 changed files with 9 additions and 1 deletions

View file

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

View file

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