Bug 31894 - Writing to gl_PointSize with GLES2 corrupts other varyings
Summary: Writing to gl_PointSize with GLES2 corrupts other varyings
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Kristian Høgsberg
QA Contact:
Depends on:
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

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

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.