zink: more accurately track supported blits
We don't care if blits need to respect render-conditions if there's no
active one. So let's hit the potentially faster native blit-paths
instead.
Fixes: 5743fa6e70
("zink: enable conditional rendering if available")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3792
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7606>
This commit is contained in:
parent
465a48a048
commit
19906022e2
|
@ -14,8 +14,11 @@ blit_resolve(struct zink_context *ctx, const struct pipe_blit_info *info)
|
||||||
util_format_get_mask(info->src.format) != info->mask ||
|
util_format_get_mask(info->src.format) != info->mask ||
|
||||||
util_format_is_depth_or_stencil(info->dst.format) ||
|
util_format_is_depth_or_stencil(info->dst.format) ||
|
||||||
info->scissor_enable ||
|
info->scissor_enable ||
|
||||||
info->alpha_blend ||
|
info->alpha_blend)
|
||||||
info->render_condition_enable)
|
return false;
|
||||||
|
|
||||||
|
if (info->render_condition_enable &&
|
||||||
|
ctx->render_condition_active)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
struct zink_resource *src = zink_resource(info->src.resource);
|
struct zink_resource *src = zink_resource(info->src.resource);
|
||||||
|
@ -67,8 +70,11 @@ blit_native(struct zink_context *ctx, const struct pipe_blit_info *info)
|
||||||
if (util_format_get_mask(info->dst.format) != info->mask ||
|
if (util_format_get_mask(info->dst.format) != info->mask ||
|
||||||
util_format_get_mask(info->src.format) != info->mask ||
|
util_format_get_mask(info->src.format) != info->mask ||
|
||||||
info->scissor_enable ||
|
info->scissor_enable ||
|
||||||
info->alpha_blend ||
|
info->alpha_blend)
|
||||||
info->render_condition_enable)
|
return false;
|
||||||
|
|
||||||
|
if (info->render_condition_enable &&
|
||||||
|
ctx->render_condition_active)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (util_format_is_depth_or_stencil(info->dst.format) &&
|
if (util_format_is_depth_or_stencil(info->dst.format) &&
|
||||||
|
|
|
@ -130,7 +130,7 @@ struct zink_context {
|
||||||
|
|
||||||
struct list_head suspended_queries;
|
struct list_head suspended_queries;
|
||||||
struct list_head primitives_generated_queries;
|
struct list_head primitives_generated_queries;
|
||||||
bool queries_disabled;
|
bool queries_disabled, render_condition_active;
|
||||||
|
|
||||||
struct pipe_resource *dummy_buffer;
|
struct pipe_resource *dummy_buffer;
|
||||||
struct pipe_resource *null_buffers[5]; /* used to create zink_framebuffer->null_surface, one buffer per samplecount */
|
struct pipe_resource *null_buffers[5]; /* used to create zink_framebuffer->null_surface, one buffer per samplecount */
|
||||||
|
|
|
@ -492,6 +492,7 @@ zink_render_condition(struct pipe_context *pctx,
|
||||||
|
|
||||||
if (query == NULL) {
|
if (query == NULL) {
|
||||||
screen->vk_CmdEndConditionalRenderingEXT(batch->cmdbuf);
|
screen->vk_CmdEndConditionalRenderingEXT(batch->cmdbuf);
|
||||||
|
ctx->render_condition_active = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,6 +529,7 @@ zink_render_condition(struct pipe_context *pctx,
|
||||||
begin_info.buffer = res->buffer;
|
begin_info.buffer = res->buffer;
|
||||||
begin_info.flags = begin_flags;
|
begin_info.flags = begin_flags;
|
||||||
screen->vk_CmdBeginConditionalRenderingEXT(batch->cmdbuf, &begin_info);
|
screen->vk_CmdBeginConditionalRenderingEXT(batch->cmdbuf, &begin_info);
|
||||||
|
ctx->render_condition_active = true;
|
||||||
|
|
||||||
zink_batch_reference_resource_rw(batch, res, true);
|
zink_batch_reference_resource_rw(batch, res, true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue