summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-04-02 10:43:37 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-04-02 10:44:04 +0100
commitbc739440c29c551fcc44e9e12d0d9c170d8d24fb (patch)
treed6498a25bfcec072d593a3e4a3ccecf99d19ac98 /src/gallium/auxiliary/draw
parent7f40115a52ce8f9b5883bd9241707b9e603db0e3 (diff)
gallium: add temporary facility for rasterization-time clamping of point sizes
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_wide_point.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_wide_point.c b/src/gallium/auxiliary/draw/draw_wide_point.c
index c53f7e6cb3..86281ca3d8 100644
--- a/src/gallium/auxiliary/draw/draw_wide_point.c
+++ b/src/gallium/auxiliary/draw/draw_wide_point.c
@@ -38,6 +38,8 @@ struct widepoint_stage {
struct draw_stage stage;
float half_point_size;
+ float point_size_min;
+ float point_size_max;
uint texcoord_slot[PIPE_MAX_SHADER_OUTPUTS];
uint texcoord_mode[PIPE_MAX_SHADER_OUTPUTS];
@@ -128,7 +130,15 @@ static void widepoint_point( struct draw_stage *stage,
/* point size is either per-vertex or fixed size */
if (wide->psize_slot >= 0) {
- half_size = 0.5f * header->v[0]->data[wide->psize_slot][0];
+ half_size = header->v[0]->data[wide->psize_slot][0];
+
+ /* XXX: temporary -- do this in the vertex shader??
+ */
+ half_size = CLAMP(half_size,
+ wide->point_size_min,
+ wide->point_size_max);
+
+ half_size *= 0.5f;
}
else {
half_size = wide->half_point_size;
@@ -182,6 +192,8 @@ static void widepoint_first_point( struct draw_stage *stage,
struct draw_context *draw = stage->draw;
wide->half_point_size = 0.5f * draw->rasterizer->point_size;
+ wide->point_size_min = draw->rasterizer->point_size_min;
+ wide->point_size_max = draw->rasterizer->point_size_max;
/* XXX we won't know the real size if it's computed by the vertex shader! */
if ((draw->rasterizer->point_size > draw->wide_point_threshold) ||