diff options
author | Aapo Tahkola <[email protected]> | 2005-05-14 17:41:57 +0000 |
---|---|---|
committer | Aapo Tahkola <[email protected]> | 2005-05-14 17:41:57 +0000 |
commit | aca2e0da3cd1e394673913b2a02ab85396a368a2 (patch) | |
tree | 916b6bbc83bfe361649adbdc37223079aee778b1 /src/mesa/drivers/dri/r300 | |
parent | d5084d42d4b91b5f5c368673d95f729b5cbb590f (diff) |
Make gleans polyoffset test happy.
Diffstat (limited to 'src/mesa/drivers/dri/r300')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_state.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 16077560965..b1c1bdef237 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -975,9 +975,18 @@ static void r300DepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval) static void r300PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units) { r300ContextPtr rmesa = R300_CONTEXT(ctx); - GLfloat constant = units * /*rmesa->state.depth.scale*/4; + GLfloat constant = units; + + switch (ctx->Visual.depthBits) { + case 16: + constant *= 4.0; + break; + case 24: + constant *= 2.0; + break; + } - factor *= 12; + factor *= 12.0; /* fprintf(stderr, "%s f:%f u:%f\n", __FUNCTION__, factor, constant); */ |