Mesa (main): zink: split out scissor flagging from framebuffer updating
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri May 20 16:58:32 UTC 2022
Module: Mesa
Branch: main
Commit: b25b8027e5e38217c4fa23fc3dfd5ca2a058fd96
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b25b8027e5e38217c4fa23fc3dfd5ca2a058fd96
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Wed May 11 10:54:33 2022 -0400
zink: split out scissor flagging from framebuffer updating
this is kinda similar but not actually the same thing
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476>
---
src/gallium/drivers/zink/zink_clear.c | 4 ++--
src/gallium/drivers/zink/zink_context.c | 6 ++++--
src/gallium/drivers/zink/zink_framebuffer.c | 4 +---
src/gallium/drivers/zink/zink_framebuffer.h | 2 +-
src/gallium/drivers/zink/zink_render_pass.c | 5 ++++-
5 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/gallium/drivers/zink/zink_clear.c b/src/gallium/drivers/zink/zink_clear.c
index 97d2baeb70a..c1fa0106431 100644
--- a/src/gallium/drivers/zink/zink_clear.c
+++ b/src/gallium/drivers/zink/zink_clear.c
@@ -533,7 +533,7 @@ zink_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *dst,
if (fb_changed) {
ctx->fb_state.width = dstx + width;
ctx->fb_state.height = dsty + height;
- zink_update_framebuffer_state(ctx, orig_width, orig_height);
+ ctx->fb_changed = true;
zink_batch_no_rp(ctx);
}
zink_clear(pctx, clear_flags, &scissor, NULL, depth, stencil);
@@ -541,7 +541,7 @@ zink_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *dst,
if (fb_changed) {
ctx->fb_state.width = orig_width;
ctx->fb_state.height = orig_height;
- zink_update_framebuffer_state(ctx, dstx + width, dsty + height);
+ ctx->fb_changed = true;
zink_batch_no_rp(ctx);
}
} else {
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index bdc28793902..260a6da7ac6 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -2351,7 +2351,7 @@ zink_set_color_write_enables(struct zink_context *ctx)
/* use dummy color buffers instead of the more sane option */
zink_batch_no_rp(ctx);
ctx->rp_changed = true;
- zink_update_framebuffer_state(ctx, ctx->fb_state.width, ctx->fb_state.height);
+ zink_update_framebuffer_state(ctx);
} else {
reapply_color_write(ctx);
}
@@ -2434,7 +2434,9 @@ zink_set_framebuffer_state(struct pipe_context *pctx,
}
rebind_fb_state(ctx, NULL, true);
ctx->fb_state.samples = MAX2(samples, 1);
- zink_update_framebuffer_state(ctx, w, h);
+ zink_update_framebuffer_state(ctx);
+ if (ctx->fb_state.width != w || ctx->fb_state.height != h)
+ ctx->scissor_changed = true;
uint8_t rast_samples = ctx->fb_state.samples - 1;
if (rast_samples != ctx->gfx_pipeline_state.rast_samples)
diff --git a/src/gallium/drivers/zink/zink_framebuffer.c b/src/gallium/drivers/zink/zink_framebuffer.c
index ec83d3e26fc..852c99bcb69 100644
--- a/src/gallium/drivers/zink/zink_framebuffer.c
+++ b/src/gallium/drivers/zink/zink_framebuffer.c
@@ -209,10 +209,8 @@ debug_describe_zink_framebuffer(char* buf, const struct zink_framebuffer *ptr)
}
void
-zink_update_framebuffer_state(struct zink_context *ctx, int old_w, int old_h)
+zink_update_framebuffer_state(struct zink_context *ctx)
{
- if (ctx->fb_state.width != old_w || ctx->fb_state.height != old_h)
- ctx->scissor_changed = true;
/* get_framebuffer adds a ref if the fb is reused or created;
* always do get_framebuffer first to avoid deleting the same fb
* we're about to use
diff --git a/src/gallium/drivers/zink/zink_framebuffer.h b/src/gallium/drivers/zink/zink_framebuffer.h
index 24d0dbf46d7..7544074e89b 100644
--- a/src/gallium/drivers/zink/zink_framebuffer.h
+++ b/src/gallium/drivers/zink/zink_framebuffer.h
@@ -86,5 +86,5 @@ struct zink_framebuffer *
zink_get_framebuffer(struct zink_context *ctx);
void
-zink_update_framebuffer_state(struct zink_context *ctx, int old_w, int old_h);
+zink_update_framebuffer_state(struct zink_context *ctx);
#endif
diff --git a/src/gallium/drivers/zink/zink_render_pass.c b/src/gallium/drivers/zink/zink_render_pass.c
index 6e330cb59c8..fecb93f345a 100644
--- a/src/gallium/drivers/zink/zink_render_pass.c
+++ b/src/gallium/drivers/zink/zink_render_pass.c
@@ -453,6 +453,7 @@ setup_framebuffer(struct zink_context *ctx)
if (!ctx->fb_changed)
return;
+ zink_update_framebuffer_state(ctx);
zink_init_framebuffer(screen, ctx->framebuffer, rp);
ctx->fb_changed = false;
ctx->gfx_pipeline_state.render_pass = rp;
@@ -677,7 +678,9 @@ zink_render_update_swapchain(struct zink_context *ctx)
ctx->fb_state.width = ctx->swapchain_size.width;
ctx->fb_state.height = ctx->swapchain_size.height;
zink_kopper_fixup_depth_buffer(ctx);
- zink_update_framebuffer_state(ctx, old_w, old_h);
+ if (ctx->fb_state.width != old_w || ctx->fb_state.height != old_h)
+ ctx->scissor_changed = true;
+ zink_update_framebuffer_state(ctx);
ctx->swapchain_size.width = ctx->swapchain_size.height = 0;
}
}
More information about the mesa-commit
mailing list