Bug 31894

Summary: Writing to gl_PointSize with GLES2 corrupts other varyings
Product: Mesa Reporter: Neil Roberts <nroberts>
Component: Drivers/DRI/i965Assignee: Kristian Høgsberg <krh>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Test case

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
    
    https://bugs.freedesktop.org/show_bug.cgi?id=31894

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.