st/mesa: don't enable smoothing if multisampling is enabled

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8684>
This commit is contained in:
Marek Olšák
2021-01-12 03:23:23 -05:00
committed by Marge Bot
parent f45d77038b
commit 24ede1ba5b
+32 -8
View File
@@ -163,13 +163,40 @@ st_update_rasterizer(struct st_context *st)
raster->offset_clamp = ctx->Polygon.OffsetClamp;
}
raster->poly_smooth = ctx->Polygon.SmoothFlag;
raster->poly_stipple_enable = ctx->Polygon.StippleFlag;
/* Multisampling disables point, line, and polygon smoothing.
*
* GL_ARB_multisample says:
*
* "If MULTISAMPLE_ARB is enabled, and SAMPLE_BUFFERS_ARB is a value of
* one, then points are rasterized using the following algorithm,
* regardless of whether point antialiasing (POINT_SMOOTH) is enabled"
*
* "If MULTISAMPLE_ARB is enabled, and SAMPLE_BUFFERS_ARB is a value of
* one, then lines are rasterized using the following algorithm,
* regardless of whether line antialiasing (LINE_SMOOTH) is enabled"
*
* "If MULTISAMPLE_ARB is enabled, and SAMPLE_BUFFERS_ARB is a value of
* one, then polygons are rasterized using the following algorithm,
* regardless of whether polygon antialiasing (POLYGON_SMOOTH) is
* enabled"
*/
/* _NEW_MULTISAMPLE */
bool multisample = _mesa_is_multisample_enabled(ctx);
raster->multisample = multisample;
/* _NEW_POLYGON | _NEW_MULTISAMPLE */
raster->poly_smooth = !multisample && ctx->Polygon.SmoothFlag;
/* _NEW_POINT
*/
raster->point_size = ctx->Point.Size;
raster->point_smooth = !ctx->Point.PointSprite && ctx->Point.SmoothFlag;
/* _NEW_POINT | _NEW_MULTISAMPLE */
raster->point_smooth = !multisample && !ctx->Point.PointSprite &&
ctx->Point.SmoothFlag;
/* _NEW_POINT | _NEW_PROGRAM
*/
@@ -206,10 +233,10 @@ st_update_rasterizer(struct st_context *st)
ctx->Point.MaxSize);
}
/* _NEW_LINE
/* _NEW_LINE | _NEW_MULTISAMPLE
*/
raster->line_smooth = ctx->Line.SmoothFlag;
if (ctx->Line.SmoothFlag) {
if (!multisample && ctx->Line.SmoothFlag) {
raster->line_smooth = 1;
raster->line_width = CLAMP(ctx->Line.Width,
ctx->Const.MinLineWidthAA,
ctx->Const.MaxLineWidthAA);
@@ -226,9 +253,6 @@ st_update_rasterizer(struct st_context *st)
/* GL stipple factor is in [1,256], remap to [0, 255] here */
raster->line_stipple_factor = ctx->Line.StippleFactor - 1;
/* _NEW_MULTISAMPLE */
raster->multisample = _mesa_is_multisample_enabled(ctx);
/* _NEW_MULTISAMPLE | _NEW_BUFFERS */
raster->force_persample_interp =
!st->force_persample_in_shader &&