summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOliver McFadden <z3ro.geek@gmail.com>2007-07-13 01:45:05 +0000
committerOliver McFadden <z3ro.geek@gmail.com>2007-07-13 04:51:36 +0000
commit08a005e076d4520f564881e4c7e54b47cc7e20c3 (patch)
tree73946d0b80f913c29e4c853c3436cd239292af2e /src
parent4b08b9c3e9da922d80aaff4720ed2dec026c012e (diff)
r300: Use a switch statement in r300UpdateCulling.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index 6e1eeb857a..d6f477bbf5 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -317,19 +317,34 @@ static void r300UpdateCulling(GLcontext * ctx)
r300ContextPtr r300 = R300_CONTEXT(ctx);
uint32_t val = 0;
- R300_STATECHANGE(r300, cul);
if (ctx->Polygon.CullFlag) {
- if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
- val = R300_CULL_FRONT | R300_CULL_BACK;
- else if (ctx->Polygon.CullFaceMode == GL_FRONT)
+ switch (ctx->Polygon.CullFaceMode) {
+ case GL_FRONT:
val = R300_CULL_FRONT;
- else
+ break;
+ case GL_BACK:
val = R300_CULL_BACK;
+ break;
+ case GL_FRONT_AND_BACK:
+ val = R300_CULL_FRONT | R300_CULL_BACK;
+ break;
+ default:
+ break;
+ }
}
- if (ctx->Polygon.FrontFace == GL_CW)
+
+ switch (ctx->Polygon.FrontFace) {
+ case GL_CW:
val |= R300_FRONT_FACE_CW;
- else
+ break;
+ case GL_CCW:
val |= R300_FRONT_FACE_CCW;
+ break;
+ default:
+ break;
+ }
+
+ R300_STATECHANGE(r300, cul);
r300->hw.cul.cmd[R300_CUL_CULL] = val;
}