zink: add debug assert to verify that zink_clear_framebuffer() is accurate

this should never be called for buffers that don't have pending clears

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10705>
This commit is contained in:
Mike Blumenkrantz 2021-04-08 13:47:12 -04:00 committed by Marge Bot
parent 5ac6c70214
commit b0c51cdc9e

View file

@ -252,6 +252,12 @@ zink_clear_framebuffer(struct zink_context *ctx, unsigned clear_buffers)
{
unsigned to_clear = 0;
struct pipe_framebuffer_state *fb_state = &ctx->fb_state;
#ifndef NDEBUG
assert(!(clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) || zink_fb_clear_enabled(ctx, PIPE_MAX_COLOR_BUFS));
for (int i = 0; i < fb_state->nr_cbufs && clear_buffers >= PIPE_CLEAR_COLOR0; i++) {
assert(!(clear_buffers & (PIPE_CLEAR_COLOR0 << i)) || zink_fb_clear_enabled(ctx, i));
}
#endif
while (clear_buffers) {
struct zink_framebuffer_clear *color_clear = NULL;
struct zink_framebuffer_clear *zs_clear = NULL;