summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-02-25 16:25:24 -0700
committerBrian <[email protected]>2008-02-25 16:25:24 -0700
commit09ba1dd4ccb0ed907510cb9403b1fb1fb0ab3658 (patch)
treeda7106433c15e7cb46ee0b73d116bfadbe4f7911 /src/mesa
parent99047e0968882a4e3f9577fa2352d91733181339 (diff)
gallium: clamp line width when creating raster state object
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_atom_rasterizer.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index 435d604af7e..229839d8b2c 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -30,7 +30,7 @@
* Keith Whitwell <[email protected]>
*/
-
+#include "main/macros.h"
#include "st_context.h"
#include "st_cache.h"
#include "pipe/p_context.h"
@@ -227,8 +227,18 @@ static void update_raster_state( struct st_context *st )
/* _NEW_LINE
*/
- raster.line_width = ctx->Line.Width;
raster.line_smooth = ctx->Line.SmoothFlag;
+ if (ctx->Line.SmoothFlag) {
+ raster.line_width = CLAMP(ctx->Line.Width,
+ ctx->Const.MinLineWidthAA,
+ ctx->Const.MaxLineWidthAA);
+ }
+ else {
+ raster.line_width = CLAMP(ctx->Line.Width,
+ ctx->Const.MinLineWidth,
+ ctx->Const.MaxLineWidth);
+ }
+
raster.line_stipple_enable = ctx->Line.StippleFlag;
raster.line_stipple_pattern = ctx->Line.StipplePattern;
/* GL stipple factor is in [1,256], remap to [0, 255] here */