zink: add more rp cache asserts

ensure that any discrepencies are immediately detected

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9784>
This commit is contained in:
Mike Blumenkrantz
2020-12-09 16:16:57 -05:00
committed by Marge Bot
parent 7892b18acf
commit de9f04ca66

View File

@@ -1156,19 +1156,19 @@ get_render_pass(struct zink_context *ctx)
#ifndef NDEBUG
state.clears = clears;
#endif
uint32_t hash = hash_render_pass_state(&state);
struct hash_entry *entry = _mesa_hash_table_search_pre_hashed(ctx->render_pass_cache, hash,
&state);
if (!entry) {
struct zink_render_pass *rp;
struct zink_render_pass *rp;
if (entry) {
rp = entry->data;
assert(rp->state.clears == clears);
} else {
rp = zink_create_render_pass(screen, &state);
entry = _mesa_hash_table_insert_pre_hashed(ctx->render_pass_cache, hash, &rp->state, rp);
if (!entry)
if (!_mesa_hash_table_insert_pre_hashed(ctx->render_pass_cache, hash, &rp->state, rp))
return NULL;
}
return entry->data;
return rp;
}
static struct zink_framebuffer *