diff options
author | Iago Toral Quiroga <[email protected]> | 2019-07-31 10:33:08 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2019-08-13 09:44:54 +0200 |
commit | 2353f7f7ef4b836bc39975e0649094a5d8648ee5 (patch) | |
tree | 22a00a0cd80f319d07fe04280dad81ad5de09ac4 /src | |
parent | 3539bd63dd04209317fb158b270033f32f75dcc4 (diff) |
vc4: clamp gl_PointSize to a minimum of 1.0
The OpenGL ES spec requires that the value of gl_PointSize is clamped
to an implementation-dependent range matching what is advertised by
GL_ALIASED_POINT_SIZE_RANGE. For VC4 this is [1.0, 512.0], but the
hardware won't clamp to the minimum side of the range and won't render
points with a size strictly smaller than 1.0 either, so we need to
clamp manually. For points larger than the maximum size of the range
the hardware clamps automatically.
Fixes piglit test:
spec/!opengl 2.0/vs-point_size-zero
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 7fb25ba782e..1d55b87e1ef 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -1441,11 +1441,6 @@ emit_point_size_write(struct vc4_compile *c) else point_size = qir_uniform_f(c, 1.0); - /* Workaround: HW-2726 PTB does not handle zero-size points (BCM2835, - * BCM21553). - */ - point_size = qir_FMAX(c, point_size, qir_uniform_f(c, .125)); - qir_VPM_WRITE(c, point_size); } @@ -2456,6 +2451,9 @@ vc4_shader_state_create(struct pipe_context *pctx, s = tgsi_to_nir(cso->tokens, pctx->screen); } + if (s->info.stage == MESA_SHADER_VERTEX) + NIR_PASS_V(s, nir_lower_point_size, 1.0f, 0.0f); + NIR_PASS_V(s, nir_lower_io, nir_var_all, type_size, (nir_lower_io_options)0); |