zink: break out ds3 state resetting

no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24894>
This commit is contained in:
Mike Blumenkrantz
2023-08-25 13:19:34 -04:00
committed by Marge Bot
parent 60b3090d5d
commit 87044cfe33
2 changed files with 22 additions and 13 deletions

View File

@@ -3221,6 +3221,24 @@ stall(struct zink_context *ctx)
zink_batch_reset_all(ctx);
}
void
zink_reset_ds3_states(struct zink_context *ctx)
{
struct zink_screen *screen = zink_screen(ctx->base.screen);
if (!screen->info.have_EXT_extended_dynamic_state3)
return;
if (screen->have_full_ds3)
ctx->ds3_states = UINT32_MAX;
else
ctx->ds3_states = BITFIELD_MASK(ZINK_DS3_BLEND_A2C);
if (!screen->info.dynamic_state3_feats.extendedDynamicState3AlphaToOneEnable)
ctx->ds3_states &= ~BITFIELD_BIT(ZINK_DS3_BLEND_A21);
if (!screen->info.dynamic_state3_feats.extendedDynamicState3LineStippleEnable)
ctx->ds3_states &= ~BITFIELD_BIT(ZINK_DS3_RAST_STIPPLE_ON);
if (screen->driver_workarounds.no_linestipple)
ctx->ds3_states &= ~BITFIELD_BIT(ZINK_DS3_RAST_STIPPLE);
}
static void
flush_batch(struct zink_context *ctx, bool sync)
{
@@ -3249,18 +3267,8 @@ flush_batch(struct zink_context *ctx, bool sync)
if (ctx->oom_stall)
stall(ctx);
if (screen->info.have_EXT_extended_dynamic_state3) {
if (screen->have_full_ds3)
ctx->ds3_states = UINT32_MAX;
else
ctx->ds3_states = BITFIELD_MASK(ZINK_DS3_BLEND_A2C);
if (!screen->info.dynamic_state3_feats.extendedDynamicState3AlphaToOneEnable)
ctx->ds3_states &= ~BITFIELD_BIT(ZINK_DS3_BLEND_A21);
if (!screen->info.dynamic_state3_feats.extendedDynamicState3LineStippleEnable)
ctx->ds3_states &= ~BITFIELD_BIT(ZINK_DS3_RAST_STIPPLE_ON);
if (screen->driver_workarounds.no_linestipple)
ctx->ds3_states &= ~BITFIELD_BIT(ZINK_DS3_RAST_STIPPLE);
}
zink_reset_ds3_states(ctx);
ctx->oom_flush = false;
ctx->oom_stall = false;
ctx->dd.bindless_bound = false;

View File

@@ -99,7 +99,8 @@ zink_fence_wait(struct pipe_context *ctx);
void
zink_wait_on_batch(struct zink_context *ctx, uint64_t batch_id);
void
zink_reset_ds3_states(struct zink_context *ctx);
bool
zink_check_batch_completion(struct zink_context *ctx, uint64_t batch_id);
VkCommandBuffer