[Mesa-dev] [PATCH v2] mesa: add GL_UNSIGNED_INT_24_8 to _mesa_pack_depth_span

Iago Toral itoral at igalia.com
Thu Oct 8 00:49:54 PDT 2015


On Thu, 2015-10-08 at 09:50 +0300, Tapani Pälli wrote:
> Patch adds missing type (used with NV_read_depth) so that it gets
> handled correctly. This fixes errors seen with following CTS test:
> 
>    ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels
> 
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  src/mesa/main/pack.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
> index 00e31b0..89faf51 100644
> --- a/src/mesa/main/pack.c
> +++ b/src/mesa/main/pack.c
> @@ -1073,6 +1073,21 @@ _mesa_pack_depth_span( struct gl_context *ctx, GLuint n, GLvoid *dest,
>           }
>        }
>        break;
> +   case GL_UNSIGNED_INT_24_8:
> +      {
> +         const GLdouble scale = (GLdouble) 0xffffff;
> +         GLuint *dst = (GLuint *) dest;
> +         GLuint i;
> +         for (i = 0; i < n; i++) {
> +            GLuint z = (GLuint) (depthSpan[i] * scale);
> +            assert(z <= 0xffffff);
> +            dst[i] = (z << 8);
> +         }
> +         if (dstPacking->SwapBytes) {
> +            _mesa_swap4( (GLuint *) dst, n );
> +         }
> +         break;
> +      }

Looks good to me:

Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

>     case GL_UNSIGNED_INT:
>        {
>           GLuint *dst = (GLuint *) dest;




More information about the mesa-dev mailing list