From 0bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72c Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 14 May 2010 13:04:42 +0100 Subject: gallium: convert rasterizer state to use gl-style front/back concepts Use front/back instead of cw/ccw throughout. Also, use offset_point/line/fill instead of offset_cw/ccw. Brings gallium representation of this state into line with its main user, and also what turns out to be the most common hardware representation. This fixes a long-standing bias in the interface towards the architecture of the software rasterizer. --- src/gallium/drivers/i915/i915_state.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/gallium/drivers/i915') diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index f883883852..cd963e4df7 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -686,17 +686,23 @@ i915_create_rasterizer_state(struct pipe_context *pipe, else cso->sc[0] = _3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT; - switch (rasterizer->cull_mode) { - case PIPE_WINDING_NONE: + switch (rasterizer->cull_face) { + case PIPE_FACE_NONE: cso->LIS4 |= S4_CULLMODE_NONE; break; - case PIPE_WINDING_CW: - cso->LIS4 |= S4_CULLMODE_CW; + case PIPE_FACE_FRONT: + if (rasterizer->front_ccw) + cso->LIS4 |= S4_CULLMODE_CCW; + else + cso->LIS4 |= S4_CULLMODE_CW; break; - case PIPE_WINDING_CCW: - cso->LIS4 |= S4_CULLMODE_CCW; + case PIPE_FACE_BACK: + if (rasterizer->front_ccw) + cso->LIS4 |= S4_CULLMODE_CW; + else + cso->LIS4 |= S4_CULLMODE_CCW; break; - case PIPE_WINDING_BOTH: + case PIPE_FACE_FRONT_AND_BACK: cso->LIS4 |= S4_CULLMODE_BOTH; break; } -- cgit v1.2.3