aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_rasterizer.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_rasterizer.c b/src/gallium/drivers/svga/svga_pipe_rasterizer.c
index bc0acd94625..1dbf5b6debb 100644
--- a/src/gallium/drivers/svga/svga_pipe_rasterizer.c
+++ b/src/gallium/drivers/svga/svga_pipe_rasterizer.c
@@ -172,25 +172,27 @@ svga_create_rasterizer_state(struct pipe_context *pipe,
/* need this for draw module. */
rast->templ = *templ;
- /* light_twoside - XXX: need fragment shader variant */
- /* poly_smooth - XXX: no fallback available */
- /* poly_stipple_enable - draw module */
- /* sprite_coord_enable - ? */
- /* point_quad_rasterization - ? */
- /* point_size_per_vertex - ? */
- /* sprite_coord_mode - ??? */
- /* flatshade_first - handled by index translation */
- /* half_pixel_center - XXX - viewport code */
- /* line_width - draw module */
- /* fill_cw, fill_ccw - draw module or index translation */
-
rast->shademode = svga_translate_flatshade(templ->flatshade);
rast->cullmode = svga_translate_cullmode(templ->cull_face, templ->front_ccw);
rast->scissortestenable = templ->scissor;
rast->multisampleantialias = templ->multisample;
rast->antialiasedlineenable = templ->line_smooth;
rast->lastpixel = templ->line_last_pixel;
- rast->pointsprite = templ->sprite_coord_enable != 0x0;
+ rast->pointsprite = templ->point_quad_rasterization;
+
+ if (rast->templ.multisample) {
+ /* The OpenGL 3.0 spec says points are always drawn as circles when
+ * MSAA is enabled. Note that our implementation isn't 100% correct,
+ * though. Our smooth point implementation involves drawing a square,
+ * computing fragment distance from point center, then attenuating
+ * the fragment alpha value. We should not attenuate alpha if msaa
+ * is enabled. We should kill fragments entirely outside the circle
+ * and let the GPU compute per-fragment coverage.
+ * But as-is, our implementation gives acceptable results and passes
+ * Piglit's MSAA point smooth test.
+ */
+ rast->templ.point_smooth = TRUE;
+ }
if (templ->point_smooth) {
/* For smooth points we need to generate fragments for at least