Mesa (master): i965: Enable smooth points when multisampling without point sprites.

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Feb 19 23:41:06 UTC 2014


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Feb 10 19:37:08 2014 -0800

i965: Enable smooth points when multisampling without point sprites.

According to the "Point Multisample Rasterization" of the OpenGL
specification (3.0 or later), smooth points are supposed to be enabled
implicitly when multisampling, regardless of the GL_POINT_SMOOTH flag.

However, if GL_POINT_SPRITE is enabled, you get square points no matter
what.  Core contexts always enable point sprites, so this effectively
makes smooth points go away, even in the case of multisampling.

Fixes Piglit's EXT_framebuffer_multisample/point-smooth tests.
(Yes, that's right folks, we actually have Piglit tests for this.)

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>

---

 src/mesa/drivers/dri/i965/gen8_sf_state.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/gen8_sf_state.c b/src/mesa/drivers/dri/i965/gen8_sf_state.c
index b31b17e..0693fee 100644
--- a/src/mesa/drivers/dri/i965/gen8_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_sf_state.c
@@ -139,8 +139,11 @@ upload_sf(struct brw_context *brw)
    if (!(ctx->VertexProgram.PointSizeEnabled || ctx->Point._Attenuated))
       dw3 |= GEN6_SF_USE_STATE_POINT_WIDTH;
 
-   if (ctx->Point.SmoothFlag)
+   /* _NEW_POINT | _NEW_MULTISAMPLE */
+   if ((ctx->Point.SmoothFlag || ctx->Multisample._Enabled) &&
+       !ctx->Point.PointSprite) {
       dw3 |= GEN8_SF_SMOOTH_POINT_ENABLE;
+   }
 
    dw3 |= GEN6_SF_LINE_AA_MODE_TRUE;
 
@@ -166,6 +169,7 @@ const struct brw_tracked_state gen8_sf_state = {
       .mesa  = _NEW_LIGHT |
                _NEW_PROGRAM |
                _NEW_LINE |
+               _NEW_MULTISAMPLE |
                _NEW_POINT,
       .brw   = BRW_NEW_CONTEXT,
       .cache = 0,




More information about the mesa-commit mailing list