zink: zink_resource_barrier -> zink_resource_image_barrier
need this namespace Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
This commit is contained in:
parent
55a0eb6e0a
commit
6cbd25c04b
|
@ -81,7 +81,7 @@ clear_in_rp(struct pipe_context *pctx,
|
|||
++num_attachments;
|
||||
struct zink_resource *res = (struct zink_resource*)fb->cbufs[i]->texture;
|
||||
if (zink_resource_image_needs_barrier(res, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, 0, 0))
|
||||
zink_resource_barrier(zink_batch_no_rp(ctx), res, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, 0, 0);
|
||||
zink_resource_image_barrier(zink_batch_no_rp(ctx), res, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, 0, 0);
|
||||
resources[res_count++] = res;
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ clear_in_rp(struct pipe_context *pctx,
|
|||
++num_attachments;
|
||||
struct zink_resource *res = (struct zink_resource*)fb->zsbuf->texture;
|
||||
if (zink_resource_image_needs_barrier(res, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 0, 0))
|
||||
zink_resource_barrier(zink_batch_no_rp(ctx), res, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 0, 0);
|
||||
zink_resource_image_barrier(zink_batch_no_rp(ctx), res, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 0, 0);
|
||||
resources[res_count++] = res;
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ clear_color_no_rp(struct zink_batch *batch, struct zink_resource *res, const uni
|
|||
|
||||
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))
|
||||
zink_resource_barrier(batch, res, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 0, 0);
|
||||
zink_resource_image_barrier(batch, res, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 0, 0);
|
||||
zink_batch_reference_resource_rw(batch, res, true);
|
||||
vkCmdClearColorImage(batch->cmdbuf, res->image, res->layout, &color, 1, &range);
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ clear_zs_no_rp(struct zink_batch *batch, struct zink_resource *res, VkImageAspec
|
|||
|
||||
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))
|
||||
zink_resource_barrier(batch, res, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 0, 0);
|
||||
zink_resource_image_barrier(batch, res, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 0, 0);
|
||||
zink_batch_reference_resource_rw(batch, res, true);
|
||||
vkCmdClearDepthStencilImage(batch->cmdbuf, res->image, res->layout, &zs_value, 1, &range);
|
||||
}
|
||||
|
|
|
@ -809,14 +809,14 @@ framebuffer_state_buffer_barriers_setup(struct zink_context *ctx,
|
|||
surf = ctx->framebuffer->null_surface;
|
||||
struct zink_resource *res = zink_resource(surf->texture);
|
||||
if (res->layout != VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL)
|
||||
zink_resource_barrier(batch, res,
|
||||
zink_resource_image_barrier(batch, res,
|
||||
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, 0, 0);
|
||||
}
|
||||
|
||||
if (state->zsbuf) {
|
||||
struct zink_resource *res = zink_resource(state->zsbuf->texture);
|
||||
if (res->layout != VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL)
|
||||
zink_resource_barrier(batch, res,
|
||||
zink_resource_image_barrier(batch, res,
|
||||
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 0, 0);
|
||||
}
|
||||
}
|
||||
|
@ -1089,7 +1089,7 @@ zink_resource_image_needs_barrier(struct zink_resource *res, VkImageLayout new_l
|
|||
}
|
||||
|
||||
void
|
||||
zink_resource_barrier(struct zink_batch *batch, struct zink_resource *res,
|
||||
zink_resource_image_barrier(struct zink_batch *batch, struct zink_resource *res,
|
||||
VkImageLayout new_layout, VkAccessFlags flags, VkPipelineStageFlags pipeline)
|
||||
{
|
||||
assert(!batch->in_rp);
|
||||
|
|
|
@ -220,7 +220,7 @@ zink_resource_buffer_barrier(struct zink_batch *batch, struct zink_resource *res
|
|||
bool
|
||||
zink_resource_image_needs_barrier(struct zink_resource *res, VkImageLayout new_layout, VkAccessFlags flags, VkPipelineStageFlags pipeline);
|
||||
void
|
||||
zink_resource_barrier(struct zink_batch *batch, struct zink_resource *res,
|
||||
zink_resource_image_barrier(struct zink_batch *batch, struct zink_resource *res,
|
||||
VkImageLayout new_layout, VkAccessFlags flags, VkPipelineStageFlags pipeline);
|
||||
|
||||
bool
|
||||
|
|
|
@ -501,7 +501,7 @@ update_descriptors(struct zink_context *ctx, struct zink_screen *screen, bool is
|
|||
zink_resource_buffer_barrier(batch, transitions[i].res,
|
||||
transitions[i].access, transitions[i].stage);
|
||||
else
|
||||
zink_resource_barrier(batch, transitions[i].res,
|
||||
zink_resource_image_barrier(batch, transitions[i].res,
|
||||
transitions[i].layout, transitions[i].access, transitions[i].stage);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -449,12 +449,12 @@ zink_transfer_copy_bufimage(struct zink_context *ctx,
|
|||
|
||||
if (buf2img) {
|
||||
if (res->layout != VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL) {
|
||||
zink_resource_barrier(batch, res,
|
||||
zink_resource_image_barrier(batch, res,
|
||||
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 0, 0);
|
||||
}
|
||||
} else {
|
||||
if (res->layout != VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL) {
|
||||
zink_resource_barrier(batch, res,
|
||||
zink_resource_image_barrier(batch, res,
|
||||
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, 0, 0);
|
||||
}
|
||||
}
|
||||
|
@ -757,15 +757,16 @@ zink_resource_setup_transfer_layouts(struct zink_batch *batch, struct zink_resou
|
|||
* VK_IMAGE_LAYOUT_GENERAL. And since this isn't a present-related
|
||||
* operation, VK_IMAGE_LAYOUT_GENERAL seems most appropriate.
|
||||
*/
|
||||
zink_resource_barrier(batch, src,
|
||||
VK_IMAGE_LAYOUT_GENERAL, 0, VK_PIPELINE_STAGE_TRANSFER_BIT);
|
||||
if (src->layout != VK_IMAGE_LAYOUT_GENERAL)
|
||||
zink_resource_image_barrier(batch, src,
|
||||
VK_IMAGE_LAYOUT_GENERAL, 0, VK_PIPELINE_STAGE_TRANSFER_BIT);
|
||||
} else {
|
||||
if (src->layout != VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL)
|
||||
zink_resource_barrier(batch, src,
|
||||
zink_resource_image_barrier(batch, src,
|
||||
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, 0, VK_PIPELINE_STAGE_TRANSFER_BIT);
|
||||
|
||||
if (dst->layout != VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL)
|
||||
zink_resource_barrier(batch, dst,
|
||||
zink_resource_image_barrier(batch, dst,
|
||||
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 0, VK_PIPELINE_STAGE_TRANSFER_BIT);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue