[Mesa-dev] [PATCH 2/2] st/mesa: quick fix of CopyPixels with GL_DEPTH_STENCIL

Brian Paul brianp at vmware.com
Mon Nov 21 10:45:33 PST 2011


On 11/20/2011 07:08 AM, Marek Olšák wrote:
> This fixes:
> - depthstencil-default_fb-copypixels
> - fbo-depthstencil-GL_DEPTH24_STENCIL8-copypixels
> ---
>   src/mesa/state_tracker/st_cb_drawpixels.c |    7 +++++++
>   1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
> index 95805fd..912241b 100644
> --- a/src/mesa/state_tracker/st_cb_drawpixels.c
> +++ b/src/mesa/state_tracker/st_cb_drawpixels.c
> @@ -1441,6 +1441,13 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
>
>      st_validate_state(st);
>
> +   if (type == GL_DEPTH_STENCIL) {
> +      /* XXX make this more efficient */
> +      st_CopyPixels(ctx, srcx, srcy, width, height, dstx, dsty, GL_STENCIL);
> +      st_CopyPixels(ctx, srcx, srcy, width, height, dstx, dsty, GL_DEPTH);
> +      return;
> +   }
> +
>      if (type == GL_STENCIL) {
>         /* can't use texturing to do stencil */
>         copy_stencil_pixels(ctx, srcx, srcy, width, height, dstx, dsty);

Not pretty, but I guess that's better than being broken.

Hopefully someone can do a proper fix one of these days.

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list