[Mesa-dev] [PATCH 2/2] mesa: compute row stride outside of loop and fix MSVC compilation error

Jose Fonseca jfonseca at vmware.com
Thu Jan 8 13:23:51 PST 2015


On 08/01/15 21:10, Brian Paul wrote:
> Can't do void pointer arithmetic with MSVC.
> ---
>   src/mesa/main/teximage.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index e41ce32..b3c668f 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -3543,6 +3543,7 @@ texturesubimage(struct gl_context *ctx, GLuint dims,
>
>      /* Must handle special case GL_TEXTURE_CUBE_MAP. */
>      if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
> +      GLint rowStride;
>
>         /* Error checking */
>         if (texObj->NumLayers < 6) {
> @@ -3594,6 +3595,8 @@ texturesubimage(struct gl_context *ctx, GLuint dims,
>            return;
>         }
>
> +      rowStride = _mesa_image_image_stride(&ctx->Unpack, width, height,
> +                                           format, type);
>         /* Copy in each face. */
>         for (i = 0; i < 6; ++i) {
>            texImage = texObj->Image[i][level];
> @@ -3601,8 +3604,7 @@ texturesubimage(struct gl_context *ctx, GLuint dims,
>                                    level, xoffset, yoffset, zoffset,
>                                    width, height, 1, format,
>                                    type, pixels, true);
> -         pixels += _mesa_image_image_stride(&ctx->Unpack, width, height,
> -                                            format, type);
> +         pixels = (GLubyte *) pixels + rowStride;
>         }
>      }
>      else {
>


Looks good to me. Serie is

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>


More information about the mesa-dev mailing list