From 40c5987ed84f9f0b8bb1f707bb13c1aafc39330a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 4 Jan 2012 11:52:30 +0000 Subject: draw/softpipe: add clip vertex support. (v2) softpipe always clipped using the position vector, however for unclipped vertices it stored the position in window coordinates, however when position and clipping are separated, we need to store the clip-space position and the clip-space vertex clip, so we can interpolate both separately. This means we have to take the clip space position and store it to use later. This allows softpipe to pass all the clip-vertex piglit tests. v2: fix llvm draw regression, the structure being passed into llvm needed updating, remove some hardcoded ints that should have been enums while there. Signed-off-by: Dave Airlie --- src/gallium/auxiliary/draw/draw_llvm.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/gallium/auxiliary/draw/draw_llvm.h') diff --git a/src/gallium/auxiliary/draw/draw_llvm.h b/src/gallium/auxiliary/draw/draw_llvm.h index edd1a08..31fc2db 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.h +++ b/src/gallium/auxiliary/draw/draw_llvm.h @@ -80,6 +80,7 @@ enum { enum { DRAW_JIT_VERTEX_VERTEX_ID = 0, DRAW_JIT_VERTEX_CLIP, + DRAW_JIT_VERTEX_PRE_CLIP_POS, DRAW_JIT_VERTEX_DATA }; @@ -123,13 +124,16 @@ struct draw_jit_context lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_CTX_TEXTURES, "textures") #define draw_jit_header_id(_gallivm, _ptr) \ - lp_build_struct_get_ptr(_gallivm, _ptr, 0, "id") + lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_VERTEX_VERTEX_ID, "id") #define draw_jit_header_clip(_gallivm, _ptr) \ - lp_build_struct_get_ptr(_gallivm, _ptr, 1, "clip") + lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_VERTEX_CLIP, "clip") + +#define draw_jit_header_pre_clip_pos(_gallivm, _ptr) \ + lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_VERTEX_PRE_CLIP_POS, "pre_clip_pos") #define draw_jit_header_data(_gallivm, _ptr) \ - lp_build_struct_get_ptr(_gallivm, _ptr, 2, "data") + lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_VERTEX_DATA, "data") #define draw_jit_vbuffer_stride(_gallivm, _ptr) \ -- cgit v1.1