On Tue, Dec 13, 2011 at 1:53 PM, Eric Anholt <e...@anholt.net> wrote:
> The cool part was that in the "fbo-depthstencil -drawpixels
> GL_DEPTH24_STENCIL8 32F_24_8_REV" testcase, the shifting happened to
> end up with a value awfully close to the expected value, except for
> every other pixel being 0 (the stencil value, shifted away to
> nothing).
> ---
>  src/mesa/swrast/s_drawpix.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
> index b6c4337..7259881 100644
> --- a/src/mesa/swrast/s_drawpix.c
> +++ b/src/mesa/swrast/s_drawpix.c
> @@ -625,7 +625,8 @@ draw_depth_stencil_pixels(struct gl_context *ctx, GLint 
> x, GLint y,
>                                   GL_DEPTH_STENCIL_EXT, type, i, 0);
>
>          if (ctx->Depth.Mask) {
> -            if (!scaleOrBias && ctx->DrawBuffer->Visual.depthBits == 24) {
> +            if (!scaleOrBias && ctx->DrawBuffer->Visual.depthBits == 24 &&
> +               type == GL_UNSIGNED_INT_24_8) {
>                /* fast path 24-bit zbuffer */
>                GLuint zValues[MAX_WIDTH];
>                GLint j;
> @@ -639,7 +640,8 @@ draw_depth_stencil_pixels(struct gl_context *ctx, GLint 
> x, GLint y,
>                else
>                   depthRb->PutRow(ctx, depthRb, width, x, y + i, 
> zValues,NULL);
>             }
> -            else if (!scaleOrBias && ctx->DrawBuffer->Visual.depthBits == 
> 16) {
> +            else if (!scaleOrBias && ctx->DrawBuffer->Visual.depthBits == 16 
> &&
> +                    type == GL_UNSIGNED_INT_24_8) {
>                /* fast path 16-bit zbuffer */
>                GLushort zValues[MAX_WIDTH];
>                GLint j;

Reviewed-by: Brian Paul <bri...@vmware.com>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to