[Mesa-dev] [PATCH] glsl: add support for gl_InstanceID

Jakob Bornecrantz wallbraker at gmail.com
Mon Mar 14 16:01:34 PDT 2011


On Mon, Mar 14, 2011 at 11:46 PM, Ian Romanick <idr at freedesktop.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 03/10/2011 03:30 PM, Marcin Slusarz wrote:
>> ...by copying support for gl_InstanceIDARB, but without "#extension" check,
>> because EXT_draw_instanced spec does not say anything about it (as opposed
>> to ARB_draw_instanced / gl_InstanceIDARB) and NVIDIA driver already allow it
>
> NAK for a couple reasons.
>
> This extension depends on EXT_gpu_shader4, which we don't support.
> There's no #extension bit required for this extension because the GLSL
> changes are implemented by EXT_gpu_shader4.  Without EXT_draw_instanced,
> gl_InstanceID always reads 0.
>
> Note that EXT_gpu_shader4 says that a #extension line is required to use
> the features of the extension, including gl_InstanceID.  If their driver
> allows gl_InstanceID without a #extension line, it is a bug in their driver.

Oh you clearly haven't tried using new features on the nVidia blobs
have you, bugs galore! Mind you, you do get a warning per feature used
not #extension:ed or #version:ed in the shader log, but who bothers to
read that as long as the shader compiles and links correctly[1] :-/

The problem we have is that most who develops advanced 3D programs do
it against the blobs since they have all the cool features, me
included and yeah I'm lazy as well. Once EXT_gpu_shader4 lands in mesa
I guess I would be motivated to revisit my shaders and code and make
sure they are proper.

Cheers Jakob.

[1]The topping of this particular cake is that if you try to use any
of the #versions or #extensions you get errors when you try to use
deprecated things that are convenient to use, which promotes people to
not do the right thing here and just ignore the #version and/or
#extension for features.


More information about the mesa-dev mailing list