From e693fc299f1f78502b9201f1e1e8f333566c9fb6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 21 Jul 2015 18:35:38 -0600 Subject: mesa: replace Driver.GetTexImage with GetTexSubImage() The new driver hook has x/y/zoffset and width/height/depth parameters for the new glGetTextureSubImage() function. The meta code and gallium state tracker are updated to handle the new parameters. Callers to Driver.GetTexSubImage() pass in offsets=0 and sizes equal to the whole texture size. v2: update i965 driver code, s/GLint/GLsizei/ in GetTexSubImage hook Reviewed-by: Ilia Mirkin --- src/mesa/main/texgetimage.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/mesa/main/texgetimage.c') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index de6db44ac26..a067aa57975 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -684,15 +684,17 @@ get_tex_memcpy(struct gl_context *ctx, GLenum format, GLenum type, /** - * This is the software fallback for Driver.GetTexImage(). + * This is the software fallback for Driver.GetTexSubImage(). * All error checking will have been done before this routine is called. * We'll call ctx->Driver.MapTextureImage() to access the data, then * unmap with ctx->Driver.UnmapTextureImage(). */ void -_mesa_GetTexImage_sw(struct gl_context *ctx, - GLenum format, GLenum type, GLvoid *pixels, - struct gl_texture_image *texImage) +_mesa_GetTexSubImage_sw(struct gl_context *ctx, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLint depth, + GLenum format, GLenum type, GLvoid *pixels, + struct gl_texture_image *texImage) { const GLuint dimensions = _mesa_get_texture_dimensions(texImage->TexObject->Target); @@ -1022,7 +1024,10 @@ _mesa_get_texture_image(struct gl_context *ctx, _mesa_lock_texture(ctx, texObj); { - ctx->Driver.GetTexImage(ctx, format, type, pixels, texImage); + ctx->Driver.GetTexSubImage(ctx, 0, 0, 0, + texImage->Width, texImage->Height, + texImage->Depth, + format, type, pixels, texImage); } _mesa_unlock_texture(ctx, texObj); } -- cgit v1.2.3