Mesa (7.10): draw/llvm: don't flush in vs_llvm_delete()
Brian Paul
brianp at kemper.freedesktop.org
Tue Dec 14 23:32:18 UTC 2010
Module: Mesa
Branch: 7.10
Commit: d50e8b2276d16b9d57733e9d96f597ecbd6d4306
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d50e8b2276d16b9d57733e9d96f597ecbd6d4306
Author: Brian Paul <brianp at vmware.com>
Date: Tue Dec 14 16:28:41 2010 -0700
draw/llvm: don't flush in vs_llvm_delete()
Fixes piglit glx-shader-sharing crash.
When shaders are shared by multiple contexts, the shader's draw context
pointer may point to a previously destroyed context. Dereferencing the
context pointer will lead to a crash.
In this case, simply removing the flushing code avoids the crash (the
exec and sse shader paths don't flush here either).
There's a deeper issue here, however, that needs examination. Shaders
should not keep pointers to contexts since contexts might get destroyed
at any time.
NOTE: This is a candidate for the 7.10 branch (after this has been
tested for a while).
(cherry picked from commit becc4bb90c46f754018ac596460e6c6a650d399c)
---
src/gallium/auxiliary/draw/draw_vs_llvm.c | 12 ------------
1 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/src/gallium/auxiliary/draw/draw_vs_llvm.c b/src/gallium/auxiliary/draw/draw_vs_llvm.c
index fa9992d..de074be 100644
--- a/src/gallium/auxiliary/draw/draw_vs_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_vs_llvm.c
@@ -65,19 +65,7 @@ static void
vs_llvm_delete( struct draw_vertex_shader *dvs )
{
struct llvm_vertex_shader *shader = llvm_vertex_shader(dvs);
- struct pipe_fence_handle *fence = NULL;
struct draw_llvm_variant_list_item *li;
- struct pipe_context *pipe = dvs->draw->pipe;
-
- /*
- * XXX: This might be not neccessary at all.
- */
- pipe->flush(pipe, 0, &fence);
- if (fence) {
- pipe->screen->fence_finish(pipe->screen, fence, 0);
- pipe->screen->fence_reference(pipe->screen, &fence, NULL);
- }
-
li = first_elem(&shader->variants);
while(!at_end(&shader->variants, li)) {
More information about the mesa-commit
mailing list