zink: rework swapchain object check for acquires
this is more accurate Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
This commit is contained in:
committed by
Marge Bot
parent
a2c9cc7200
commit
ce9cbeee33
@@ -293,7 +293,7 @@ zink_blit(struct pipe_context *pctx,
|
||||
struct zink_resource *src = zink_resource(info->src.resource);
|
||||
struct zink_resource *dst = zink_resource(info->dst.resource);
|
||||
bool needs_present_readback = false;
|
||||
if (dst->obj->dt)
|
||||
if (zink_is_swapchain(dst))
|
||||
zink_kopper_acquire(ctx, dst, UINT64_MAX);
|
||||
|
||||
if (src_desc == dst_desc ||
|
||||
|
||||
@@ -154,7 +154,7 @@ clear_color_no_rp(struct zink_context *ctx, struct zink_resource *res, const uni
|
||||
color.uint32[2] = pcolor->ui[2];
|
||||
color.uint32[3] = pcolor->ui[3];
|
||||
|
||||
if (res->obj->dt)
|
||||
if (zink_is_swapchain(res))
|
||||
zink_kopper_acquire(ctx, res, UINT64_MAX);
|
||||
if (zink_resource_image_needs_barrier(res, VK_IMAGE_LAYOUT_GENERAL, 0, 0) &&
|
||||
zink_resource_image_needs_barrier(res, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 0, 0))
|
||||
|
||||
@@ -806,7 +806,7 @@ zink_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *pres,
|
||||
templ.u.tex.last_layer = state->u.tex.last_layer;
|
||||
}
|
||||
|
||||
if (res->obj->dt)
|
||||
if (zink_is_swapchain(res))
|
||||
zink_kopper_acquire(ctx, res, UINT64_MAX);
|
||||
|
||||
ivci = create_ivci(screen, res, &templ, state->target);
|
||||
@@ -2160,7 +2160,7 @@ setup_framebuffer(struct zink_context *ctx)
|
||||
if (!ctx->fb_state.cbufs[i])
|
||||
continue;
|
||||
struct zink_resource *res = zink_resource(ctx->fb_state.cbufs[i]->texture);
|
||||
if (res->obj->dt) {
|
||||
if (zink_is_swapchain(res)) {
|
||||
has_swapchain = true;
|
||||
zink_kopper_acquire(ctx, res, UINT64_MAX);
|
||||
zink_surface_swapchain_update(ctx, zink_csurface(ctx->fb_state.cbufs[i]));
|
||||
@@ -2199,7 +2199,7 @@ prep_fb_attachment(struct zink_context *ctx, struct zink_surface *surf, unsigned
|
||||
|
||||
VkAccessFlags access;
|
||||
VkPipelineStageFlags pipeline;
|
||||
if (res->obj->dt) {
|
||||
if (zink_is_swapchain(res)) {
|
||||
zink_kopper_acquire(ctx, res, UINT64_MAX);
|
||||
zink_surface_swapchain_update(ctx, surf);
|
||||
if (!i)
|
||||
@@ -2652,7 +2652,7 @@ unbind_fb_surface(struct zink_context *ctx, struct pipe_surface *surf, unsigned
|
||||
struct zink_resource *res = zink_resource(surf->texture);
|
||||
if (changed) {
|
||||
if (zink_fb_clear_enabled(ctx, idx)) {
|
||||
if (res->obj->dt) {
|
||||
if (zink_is_swapchain(res)) {
|
||||
zink_kopper_acquire(ctx, res, UINT64_MAX);
|
||||
zink_surface_swapchain_update(ctx, zink_csurface(surf));
|
||||
}
|
||||
@@ -3511,12 +3511,12 @@ zink_copy_image_buffer(struct zink_context *ctx, struct zink_resource *dst, stru
|
||||
bool buf2img = buf == src;
|
||||
|
||||
if (buf2img) {
|
||||
if (img->obj->dt)
|
||||
if (zink_is_swapchain(img))
|
||||
zink_kopper_acquire(ctx, img, UINT64_MAX);
|
||||
zink_resource_image_barrier(ctx, img, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 0, 0);
|
||||
zink_resource_buffer_barrier(ctx, buf, VK_ACCESS_TRANSFER_READ_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
|
||||
} else {
|
||||
if (img->obj->dt)
|
||||
if (zink_is_swapchain(img))
|
||||
zink_kopper_acquire_readback(ctx, img);
|
||||
zink_resource_image_barrier(ctx, img, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, 0, 0);
|
||||
zink_resource_buffer_barrier(ctx, buf, VK_ACCESS_TRANSFER_WRITE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
|
||||
|
||||
Reference in New Issue
Block a user