vc4: clamp gl_PointSize to a minimum of 1.0
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 31 Jul 2019 08:33:08 +0000 (10:33 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 13 Aug 2019 07:44:54 +0000 (09:44 +0200)
commit2353f7f7ef4b836bc39975e0649094a5d8648ee5
tree22a00a0cd80f319d07fe04280dad81ad5de09ac4
parent3539bd63dd04209317fb158b270033f32f75dcc4
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 <eric@anholt.net>
src/gallium/drivers/vc4/vc4_program.c