summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common/driverfuncs.c
diff options
context:
space:
mode:
authorNeil Roberts <[email protected]>2014-06-10 16:21:21 +0100
committerNeil Roberts <[email protected]>2014-07-23 11:50:38 +0100
commit0779f37e1589b0ba4f1443a889f34dd83607c117 (patch)
tree871274c17a6b5c95ae1b22f601890171b4b6b230 /src/mesa/drivers/common/driverfuncs.c
parent05b52efbc977311c96ba31ac5fa2c95fe525d85e (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/driverfuncs.c')
-rw-r--r--src/mesa/drivers/common/driverfuncs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index 6ece5d80e1a..4f0f7a686ab 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -95,6 +95,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->TexImage = _mesa_store_teximage;
driver->TexSubImage = _mesa_store_texsubimage;
driver->GetTexImage = _mesa_meta_GetTexImage;
+ driver->ClearTexSubImage = _mesa_meta_ClearTexSubImage;
driver->CopyTexSubImage = _mesa_meta_CopyTexSubImage;
driver->GenerateMipmap = _mesa_meta_GenerateMipmap;
driver->TestProxyTexImage = _mesa_test_proxy_teximage;