[Mesa-dev] [PATCH] glsl: Add support for parsing [iu]samplerBuffer types in GLSL 1.40.

Kenneth Graunke kenneth at whitecape.org
Fri Mar 30 11:58:36 PDT 2012


On 03/30/2012 09:00 AM, Eric Anholt wrote:
> On Thu, 29 Mar 2012 18:20:43 -0700, Ian Romanick<idr at freedesktop.org>  wrote:
>> On 03/29/2012 02:59 PM, Eric Anholt wrote:
>>> The samplerBuffer type will be undefined in !glsl 1.40, and the
>>> keyword is marked as reserved.  The [iu]samplerBuffer types are not
>>> marked as reserved pre-1.40, so they don't have separate tokens and
>>> fall through to normal type handling.
>>
>> My recollection of GLSL namespace rules is failing.  If these are only
>> caught by the symbol table, will that allow things like
>>
>> 	int isamplerBufer;
>
> Good point, while GLSL 1.30 didn't have the 2 new ones marked as
> reserved, GLSL 1.40 has all 3 marked served, so I need to handle them
> with other reserved keyword stuff.  I think there are other new keywords
> to reserve, too.

That's easy enough to handle:

samplerBuffer       KEYWORD(130, 140, SAMPLERBUFFER)
isamplerBuffer      KEYWORD(140, 140, ISAMPLERBUFFER)
usamplerBuffer      KEYWORD(140, 140, USAMPLERBUFFER)

The first says it's an identifier pre-1.30, reserved in 1.30 and finally 
a real keyword in 1.40+.

The second says it's an identifier pre-1.40 but a real keyword in 1.40+.


More information about the mesa-dev mailing list