summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i810
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-07-21 10:06:18 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-07-21 10:06:41 -0600
commitaf2aa8e9cf88a9ee3ec338eddc9a47bf2f142cb7 (patch)
tree39abc89e77ed3a102551d1c18bf11a13f2310fa6 /src/mesa/drivers/dri/i810
parent5842bc3bf9e33333b122ce7fd6bf108aab780111 (diff)
Remove ctx->Point._Size and ctx->Line._Width.
The clamping for these values depends on whether we're drawing AA or non-AA points, lines. Defer clamping until drawing time. Drivers could compute and keep clamped AA and clamped non-AA values if desired.
Diffstat (limited to 'src/mesa/drivers/dri/i810')
-rw-r--r--src/mesa/drivers/dri/i810/i810state.c10
-rw-r--r--src/mesa/drivers/dri/i810/i810tris.c4
2 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c
index 3ad25282d9..e0d5b2b487 100644
--- a/src/mesa/drivers/dri/i810/i810state.c
+++ b/src/mesa/drivers/dri/i810/i810state.c
@@ -380,7 +380,10 @@ static void i810CullFaceFrontFace(GLcontext *ctx, GLenum unused)
static void i810LineWidth( GLcontext *ctx, GLfloat widthf )
{
i810ContextPtr imesa = I810_CONTEXT( ctx );
- int width = (int)ctx->Line._Width;
+ /* AA, non-AA limits are same */
+ const int width = (int) CLAMP(ctx->Line.Width,
+ ctx->Const.MinLineWidth,
+ ctx->Const.MaxLineWidth);
imesa->LcsLineWidth = 0;
if (width & 1) imesa->LcsLineWidth |= LCS_LINEWIDTH_1_0;
@@ -396,7 +399,10 @@ static void i810LineWidth( GLcontext *ctx, GLfloat widthf )
static void i810PointSize( GLcontext *ctx, GLfloat sz )
{
i810ContextPtr imesa = I810_CONTEXT( ctx );
- int size = (int)ctx->Point._Size;
+ /* AA, non-AA limits are same */
+ const int size = (int) CLAMP(ctx->Point.Size,
+ ctx->Const.MinPointSize,
+ ctx->Const.MaxPointSize);
imesa->LcsPointSize = 0;
if (size & 1) imesa->LcsPointSize |= LCS_LINEWIDTH_1_0;
diff --git a/src/mesa/drivers/dri/i810/i810tris.c b/src/mesa/drivers/dri/i810/i810tris.c
index 3e09427bb9..2c4ee06633 100644
--- a/src/mesa/drivers/dri/i810/i810tris.c
+++ b/src/mesa/drivers/dri/i810/i810tris.c
@@ -112,7 +112,9 @@ static __inline__ void i810_draw_quad( i810ContextPtr imesa,
static __inline__ void i810_draw_point( i810ContextPtr imesa,
i810VertexPtr tmp )
{
- GLfloat sz = imesa->glCtx->Point._Size * .5;
+ GLfloat sz = 0.5 * CLAMP(imesa->glCtx->Point.Size,
+ imesa->glCtx->Const.MinPointSize,
+ imesa->glCtx->Const.MaxPointSize);
int vertsize = imesa->vertex_size;
GLuint *vb = i810AllocDmaLow( imesa, 2 * 4 * vertsize );
int j;