From: Mike Blumenkrantz Date: Sat, 18 Jun 2022 13:47:13 +0000 (-0400) Subject: zink: collect gfx stages for all bindings during barrier generation X-Git-Tag: upstream/22.3.5~7168 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1fa3f03442bcf0ac0e8459ed48e3fd5d1371d32c;p=platform%2Fupstream%2Fmesa.git zink: collect gfx stages for all bindings during barrier generation it's important to get the full mask in order to accurately provide dependency info Acked-by: Dave Airlie Reviewed-By: Tatsuyuki Ishi Part-of: --- diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index 14d26c8..a8cbd84 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -367,16 +367,14 @@ update_barriers(struct zink_context *ctx, bool is_compute, if (!is_compute && res->vbo_bind_mask) { access |= VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT; pipeline |= VK_PIPELINE_STAGE_VERTEX_INPUT_BIT; - if (res->write_bind_count[is_compute]) - pipeline |= VK_PIPELINE_STAGE_VERTEX_SHADER_BIT; bind_count -= res->vbo_bind_count; } if (bind_count) access |= VK_ACCESS_SHADER_READ_BIT; - if (!res->write_bind_count[is_compute]) { + if (!is_compute) { pipeline |= find_pipeline_bits(res->ssbo_bind_mask); - if (res->ubo_bind_count[0]) + if (res->ubo_bind_count[0] && (pipeline & GFX_SHADER_BITS) != GFX_SHADER_BITS) pipeline |= find_pipeline_bits(res->ubo_bind_mask); } } else { @@ -391,10 +389,10 @@ update_barriers(struct zink_context *ctx, bool is_compute, VkPipelineStageFlags gfx_stages = pipeline & ~(VK_PIPELINE_STAGE_VERTEX_INPUT_BIT | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT); /* images always need gfx stages, and buffers need gfx stages if non-vbo binds exist */ bool needs_stages = !is_buffer || (res->bind_count[0] - res->vbo_bind_count > 0); - if (!gfx_stages && needs_stages) { - gfx_stages = find_pipeline_bits(res->sampler_binds); - if (!gfx_stages) //must be a shader image - gfx_stages = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT; + if (gfx_stages != GFX_SHADER_BITS && needs_stages) { + gfx_stages |= find_pipeline_bits(res->sampler_binds); + if (gfx_stages != GFX_SHADER_BITS) //must be a shader image + gfx_stages |= find_pipeline_bits(res->image_binds); pipeline |= gfx_stages; } }