[Mesa-dev] [PATCH 06/10] mesa: Allow srcFormat=GL_DEPTH_STENCIL in _mesa_texstore_xx_xx() functions

Ian Romanick idr at freedesktop.org
Wed Apr 30 13:51:08 PDT 2014


On 03/21/2014 03:01 PM, Anuj Phogat wrote:
> _mesa_texstore_z24_s8() and _mesa_texstore_z32f_x24s8() are capable of
> handling GL_DEPTH_STENCIL format. So, allow it in both the functions.
> 
> Cc: <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  src/mesa/main/texstore.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
> index 704ea3f..c30f0de 100644
> --- a/src/mesa/main/texstore.c
> +++ b/src/mesa/main/texstore.c
> @@ -2483,7 +2483,8 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
>            srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
>  
>     if (srcFormat == GL_DEPTH_COMPONENT ||
> -       srcFormat == GL_STENCIL_INDEX) {
> +       srcFormat == GL_STENCIL_INDEX ||
> +       srcFormat == GL_DEPTH_STENCIL_EXT) {

You should use the undecorated name (just GL_DEPTH_STENCIL).

>        GLuint *depth = malloc(srcWidth * sizeof(GLuint));
>        GLubyte *stencil = malloc(srcWidth * sizeof(GLubyte));
>  
> @@ -3448,7 +3449,8 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
>            srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
>  
>     if (srcFormat == GL_DEPTH_COMPONENT ||
> -       srcFormat == GL_STENCIL_INDEX) {
> +       srcFormat == GL_STENCIL_INDEX ||
> +       srcFormat == GL_DEPTH_STENCIL_EXT) {
>        GLint img, row;
>        const GLint srcRowStride
>           = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType)
> 



More information about the mesa-dev mailing list