mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-14 22:00:28 +01:00
zink: reorder barrier util functions to set up barrier struct before batch
no functional changes Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
This commit is contained in:
parent
7cee75f143
commit
86e1e1dafd
1 changed files with 6 additions and 7 deletions
|
|
@ -1602,9 +1602,6 @@ zink_resource_image_barrier(struct zink_context *ctx, struct zink_batch *batch,
|
|||
flags = access_dst_flags(new_layout);
|
||||
if (!zink_resource_image_needs_barrier(res, new_layout, flags, pipeline))
|
||||
return;
|
||||
/* only barrier if we're changing layout or doing something besides read -> read */
|
||||
batch = zink_batch_no_rp(ctx);
|
||||
assert(!batch->in_rp);
|
||||
VkImageSubresourceRange isr = {
|
||||
res->aspect,
|
||||
0, VK_REMAINING_MIP_LEVELS,
|
||||
|
|
@ -1623,6 +1620,9 @@ zink_resource_image_barrier(struct zink_context *ctx, struct zink_batch *batch,
|
|||
res->obj->image,
|
||||
isr
|
||||
};
|
||||
/* only barrier if we're changing layout or doing something besides read -> read */
|
||||
batch = zink_batch_no_rp(ctx);
|
||||
assert(!batch->in_rp);
|
||||
vkCmdPipelineBarrier(
|
||||
batch->state->cmdbuf,
|
||||
res->access_stage ? res->access_stage : VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
|
||||
|
|
@ -1695,9 +1695,6 @@ zink_resource_buffer_barrier(struct zink_context *ctx, struct zink_batch *batch,
|
|||
pipeline = pipeline_access_stage(flags);
|
||||
if (!zink_resource_buffer_needs_barrier(res, flags, pipeline))
|
||||
return;
|
||||
/* only barrier if we're changing layout or doing something besides read -> read */
|
||||
batch = zink_batch_no_rp(ctx);
|
||||
assert(!batch->in_rp);
|
||||
VkBufferMemoryBarrier bmb = {
|
||||
VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
|
||||
NULL,
|
||||
|
|
@ -1709,7 +1706,9 @@ zink_resource_buffer_barrier(struct zink_context *ctx, struct zink_batch *batch,
|
|||
res->obj->offset,
|
||||
res->base.width0
|
||||
};
|
||||
|
||||
/* only barrier if we're changing layout or doing something besides read -> read */
|
||||
batch = zink_batch_no_rp(ctx);
|
||||
assert(!batch->in_rp);
|
||||
vkCmdPipelineBarrier(
|
||||
batch->state->cmdbuf,
|
||||
res->access_stage ? res->access_stage : pipeline_access_stage(res->access),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue