gl_rasterization_rules lumps too many different flags.
Reviewed-by: Brian Paul <brianp@vmware.com>
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);
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;
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 );
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 );
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 );
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) {
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)
Whether the rasterizer should use (0.5, 0.5) pixel centers. When not set,
the rasterizer will use (0, 0) for pixel centers.
+clip_halfz
+ When true clip space in the z axis goes from [0..1] (D3D). When false
+ [-1, 1] (GL)
+
depth_clip
When false, the near and far depth clipping planes of the view volume are
disabled and the depth value will be clamped at the per-pixel level, after
*/
unsigned depth_clip:1;
+ /**
+ * When true clip space in the z axis goes from [0..1] (D3D). When false
+ * [-1, 1] (GL).
+ */
+ unsigned clip_halfz:1;
+
/**
* Enable bits for clipping half-spaces.
* This applies to both user clip planes and shader clip distances.