summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2013-04-20 12:24:44 +0100
committerJosé Fonseca <[email protected]>2013-04-22 18:39:06 +0100
commit7c1bf8e381b914f88335686cc6561f89dcca9ae5 (patch)
tree2756bb32139586088e1e58c624e47f097373ddd5 /src/gallium/auxiliary
parent95c83824e6c3740781d1e9f7ce6a5fbe839d0457 (diff)
gallium: Add a new clip_halfz rasterizer state.
gl_rasterization_rules lumps too many different flags. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/draw/draw_context.c1
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c2
-rw-r--r--src/gallium/auxiliary/draw/draw_pt.h2
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c9
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c9
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_post_vs.c20
6 files changed, 19 insertions, 24 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index 0f98021247a..5272951d2b3 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -712,6 +712,7 @@ draw_get_rasterizer_no_cull( struct draw_context *draw,
rast.flatshade = flatshade;
rast.front_ccw = 1;
rast.gl_rasterization_rules = draw->rasterizer->gl_rasterization_rules;
+ rast.clip_halfz = draw->rasterizer->clip_halfz;
draw->rasterizer_no_cull[scissor][flatshade] =
pipe->create_rasterizer_state(pipe, &rast);
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index e0c07057441..e1c08c6b58d 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -1669,7 +1669,7 @@ draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store)
key->clip_z = llvm->draw->clip_z;
key->clip_user = llvm->draw->clip_user;
key->bypass_viewport = llvm->draw->identity_viewport;
- key->clip_halfz = !llvm->draw->rasterizer->gl_rasterization_rules;
+ key->clip_halfz = llvm->draw->rasterizer->clip_halfz;
key->need_edgeflags = (llvm->draw->vs.edgeflag_output ? TRUE : FALSE);
key->ucp_enable = llvm->draw->rasterizer->clip_plane_enable;
key->has_gs = llvm->draw->gs.geometry_shader != NULL;
diff --git a/src/gallium/auxiliary/draw/draw_pt.h b/src/gallium/auxiliary/draw/draw_pt.h
index 764d3111755..dca836859cc 100644
--- a/src/gallium/auxiliary/draw/draw_pt.h
+++ b/src/gallium/auxiliary/draw/draw_pt.h
@@ -233,7 +233,7 @@ void draw_pt_post_vs_prepare( struct pt_post_vs *pvs,
boolean clip_user,
boolean guard_band,
boolean bypass_viewport,
- boolean opengl,
+ boolean clip_halfz,
boolean need_edgeflags );
struct pt_post_vs *draw_pt_post_vs_create( struct draw_context *draw );
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
index ab32a8033ac..664c5949e8c 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
@@ -107,17 +107,14 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle,
vs->info.num_inputs,
fpme->vertex_size,
instance_id_index );
- /* XXX: it's not really gl rasterization rules we care about here,
- * but gl vs dx9 clip spaces.
- */
draw_pt_post_vs_prepare( fpme->post_vs,
draw->clip_xy,
draw->clip_z,
draw->clip_user,
draw->guard_band_xy,
- draw->identity_viewport,
- (boolean)draw->rasterizer->gl_rasterization_rules,
- (draw->vs.edgeflag_output ? TRUE : FALSE) );
+ draw->identity_viewport,
+ draw->rasterizer->clip_halfz,
+ (draw->vs.edgeflag_output ? TRUE : FALSE) );
draw_pt_so_emit_prepare( fpme->so_emit, FALSE );
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
index 31bd7ce734d..7ce845ed7da 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
@@ -158,17 +158,14 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
fpme->vertex_size = sizeof(struct vertex_header) + nr * 4 * sizeof(float);
- /* XXX: it's not really gl rasterization rules we care about here,
- * but gl vs dx9 clip spaces.
- */
draw_pt_post_vs_prepare( fpme->post_vs,
draw->clip_xy,
draw->clip_z,
draw->clip_user,
draw->guard_band_xy,
- draw->identity_viewport,
- (boolean)draw->rasterizer->gl_rasterization_rules,
- (draw->vs.edgeflag_output ? TRUE : FALSE) );
+ draw->identity_viewport,
+ draw->rasterizer->clip_halfz,
+ (draw->vs.edgeflag_output ? TRUE : FALSE) );
draw_pt_so_emit_prepare( fpme->so_emit, gs == NULL );
diff --git a/src/gallium/auxiliary/draw/draw_pt_post_vs.c b/src/gallium/auxiliary/draw/draw_pt_post_vs.c
index a83bb59a748..021265633f7 100644
--- a/src/gallium/auxiliary/draw/draw_pt_post_vs.c
+++ b/src/gallium/auxiliary/draw/draw_pt_post_vs.c
@@ -127,14 +127,14 @@ void draw_pt_post_vs_prepare( struct pt_post_vs *pvs,
boolean clip_user,
boolean guard_band,
boolean bypass_viewport,
- boolean opengl,
+ boolean clip_halfz,
boolean need_edgeflags )
{
pvs->flags = 0;
/* This combination not currently tested/in use:
*/
- if (opengl)
+ if (!clip_halfz)
guard_band = FALSE;
if (clip_xy && !guard_band) {
@@ -152,14 +152,14 @@ void draw_pt_post_vs_prepare( struct pt_post_vs *pvs,
ASSIGN_4V( pvs->draw->plane[3], 0, 0.5, 0, 1 );
}
- if (clip_z && opengl) {
- pvs->flags |= DO_CLIP_FULL_Z;
- ASSIGN_4V( pvs->draw->plane[4], 0, 0, 1, 1 );
- }
-
- if (clip_z && !opengl) {
- pvs->flags |= DO_CLIP_HALF_Z;
- ASSIGN_4V( pvs->draw->plane[4], 0, 0, 1, 0 );
+ if (clip_z) {
+ if (clip_halfz) {
+ pvs->flags |= DO_CLIP_HALF_Z;
+ ASSIGN_4V( pvs->draw->plane[4], 0, 0, 1, 0 );
+ } else {
+ pvs->flags |= DO_CLIP_FULL_Z;
+ ASSIGN_4V( pvs->draw->plane[4], 0, 0, 1, 1 );
+ }
}
if (clip_user)