Mesa (main): st/mesa: correct point_tri_clip for gles2

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 17 16:02:11 UTC 2021


Module: Mesa
Branch: main
Commit: 726fdf3385428b52b773e9049ce6033d02c631c1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=726fdf3385428b52b773e9049ce6033d02c631c1

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Thu Aug 12 15:59:55 2021 +0200

st/mesa: correct point_tri_clip for gles2

The OpenGL ES 2.0 (and later) specifications, section 2.13 (Primitive
Clipping) say the following about point-clipping:

> If the primitive under consideration is a point, then clipping
> discards it if it lies outside the near or far clip plane; otherwise
> it is passed unchanged.

This matches the D3D convention, and we already have a rasterizer-state
bit for it. So let's set that bit when the API is OpenGL ES 2.

We can set this inside the PointSprite-conditional block, because that's
always enabled on GLES 2, and it's undefined to enable this state
without also enabling point_quad_rasterization.

Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12350>

---

 src/gallium/drivers/llvmpipe/ci/deqp-llvmpipe-fails.txt | 8 --------
 src/mesa/state_tracker/st_atom_rasterizer.c             | 2 ++
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/ci/deqp-llvmpipe-fails.txt b/src/gallium/drivers/llvmpipe/ci/deqp-llvmpipe-fails.txt
index b8feb3afc62..1660d2e6c56 100644
--- a/src/gallium/drivers/llvmpipe/ci/deqp-llvmpipe-fails.txt
+++ b/src/gallium/drivers/llvmpipe/ci/deqp-llvmpipe-fails.txt
@@ -10,11 +10,7 @@ dEQP-EGL.functional.robustness.reset_context.shaders.infinite_loop.sync_status.v
 dEQP-EGL.functional.robustness.reset_context.shaders.infinite_loop.sync_status.vertex_and_fragment,Fail
 dEQP-GLES2.functional.clipping.line.wide_line_clip_viewport_center,Fail
 dEQP-GLES2.functional.clipping.line.wide_line_clip_viewport_corner,Fail
-dEQP-GLES2.functional.clipping.point.wide_point_clip,Fail
-dEQP-GLES2.functional.clipping.point.wide_point_clip_viewport_center,Fail
-dEQP-GLES2.functional.clipping.point.wide_point_clip_viewport_corner,Fail
 dEQP-GLES2.functional.clipping.triangle_vertex.clip_two.clip_neg_y_neg_z_and_neg_x_neg_y_pos_z,Fail
-dEQP-GLES2.functional.clipping.triangle_vertex.clip_two.clip_pos_y_pos_z_and_neg_x_neg_y_neg_z,Fail
 dEQP-GLES2.functional.polygon_offset.default_displacement_with_units,Fail
 dEQP-GLES2.functional.rasterization.interpolation.basic.line_loop_wide,Fail
 dEQP-GLES2.functional.rasterization.interpolation.basic.line_strip_wide,Fail
@@ -24,11 +20,7 @@ dEQP-GLES2.functional.rasterization.interpolation.projected.line_strip_wide,Fail
 dEQP-GLES2.functional.rasterization.interpolation.projected.lines_wide,Fail
 dEQP-GLES3.functional.clipping.line.wide_line_clip_viewport_center,Fail
 dEQP-GLES3.functional.clipping.line.wide_line_clip_viewport_corner,Fail
-dEQP-GLES3.functional.clipping.point.wide_point_clip,Fail
-dEQP-GLES3.functional.clipping.point.wide_point_clip_viewport_center,Fail
-dEQP-GLES3.functional.clipping.point.wide_point_clip_viewport_corner,Fail
 dEQP-GLES3.functional.clipping.triangle_vertex.clip_two.clip_neg_y_neg_z_and_neg_x_neg_y_pos_z,Fail
-dEQP-GLES3.functional.clipping.triangle_vertex.clip_two.clip_pos_y_pos_z_and_neg_x_neg_y_neg_z,Fail
 dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag,Fail
 dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag_reverse_dst_x,Fail
 dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag_reverse_src_dst_x,Fail
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index 3f8dd67da32..d03b1b3f5c6 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -220,6 +220,8 @@ st_update_rasterizer(struct st_context *st)
       }
 
       raster->point_quad_rasterization = 1;
+
+      raster->point_tri_clip = st->ctx->API == API_OPENGLES2;
    }
 
    /* ST_NEW_VERTEX_PROGRAM



More information about the mesa-commit mailing list