st/mesa: fix st_CopyPixels without support for stencil exports

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

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5940>
This commit is contained in:
Karol Herbst
2020-07-16 20:22:58 +02:00
committed by Marge Bot
parent e7fd1ce9a2
commit c36aac542a

View File

@@ -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.