u_blitter: fix fs used when no color emitted
authorDave Airlie <airlied@gmail.com>
Thu, 24 Dec 2020 02:58:48 +0000 (12:58 +1000)
committerMarge Bot <eric+marge@anholt.net>
Thu, 10 Jun 2021 02:37:19 +0000 (02:37 +0000)
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11280>

src/gallium/auxiliary/util/u_blitter.c

index 42bbd47..265b6e3 100644 (file)
@@ -1502,8 +1502,6 @@ static void util_blitter_clear_custom(struct blitter_context *blitter,
    sr.ref_value[0] = stencil & 0xff;
    pipe->set_stencil_ref(pipe, sr);
 
-   bind_fs_write_all_cbufs(ctx);
-
    union blitter_attrib attrib;
    memcpy(attrib.color, color->ui, sizeof(color->ui));
 
@@ -1511,6 +1509,11 @@ static void util_blitter_clear_custom(struct blitter_context *blitter,
    enum blitter_attrib_type type = pass_generic ? UTIL_BLITTER_ATTRIB_COLOR :
                                                   UTIL_BLITTER_ATTRIB_NONE;
 
+   if (pass_generic)
+      bind_fs_write_all_cbufs(ctx);
+   else
+      bind_fs_empty(ctx);
+
    if (num_layers > 1 && ctx->has_layered) {
       blitter_get_vs_func get_vs = get_vs_layered;