diff options
author | Brian Paul <[email protected]> | 2011-12-15 16:30:33 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-12-16 12:14:27 -0700 |
commit | d77b963245fd286aecd6c04f7beb748ad22129cf (patch) | |
tree | 0fc8eab8873f99b1b65013258103f2060911bde1 /src/mesa/main/mipmap.h | |
parent | d842a118b26a56c9c5e4310f30f70199c42ea90e (diff) |
mesa: new _mesa_prepare_mipmap_level() function for mipmap generation
This helper function is used during mipmap generation to prepare space
for the destination mipmap levels.
This improves/fixes two things:
1. If the texture object was created with glTexStorage2D, calling
_mesa_TexImage2D() to allocate the new image would generate
INVALID_OPERATION since the texture is marked as immutable.
2. _mesa_TexImage2D() always frees any existing texture image memory
before allocating new memory. That's inefficient if the existing
image is the right size already.
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/mipmap.h')
-rw-r--r-- | src/mesa/main/mipmap.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/mipmap.h b/src/mesa/main/mipmap.h index 1fb9146a163..072794cb6ad 100644 --- a/src/mesa/main/mipmap.h +++ b/src/mesa/main/mipmap.h @@ -41,6 +41,12 @@ _mesa_generate_mipmap_level(GLenum target, GLint dstRowStride); +extern GLboolean +_mesa_prepare_mipmap_level(struct gl_context *ctx, + struct gl_texture_object *texObj, GLuint level, + GLsizei width, GLsizei height, GLsizei depth, + GLsizei border, GLenum intFormat, gl_format format); + extern void _mesa_generate_mipmap(struct gl_context *ctx, GLenum target, struct gl_texture_object *texObj); |