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

Author: Karol Herbst <[email protected]>
Date:   Thu Jul 16 20:22:58 2020 +0200

st/mesa: fix st_CopyPixels without support for stencil exports

Fixes: f611af35948e ("st/mesa: use fragment shader to copy stencil buffer")

Signed-off-by: Karol Herbst <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5940>

---

 src/mesa/state_tracker/st_cb_drawpixels.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c 
b/src/mesa/state_tracker/st_cb_drawpixels.c
index 0537c6d24c8..366c324800f 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -1724,6 +1724,13 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint 
srcy,
       return;
    }
 
+   /* fallback if the driver can't do stencil exports */
+   if (type == GL_STENCIL &&
+       !pipe->screen->get_param(pipe->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) 
{
+      copy_stencil_pixels(ctx, srcx, srcy, width, height, dstx, dsty);
+      return;
+   }
+
    /*
     * The subsequent code implements glCopyPixels by copying the source
     * pixels into a temporary texture that's then applied to a textured quad.

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to