Skip to content

v3d: fix gl_PointSize for sizes smaller than 1.0

Iago Toral requested to merge itoral/mesa:v3d_point_size into master

According to the OpenGL ES 3.0 spec:

"The point size is taken from the shader built-in gl_PointSize written by the vertex shader, and clamped to the implementation-dependent point size range. If the value written to gl_PointSize is less than or equal to zero, or if no value is written, the point size is undefined. The supported range is determined by the ALIASED_POINT_SIZE_RANGE and may be queried as described in chapter 6. The maximum point size supported must be at least one."

The aliased point range advertised is [1.0, 512.0], where the v3d driver sets the maximum to 512.0 and Gallium enforces the minimum to 1.0.

While the V3D 4.2 spec doesn't explicitly state a range, rendering points with a size smaller than 1.0 won't render anything. Points rendered with a size larger than 512 are automatically clamped by the hardware. Therefore, ensure that if the vertex shader writes to gl_PointSize, its value is at least 1.0.

Fixes piglit test:
spec/!opengl 2.0/vs-point_size-zero
Edited by Iago Toral

Merge request reports