Skip to content

st/mesa: correct point_tri_clip for gles2

Erik Faye-Lund requested to merge kusma/mesa:gles2-point-clipping into main

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.

Note: I can't actually find the wording that mandates viewport-clipping during rasterization in the spec, but that seems to be what both the reference rasterizer in the CTS as well as most hardware does, so I'm sure I'm just missing it somehow.

There's also similar wording in the OpenGL 4.6 specification, but there it's explicitly called out as being optional. For now, I think it's better to stay with the current implementation there.

Merge request reports