diff options
author | Brian Paul <[email protected]> | 2011-09-30 08:15:30 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-09-30 08:15:30 -0600 |
commit | 4368a657670f1f3f13d8497f749cb5439f91529e (patch) | |
tree | 71965b364e065ee9cc360eb0a0e99cd3be0e7553 /src/mesa/state_tracker | |
parent | d742a64909b2b414fc94b6f525a13ce09ca7f9f7 (diff) |
mesa: simplify parameters to GetTexImage() driver hook
The target, level and texObj can be obtained through the texImage
parameter. We could make similar changes for the TexImage() hooks too.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 260df09f597..b4102478bf4 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -815,15 +815,14 @@ st_CompressedTexImage2D(struct gl_context *ctx, GLenum target, GLint level, * a textured quad. Store the results in the user's buffer. */ static void -decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level, +decompress_with_blit(struct gl_context * ctx, GLenum format, GLenum type, GLvoid *pixels, - struct gl_texture_object *texObj, struct gl_texture_image *texImage) { struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; struct st_texture_image *stImage = st_texture_image(texImage); - struct st_texture_object *stObj = st_texture_object(texObj); + struct st_texture_object *stObj = st_texture_object(texImage->TexObject); struct pipe_sampler_view *src_view = st_get_texture_sampler_view(stObj, pipe); const GLuint width = texImage->Width; @@ -848,7 +847,7 @@ decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level, } /* Choose the source mipmap level */ - src_view->u.tex.first_level = src_view->u.tex.last_level = level; + src_view->u.tex.first_level = src_view->u.tex.last_level = texImage->Level; /* blit/render/decompress */ util_blit_pixels_tex(st->blit, @@ -925,9 +924,8 @@ decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level, * Called via ctx->Driver.GetTexImage() */ static void -st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level, +st_GetTexImage(struct gl_context * ctx, GLenum format, GLenum type, GLvoid * pixels, - struct gl_texture_object *texObj, struct gl_texture_image *texImage) { struct st_texture_image *stImage = st_texture_image(texImage); @@ -938,12 +936,10 @@ st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level, * faster than using the fallback code in texcompress.c. * Note that we only expect RGBA formats (no Z/depth formats). */ - decompress_with_blit(ctx, target, level, format, type, pixels, - texObj, texImage); + decompress_with_blit(ctx, format, type, pixels, texImage); } else { - _mesa_get_teximage(ctx, target, level, format, type, pixels, - texObj, texImage); + _mesa_get_teximage(ctx, format, type, pixels, texImage); } } |