nir: add a pass to clamp gl_PointSize to a range

Graphics / Mesa 3D Graphics Library / Mesa - Iago Toral Quiroga [igalia.com] - 13 August 2019 07:44 EDT

The OpenGL and OpenGL ES specs require that implementations clamp the
value of gl_PointSize to an implementation-depedent range. This pass is useful for any GPU hardware that doesn't do this automatically for either one or both sides of the range, such as V3D.

v2:
- Turn into a generic NIR pass (Eric).- Make the pass work before lower I/O so we can use the deref variable to inspect if we are writing to gl_PointSize (Eric).- Make the pass take the range to clamp as parameter and allow it to clamp to both sides of the range or just one side.
- Make the pass report progress.

v3:- Fix copyright header (Eric)- use fmin/fmax instead of bcsel to clamp (Eric)

48f5c34301e nir: add a pass to clamp gl_PointSize to a range
src/compiler/nir/meson.build | 1 +
src/compiler/nir/nir.h | 2 +
src/compiler/nir/nir_lower_point_size.c | 124 ++++++++++++++++++++++++++++++++
3 files changed, 127 insertions(+)

Upstream: cgit.freedesktop.org


  • Share