mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 17:10:11 +01:00
zink: always set sampler layouts when unbinding fb images while rp optimizing
this may or may not always be accurate, but in the cases where it is, it should avoid some renderpass splitting, and in the cases where it isn't, there may already be issues Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
This commit is contained in:
parent
c2b3c7b6be
commit
e83513832b
1 changed files with 8 additions and 0 deletions
|
|
@ -3268,6 +3268,14 @@ unbind_fb_surface(struct zink_context *ctx, struct pipe_surface *surf, unsigned
|
|||
res->fb_binds &= ~BITFIELD_BIT(idx);
|
||||
/* 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->tc && zink_screen(ctx->base.screen)->driver_workarounds.track_renderpasses && !ctx->blitting) {
|
||||
if (!(res->base.b.bind & PIPE_BIND_DISPLAY_TARGET) && util_format_is_depth_or_stencil(surf->format))
|
||||
/* assume that all depth buffers which are not swapchain images will be used for sampling to avoid splitting renderpasses */
|
||||
zink_screen(ctx->base.screen)->image_barrier(ctx, res, VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, VK_ACCESS_SHADER_READ_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
|
||||
if (!zink_is_swapchain(res) && !util_format_is_depth_or_stencil(surf->format))
|
||||
/* assume that all color buffers which are not swapchain images will be used for sampling to avoid splitting renderpasses */
|
||||
zink_screen(ctx->base.screen)->image_barrier(ctx, res, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_ACCESS_SHADER_READ_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
|
||||
}
|
||||
if (res->sampler_bind_count[0]) {
|
||||
update_res_sampler_layouts(ctx, res);
|
||||
if (res->layout != VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL && !ctx->blitting)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue