mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 21:20:12 +01:00
zink: fix framebuffer attachment usage asserts for dummy attachments
dummy attachments never overwrite existing attachments,
so they must be explicitly compared like this to avoid
erroneous crashing
Fixes: 3892c13381 ("zink: add an alternate path for EXT_color_write_enable usage")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16848>
This commit is contained in:
parent
e90fe826a2
commit
20427d01ac
1 changed files with 17 additions and 9 deletions
|
|
@ -405,7 +405,10 @@ get_render_pass(struct zink_context *ctx)
|
|||
state.num_rts++;
|
||||
}
|
||||
state.have_zsbuf = fb->zsbuf != NULL;
|
||||
assert(clears == ctx->rp_clears_enabled);
|
||||
if (zink_use_dummy_attachments(ctx))
|
||||
assert(clears == (ctx->rp_clears_enabled & PIPE_CLEAR_DEPTHSTENCIL));
|
||||
else
|
||||
assert(clears == ctx->rp_clears_enabled);
|
||||
state.clears = clears;
|
||||
uint32_t hash = hash_render_pass_state(&state);
|
||||
struct hash_entry *entry = _mesa_hash_table_search_pre_hashed(ctx->render_pass_cache, hash,
|
||||
|
|
@ -517,7 +520,7 @@ begin_render_pass(struct zink_context *ctx)
|
|||
uint32_t clear_validate = 0;
|
||||
for (int i = 0; i < fb_state->nr_cbufs; i++) {
|
||||
/* these are no-ops */
|
||||
if (!fb_state->cbufs[i] || !zink_fb_clear_enabled(ctx, i))
|
||||
if (!fb_state->cbufs[i] || !zink_fb_clear_enabled(ctx, i) || zink_use_dummy_attachments(ctx))
|
||||
continue;
|
||||
/* these need actual clear calls inside the rp */
|
||||
struct zink_framebuffer_clear_data *clear = zink_fb_clear_element(&ctx->fb_clears[i], 0);
|
||||
|
|
@ -569,13 +572,18 @@ begin_render_pass(struct zink_context *ctx)
|
|||
for (int i = 0; i < ctx->fb_state.nr_cbufs; i++) {
|
||||
if (ctx->fb_state.cbufs[i]) {
|
||||
struct zink_surface *surf = zink_csurface(ctx->fb_state.cbufs[i]);
|
||||
struct zink_surface *transient = zink_transient_surface(ctx->fb_state.cbufs[i]);
|
||||
if (surf->base.format == ctx->fb_state.cbufs[i]->format) {
|
||||
if (transient) {
|
||||
assert(zink_resource(transient->base.texture)->obj->vkusage == ctx->framebuffer->state.infos[i].usage);
|
||||
assert(zink_resource(surf->base.texture)->obj->vkusage == ctx->framebuffer->state.infos[cresolve_offset].usage);
|
||||
} else {
|
||||
assert(zink_resource(surf->base.texture)->obj->vkusage == ctx->framebuffer->state.infos[i].usage);
|
||||
if (zink_use_dummy_attachments(ctx)) {
|
||||
surf = zink_csurface(ctx->dummy_surface[util_logbase2_ceil(ctx->fb_state.samples)]);
|
||||
assert(zink_resource(surf->base.texture)->obj->vkusage == ctx->framebuffer->state.infos[i].usage);
|
||||
} else {
|
||||
struct zink_surface *transient = zink_transient_surface(&surf->base);
|
||||
if (surf->base.format == ctx->fb_state.cbufs[i]->format) {
|
||||
if (transient) {
|
||||
assert(zink_resource(transient->base.texture)->obj->vkusage == ctx->framebuffer->state.infos[i].usage);
|
||||
assert(zink_resource(surf->base.texture)->obj->vkusage == ctx->framebuffer->state.infos[cresolve_offset].usage);
|
||||
} else {
|
||||
assert(zink_resource(surf->base.texture)->obj->vkusage == ctx->framebuffer->state.infos[i].usage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue