Mesa (master): svga: set POINTSIZEMIN to 1.0 for non-sprite non-aa points

Marek Olšák mareko at kemper.freedesktop.org
Tue Jan 31 01:14:13 UTC 2012


Module: Mesa
Branch: master
Commit: cb43954308f44717814b53f40672163384cc005e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb43954308f44717814b53f40672163384cc005e

Author: Marek Olšák <maraeo at gmail.com>
Date:   Fri Jan 27 20:29:15 2012 +0100

svga: set POINTSIZEMIN to 1.0 for non-sprite non-aa points

v2: add the helper function, improve the condition

---

 src/gallium/auxiliary/util/u_inlines.h    |   11 +++++++++++
 src/gallium/drivers/svga/svga_state_rss.c |    6 ++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index 9660cdc..c90dc57 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -461,6 +461,17 @@ static INLINE void util_copy_vertex_buffers(struct pipe_vertex_buffer *dst,
    memcpy(dst, src, src_count * sizeof(struct pipe_vertex_buffer));
 }
 
+static INLINE float
+util_get_min_point_size(const struct pipe_rasterizer_state *state)
+{
+   /* The point size should be clamped to this value at the rasterizer stage.
+    */
+   return state->gl_rasterization_rules &&
+          !state->point_quad_rasterization &&
+          !state->point_smooth &&
+          !state->multisample ? 1.0f : 0.0f;
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/gallium/drivers/svga/svga_state_rss.c b/src/gallium/drivers/svga/svga_state_rss.c
index af68d9c..1ee8b7f 100644
--- a/src/gallium/drivers/svga/svga_state_rss.c
+++ b/src/gallium/drivers/svga/svga_state_rss.c
@@ -78,6 +78,7 @@ static int emit_rss( struct svga_context *svga,
                      unsigned dirty )
 {
    struct rs_queue queue;
+   float point_size_min;
 
    queue.rs_count = 0;
 
@@ -211,14 +212,15 @@ static int emit_rss( struct svga_context *svga,
       if (svga->state.sw.need_pipeline)
          cullmode = SVGA3D_FACE_NONE;
 
+      point_size_min = util_get_min_point_size(&curr->templ);
+
       EMIT_RS( svga, cullmode, CULLMODE, fail );
       EMIT_RS( svga, curr->scissortestenable, SCISSORTESTENABLE, fail );
       EMIT_RS( svga, curr->multisampleantialias, MULTISAMPLEANTIALIAS, fail );
       EMIT_RS( svga, curr->lastpixel, LASTPIXEL, fail );
       EMIT_RS( svga, curr->linepattern, LINEPATTERN, fail );
       EMIT_RS_FLOAT( svga, curr->pointsize, POINTSIZE, fail );
-      /* XXX still need to set this? */
-      EMIT_RS_FLOAT( svga, 0.0, POINTSIZEMIN, fail );
+      EMIT_RS_FLOAT( svga, point_size_min, POINTSIZEMIN, fail );
       EMIT_RS_FLOAT( svga, SVGA_MAX_POINTSIZE, POINTSIZEMAX, fail );
       EMIT_RS( svga, curr->pointsprite, POINTSPRITEENABLE, fail);
    }




More information about the mesa-commit mailing list