Mesa (master): draw/llvm: set draw->pt.user. planes field in draw_set_clip_state()

Brian Paul brianp at kemper.freedesktop.org
Tue Oct 11 13:41:55 UTC 2011


Module: Mesa
Branch: master
Commit: 11938c87a3e5a5b0a16b22f1913567a64015a92d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=11938c87a3e5a5b0a16b22f1913567a64015a92d

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Oct 10 17:49:27 2011 -0600

draw/llvm: set draw->pt.user.planes field in draw_set_clip_state()

Previously it was getting set in draw_set_mapped_constant_buffer() but
if there were no shader constants, that function wasn't called.  So the
pt.user.planes field was null and we died when we tried to access the
clip planes in the LLVM-generated code.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41663

Note: This is a candidate for the 7.11 branch.

Reviewed-by: José Fonseca <jfonseca at vmware.com>

---

 src/gallium/auxiliary/draw/draw_context.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index e1b9a15..a444793 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -292,6 +292,8 @@ void draw_set_clip_state( struct draw_context *draw,
    draw->nr_planes = 6 + clip->nr;
    draw->depth_clamp = clip->depth_clamp;
 
+   draw->pt.user.planes = (float (*) [DRAW_TOTAL_CLIP_PLANES][4]) &(draw->plane[0]);
+
    update_clip_flags(draw);
 }
 
@@ -369,7 +371,6 @@ draw_set_mapped_constant_buffer(struct draw_context *draw,
    case PIPE_SHADER_VERTEX:
       draw->pt.user.vs_constants[slot] = buffer;
       draw->pt.user.vs_constants_size[slot] = size;
-      draw->pt.user.planes = (float (*) [DRAW_TOTAL_CLIP_PLANES][4]) &(draw->plane[0]);
       draw_vs_set_constants(draw, slot, buffer, size);
       break;
    case PIPE_SHADER_GEOMETRY:




More information about the mesa-commit mailing list