Bug 96420 - GLES3 doesn't respect gl_PointSize
Summary: GLES3 doesn't respect gl_PointSize
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 11.2
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-07 08:39 UTC by Dongseong Hwang
Modified: 2016-06-08 17:53 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
gl_PointSize = 2.0 draws 1.0 size point (7.16 KB, text/x-c++src)
2016-06-07 08:39 UTC, Dongseong Hwang
Details
Rendered image from demo as attached (4.98 KB, image/png)
2016-06-08 06:13 UTC, Kenneth Graunke
Details
Rendered image with ES 3.0 context creation hints added (9.75 KB, image/png)
2016-06-08 06:13 UTC, Kenneth Graunke
Details
Patch to make the demo explicitly create an ES 3.0 context. (626 bytes, patch)
2016-06-08 06:18 UTC, Kenneth Graunke
Details | Splinter Review

Description Dongseong Hwang 2016-06-07 08:39:48 UTC
Created attachment 124383 [details]
gl_PointSize = 2.0 draws 1.0 size point

OpenGL ES 3.0 Mesa 11.2.0 in HSW always draws 1.0 point_size point, no matter gl_PointSize setting
Comment 1 Kenneth Graunke 2016-06-08 06:13:17 UTC
Created attachment 124399 [details]
Rendered image from demo as attached
Comment 2 Kenneth Graunke 2016-06-08 06:13:53 UTC
Created attachment 124400 [details]
Rendered image with ES 3.0 context creation hints added
Comment 3 Kenneth Graunke 2016-06-08 06:18:09 UTC
Created attachment 124401 [details] [review]
Patch to make the demo explicitly create an ES 3.0 context.

I compiled the demo with the following command:

$ g++ -lGLESv2 -lglfw -Wall -g cpp-tutorial-4-gles3-pointcloud.cpp

and indeed saw that the vertex shader's gl_PointSize output was being ignored.  However, when I looked into it, I was surprised to see that the demo was actually using a legacy OpenGL context!  Then, the behavior makes sense - OpenGL defaults to using point size from API state, not the shader output.

I patched the demo to make it explicitly create an ES 3.0 context, and then it appears to work correctly.  See the attached patch and images.
Comment 4 Dongseong Hwang 2016-06-08 12:50:03 UTC
Kenneth, thx for answering. gl_PointSize works in GLES3 context.
However, I think legacy OpenGL context should fail to compile ths shader.

On the other hands, could you take a look at gl_VertexID bug in https://bugs.freedesktop.org/show_bug.cgi?id=96421 ?
Comment 5 Kenneth Graunke 2016-06-08 17:53:10 UTC
(In reply to Dongseong Hwang from comment #4)
> Kenneth, thx for answering. gl_PointSize works in GLES3 context.
> However, I think legacy OpenGL context should fail to compile ths shader.

Actually, it should compile: we expose GL_ARB_ES3_compatibility, which allows you to compile #version 300 es shaders in OpenGL contexts.

https://www.opengl.org/registry/specs/ARB/ES3_compatibility.txt


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.