Mesa (main): aux/cso: store flatshade_first state from rasterizer
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jun 11 23:01:37 UTC 2021
Module: Mesa
Branch: main
Commit: ca5131638d9912868997fe1f0668be3bf2de93fc
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ca5131638d9912868997fe1f0668be3bf2de93fc
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Fri May 21 05:26:51 2021 -0400
aux/cso: store flatshade_first state from rasterizer
this is necessary for handling index rewriting
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10964>
---
src/gallium/auxiliary/cso_cache/cso_context.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index 99aeb6f2d99..8ab3d46858c 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -107,6 +107,7 @@ struct cso_context {
struct pipe_query *render_condition, *render_condition_saved;
uint render_condition_mode, render_condition_mode_saved;
boolean render_condition_cond, render_condition_cond_saved;
+ bool flatshade_first, flatshade_first_saved;
struct pipe_framebuffer_state fb, fb_saved;
struct pipe_viewport_state vp, vp_saved;
@@ -572,6 +573,7 @@ enum pipe_error cso_set_rasterizer(struct cso_context *ctx,
if (ctx->rasterizer != handle) {
ctx->rasterizer = handle;
+ ctx->flatshade_first = templ->flatshade_first;
ctx->pipe->bind_rasterizer_state(ctx->pipe, handle);
}
return PIPE_OK;
@@ -582,6 +584,7 @@ cso_save_rasterizer(struct cso_context *ctx)
{
assert(!ctx->rasterizer_saved);
ctx->rasterizer_saved = ctx->rasterizer;
+ ctx->flatshade_first_saved = ctx->flatshade_first;
}
static void
@@ -589,6 +592,7 @@ cso_restore_rasterizer(struct cso_context *ctx)
{
if (ctx->rasterizer != ctx->rasterizer_saved) {
ctx->rasterizer = ctx->rasterizer_saved;
+ ctx->flatshade_first = ctx->flatshade_first_saved;
ctx->pipe->bind_rasterizer_state(ctx->pipe, ctx->rasterizer_saved);
}
ctx->rasterizer_saved = NULL;
More information about the mesa-commit
mailing list