diff options
author | Christoph Brill <[email protected]> | 2008-02-27 22:06:38 +0100 |
---|---|---|
committer | Christoph Brill <[email protected]> | 2008-02-27 22:06:38 +0100 |
commit | 00bc91ac647296575efec1612a66385563a6ce54 (patch) | |
tree | 2ed4be90451656f429468d7605cf7beac8a8e75d /src/mesa/drivers/dri/r300 | |
parent | 60c0f09abb9421de359cd92e094a943d650fc7fa (diff) |
r300: properly handle GL_POINT in glPolygonMode
Until now the polygon mode was completely turned of when you used
GL_POINT. For me it looked buggy to completely disable the polygon
mode for FrontMode and BackMode if any of these was GL_POINT.
Diffstat (limited to 'src/mesa/drivers/dri/r300')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_state.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index dc6a31e1301..42a1acfd1af 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -571,12 +571,16 @@ static void r300SetStencilState(GLcontext * ctx, GLboolean state) static void r300UpdatePolygonMode(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); - uint32_t hw_mode = 0; + uint32_t hw_mode = GA_POLY_MODE_DISABLE; + /* Only do something if a polygon mode is wanted, default is GL_FILL */ if (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) { GLenum f, b; + /* Handle GL_CW (clock wise and GL_CCW (counter clock wise) + * correctly by selecting the correct front and back face + */ if (ctx->Polygon.FrontFace == GL_CCW) { f = ctx->Polygon.FrontMode; b = ctx->Polygon.BackMode; @@ -585,14 +589,15 @@ static void r300UpdatePolygonMode(GLcontext * ctx) b = ctx->Polygon.FrontMode; } + /* Enable polygon mode */ hw_mode |= GA_POLY_MODE_DUAL; switch (f) { case GL_LINE: hw_mode |= GA_POLY_MODE_FRONT_PTYPE_LINE; break; - case GL_POINT: /* TODO: noops, find out why */ - hw_mode |= GA_POLY_MODE_DISABLE; + case GL_POINT: + hw_mode |= GA_POLY_MODE_FRONT_PTYPE_POINT; break; case GL_FILL: hw_mode |= GA_POLY_MODE_FRONT_PTYPE_TRI; @@ -603,8 +608,8 @@ static void r300UpdatePolygonMode(GLcontext * ctx) case GL_LINE: hw_mode |= GA_POLY_MODE_BACK_PTYPE_LINE; break; - case GL_POINT: /* TODO: noops, find out why */ - hw_mode |= GA_POLY_MODE_DISABLE; + case GL_POINT: + hw_mode |= GA_POLY_MODE_BACK_PTYPE_POINT; break; case GL_FILL: hw_mode |= GA_POLY_MODE_BACK_PTYPE_TRI; |