diff options
author | Iago Toral Quiroga <[email protected]> | 2019-07-31 09:47:08 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2019-08-13 09:44:12 +0200 |
commit | 48f5c34301e9f03a18b928251180c82b8c7571d1 (patch) | |
tree | 4f2b2381711609d9207e509765ca8b9def83ebe2 /src/compiler/nir/nir.h | |
parent | 62e0ca3064ba2500f97025599d5ca7210cb4dc04 (diff) |
nir: add a pass to clamp gl_PointSize to a range
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)
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r-- | src/compiler/nir/nir.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 314b696f738..09a3be5527e 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -3886,6 +3886,8 @@ bool nir_lower_doubles(nir_shader *shader, const nir_shader *softfp64, nir_lower_doubles_options options); bool nir_lower_pack(nir_shader *shader); +bool nir_lower_point_size(nir_shader *shader, float min, float max); + typedef enum { nir_lower_interpolation_at_sample = (1 << 1), nir_lower_interpolation_at_offset = (1 << 2), |