Mesa (master): mesa/st: fix regression for basic drivers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 11 16:34:17 UTC 2021


Module: Mesa
Branch: master
Commit: eb2a4a7dee7c84cde44294f991ae731f88d19272
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=eb2a4a7dee7c84cde44294f991ae731f88d19272

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Fri Jan  8 11:25:34 2021 +0100

mesa/st: fix regression for basic drivers

Drivers that doesn't support conditional rendering can't really require
respecting conditional rendering, so let's not ask for it to be
respected in the first place.

This fixes a problem where util_can_blit_via_copy_region started
unconditionally rejecting all blits that originate from
glBlitFramebuffer, even for drivers where this can't possibly be a
problem.

Fixes: 767f70dfe13 ("gallium/util: fix util_can_blit_via_copy_region for conditional rendering")
Reviewed-by: Zoltán Böszörményi <zboszor at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8378>

---

 src/mesa/state_tracker/st_cb_blit.c | 2 +-
 src/mesa/state_tracker/st_context.c | 2 ++
 src/mesa/state_tracker/st_context.h | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c
index cf55eff6e5c..fd82a7f9dd1 100644
--- a/src/mesa/state_tracker/st_cb_blit.c
+++ b/src/mesa/state_tracker/st_cb_blit.c
@@ -170,7 +170,7 @@ st_BlitFramebuffer(struct gl_context *ctx,
       st_window_rectangles_to_blit(ctx, &blit);
 
    blit.filter = pFilter;
-   blit.render_condition_enable = TRUE;
+   blit.render_condition_enable = st->has_conditional_render;
    blit.alpha_blend = FALSE;
 
    if (mask & GL_COLOR_BUFFER_BIT) {
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 733a8e5ead6..cf4ae0aff26 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -709,6 +709,8 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
       !screen->get_param(screen, PIPE_CAP_CLIP_PLANES);
    st->prefer_real_buffer_in_constbuf0 =
       screen->get_param(screen, PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0);
+   st->has_conditional_render =
+      screen->get_param(screen, PIPE_CAP_CONDITIONAL_RENDER);
    st->allow_st_finalize_nir_twice = screen->finalize_nir != NULL;
 
    st->has_hw_atomics =
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index f694e5825a1..2f358bf302b 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -159,6 +159,7 @@ struct st_context
    boolean lower_two_sided_color;
    boolean lower_ucp;
    boolean prefer_real_buffer_in_constbuf0;
+   boolean has_conditional_render;
 
    /* There are consequences for drivers wanting to call st_finalize_nir
     * twice, once before shader caching and once after lowering for shader



More information about the mesa-commit mailing list