[Mesa-dev] [PATCH] Linking fails when not writing gl_Position.
Ian Romanick
idr at freedesktop.org
Wed Sep 10 15:32:05 PDT 2014
On 09/10/2014 01:53 PM, Erik Faye-Lund wrote:
> 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.
I'd call that broken by design. The overhead of checking that a shader
statically accessed a variabl is infinitesimal, no matter how slow your
CPU is. These are the sort of cut-corners that make developers hate
OpenGL development. "Why is the screen black? No clue."
> Sure, it probably could have been fixed for GLES 3.0. I wasn't
> involved in those discussions, so I have no insight there.
Nope: transform feedback.
More information about the mesa-dev
mailing list