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

Ian Romanick idr at freedesktop.org
Tue Sep 9 12:28:11 PDT 2014


On 09/09/2014 11:54 AM, Marek Olšák wrote:
> On Tue, Sep 9, 2014 at 8:26 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
>> On Tuesday, September 09, 2014 10:30:16 AM Ian Romanick 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.  Since there is absolutely NO WAY this shader can produce any
>>> useful results, we should at least do the courtesy of generating a
>>> warning.  So, keep the first if-condistion the same, but do
>>> linker_warning instead of linker_error if prog->IsES.
>>
>> I like that idea.  But what about 1.40 or 1.50?  I'm having a hard time imagining how 1.40 would let you produce any useful results, either (so maybe we should issue a warning there too).  With 1.50, you at least have geometry shaders, so you can produce real output later...
> 
> If you are using transform feedback or store instructions with
> rasterization disabled, gl_Position is useless.

And that is why the restriction was lifted in 1.40.  Though... now I
wonder about using GL_EXT_transform_feedback with earlier shader
versions....

> Marek
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list