[Mesa-dev] [PATCH] Linking fails when not writing gl_Position.

Erik Faye-Lund kusmabite at gmail.com
Wed Sep 10 13:53:12 PDT 2014


On Tue, Sep 9, 2014 at 7:30 PM, Ian Romanick <idr at freedesktop.org> wrote:
> On 09/08/2014 01:10 AM, Tapani Pälli wrote:
>> From: Kalyan Kondapally <kalyan.kondapally at intel.com>
>>
>> According to GLSL-ES Spec(i.e. 1.0, 3.0), gl_Position value is undefined
>> after the vertex processing stage if we don't write gl_Position. However,
>> GLSL 1.10 Spec mentions that writing to gl_Position is mandatory. In case
>> of GLSL-ES, it's not an error and atleast the linking should pass.
>> Currently, Mesa throws an linker error in case we dont write to gl_position
>> and Version is less then 140(GLSL) and 300(GLSL-ES). This patch changes
>> it so that we don't report an error in case of GLSL-ES.
>
> Wow.  We can add this to the list of ways OpenGL ES is just plain
> broken.

Historical note: It's not broken, this is by design. The rationale for
why we did this was to ease the burden of compile-time checks for the
compiler - detecting if gl_Position is written no matter how the
program branches is not trivial, so we decided against it. When we
specified this, the typical mobile CPU clock-rate was *a lot* lower
than it is today.

Sure, it probably could have been fixed for GLES 3.0. I wasn't
involved in those discussions, so I have no insight there.


More information about the mesa-dev mailing list