mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
zink: break out the fb unbind sampler barrier
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35476>
This commit is contained in:
parent
d8c1fdb644
commit
e5d1547f08
1 changed files with 14 additions and 7 deletions
|
|
@ -3770,6 +3770,19 @@ rebind_fb_state(struct zink_context *ctx, struct zink_resource *match_res, bool
|
|||
return rebind;
|
||||
}
|
||||
|
||||
static void
|
||||
pre_sync_transfer_barrier(struct zink_context *ctx, struct zink_resource *res)
|
||||
{
|
||||
struct zink_screen *screen = zink_screen(ctx->base.screen);
|
||||
VkImageLayout layout = screen->driver_workarounds.general_layout ? VK_IMAGE_LAYOUT_GENERAL :
|
||||
/* assume that all depth buffers which are not swapchain images will be used for sampling to avoid splitting renderpasses */
|
||||
!(res->base.b.bind & PIPE_BIND_DISPLAY_TARGET) && util_format_is_depth_or_stencil(res->base.b.format) ?
|
||||
VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL :
|
||||
/* assume that all color buffers which are not swapchain images will be used for sampling to avoid splitting renderpasses */
|
||||
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
|
||||
screen->image_barrier(ctx, res, layout, VK_ACCESS_SHADER_READ_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
|
||||
}
|
||||
|
||||
static void
|
||||
unbind_fb_surface(struct zink_context *ctx, struct pipe_surface *surf, unsigned idx, bool changed)
|
||||
{
|
||||
|
|
@ -3806,13 +3819,7 @@ unbind_fb_surface(struct zink_context *ctx, struct pipe_surface *surf, unsigned
|
|||
/* this is called just before the resource loses a reference, so a refcount==1 means the resource will be destroyed */
|
||||
if (!res->fb_bind_count && res->base.b.reference.count > 1) {
|
||||
if (ctx->track_renderpasses && !ctx->blitting) {
|
||||
VkImageLayout layout = general_layout ? VK_IMAGE_LAYOUT_GENERAL :
|
||||
/* assume that all depth buffers which are not swapchain images will be used for sampling to avoid splitting renderpasses */
|
||||
!(res->base.b.bind & PIPE_BIND_DISPLAY_TARGET) && util_format_is_depth_or_stencil(surf->format) ?
|
||||
VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL :
|
||||
/* assume that all color buffers which are not swapchain images will be used for sampling to avoid splitting renderpasses */
|
||||
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
|
||||
zink_screen(ctx->base.screen)->image_barrier(ctx, res, layout, VK_ACCESS_SHADER_READ_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
|
||||
pre_sync_transfer_barrier(ctx, res);
|
||||
}
|
||||
if (res->sampler_bind_count[0]) {
|
||||
update_res_sampler_layouts(ctx, res);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue