summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/common/meta_blit.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2015-11-05 14:44:26 -0800
committerIan Romanick <ian.d.romanick@intel.com>2015-11-24 11:31:30 -0800
commit76cfe2bc4436186fd585be96c4f402c1b1c79bdf (patch)
tree25cd575c22e5f408fa400cd8c664ec9da66f6fa1 /src/mesa/drivers/common/meta_blit.c
parenta222d4cbc3de49857aebbdf727e53c273abcc6c1 (diff)
meta: Don't pollute the buffer object namespace in _mesa_meta_DrawTex
tl;dr: For many types of GL object, we can *NEVER* use the Gen function. In OpenGL ES (all versions!) and OpenGL compatibility profile, applications don't have to call Gen functions. The GL spec is very clear about how you can mix-and-match generated names and non-generated names: you can use any name you want for a particular object type until you call the Gen function for that object type. Here's the problem scenario: - Application calls a meta function that generates a name. The first Gen will probably return 1. - Application decides to use the same name for an object of the same type without calling Gen. Many demo programs use names 1, 2, 3, etc. without calling Gen. - Application calls the meta function again, and the meta function replaces the data. The application's data is lost, and the app fails. Have fun debugging that. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363 Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Diffstat (limited to 'src/mesa/drivers/common/meta_blit.c')
-rw-r--r--src/mesa/drivers/common/meta_blit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c
index 37b06bcda40..c5faf61a36f 100644
--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -1006,13 +1006,12 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
}
void
-_mesa_meta_glsl_blit_cleanup(struct blit_state *blit)
+_mesa_meta_glsl_blit_cleanup(struct gl_context *ctx, struct blit_state *blit)
{
if (blit->VAO) {
_mesa_DeleteVertexArrays(1, &blit->VAO);
blit->VAO = 0;
- _mesa_DeleteBuffers(1, &blit->buf_obj->Name);
- blit->buf_obj = NULL;
+ _mesa_reference_buffer_object(ctx, &blit->buf_obj, NULL);
}
_mesa_meta_blit_shader_table_cleanup(&blit->shaders_with_depth);