diff options
author | Neil Roberts <[email protected]> | 2014-06-10 16:21:21 +0100 |
---|---|---|
committer | Neil Roberts <[email protected]> | 2014-07-23 11:50:38 +0100 |
commit | 0779f37e1589b0ba4f1443a889f34dd83607c117 (patch) | |
tree | 871274c17a6b5c95ae1b22f601890171b4b6b230 /src/mesa/drivers/common/meta.h | |
parent | 05b52efbc977311c96ba31ac5fa2c95fe525d85e (diff) |
meta: Add a meta implementation of GL_ARB_clear_texture
Adds an implementation of the ClearTexSubImage driver entry point that tries
to set up an FBO to render to the texture and then calls glClearBuffer with a
scissor to perform the actual clear. If an FBO can't be created for the
texture then it will fall back to using _mesa_store_ClearTexSubImage.
When used in combination with _mesa_store_ClearTexSubImage this should provide
an implementation that works for all DRI-based drivers. However as this has
only been tested with the i965 driver it is currently only enabled there.
v2: Only enable the extension for the i965 driver instead of all DRI drivers.
Remove an unnecessary goto. Don't require GL_ARB_framebuffer_object. Add
some more comments.
v3: Use glClearBuffer* to avoid having to modify glClearColor and friends.
Handle sRGB textures. Explicitly disable dithering.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
Diffstat (limited to 'src/mesa/drivers/common/meta.h')
-rw-r--r-- | src/mesa/drivers/common/meta.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h index b8d992ce96f..b269dceedde 100644 --- a/src/mesa/drivers/common/meta.h +++ b/src/mesa/drivers/common/meta.h @@ -477,6 +477,13 @@ _mesa_meta_CopyTexSubImage(struct gl_context *ctx, GLuint dims, GLsizei width, GLsizei height); extern void +_mesa_meta_ClearTexSubImage(struct gl_context *ctx, + struct gl_texture_image *texImage, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + const GLvoid *clearValue); + +extern void _mesa_meta_GetTexImage(struct gl_context *ctx, GLenum format, GLenum type, GLvoid *pixels, struct gl_texture_image *texImage); |