Bug 31894 - Writing to gl_PointSize with GLES2 corrupts other varyings
Writing to gl_PointSize with GLES2 corrupts other varyings
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965
Other All
: medium normal
Assigned To: Kristian Høgsberg
Depends on:
  Show dependency treegraph
Reported: 2010-11-24 06:09 UTC by Neil Roberts
Modified: 2010-11-30 12:01 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

Test case (2.56 KB, text/x-c)
2010-11-24 06:13 UTC, Neil Roberts

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Roberts 2010-11-24 06:09:03 UTC
GLES2 has a builtin GLSL output variable called gl_PointSize to set the size of points which replaces the glPointSize() function. However writing to these variable seems to cause Mesa to corrupt the output to other unrelated varyings. Cogl's generated GLES2 shader always writes to the gl_PointSize attribute but this breaks everything on Mesa and nothing is painted.

Attached is a test case which draws a rectangle in the top right and four points in the bottom left. All of the geometry should be red because a red color is passed from the vertex shader to the fragment shader via a varying variable. However writing to the gl_PointSize output causes the rectangle to become white. If you comment out the gl_PointSize line then the rectangle is red again.
Comment 1 Neil Roberts 2010-11-24 06:13:26 UTC
Created attachment 40545 [details]
Test case
Comment 2 Kristian Høgsberg 2010-11-30 12:01:20 UTC
commit a889f9ee5cccee031c1090a6ef92cba894b1d77c
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Wed Nov 24 10:12:20 2010 -0500

    i965: Don't write mrf assignment for pointsize output