mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-01 22:00:26 +01:00
zink: create new transient image if the sample count doesn't match
otherwise this will keep reusing the previous transient cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39336>
This commit is contained in:
parent
957e19e8a7
commit
9fd8041d24
1 changed files with 2 additions and 1 deletions
|
|
@ -295,7 +295,7 @@ zink_create_transient_surface(struct zink_context *ctx, const struct pipe_surfac
|
|||
struct zink_resource *res = zink_resource(psurf->texture);
|
||||
struct zink_resource *transient = res->transient;
|
||||
assert(nr_samples > 1);
|
||||
if (!res->transient) {
|
||||
if (!res->transient || res->transient->base.b.nr_samples != nr_samples) {
|
||||
/* transient fb attachment: not cached */
|
||||
struct pipe_resource rtempl = *psurf->texture;
|
||||
rtempl.nr_samples = nr_samples;
|
||||
|
|
@ -303,6 +303,7 @@ zink_create_transient_surface(struct zink_context *ctx, const struct pipe_surfac
|
|||
rtempl.bind |= ZINK_BIND_TRANSIENT;
|
||||
if (zink_format_needs_mutable(rtempl.format, psurf->format, true))
|
||||
rtempl.bind |= ZINK_BIND_MUTABLE;
|
||||
zink_resource_reference(&res->transient, NULL);
|
||||
res->transient = zink_resource(ctx->base.screen->resource_create(ctx->base.screen, &rtempl));
|
||||
transient = res->transient;
|
||||
if (unlikely(!transient)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue