1
0
forked from 0ad/0ad
0ad/binaries/data/mods/public/shaders/program.rng
Ykkrosh a3f168b887 Initial support for GLSL generic vertex attributes in shader API, for GLES compatibility.
Specify GLSL version in shader files, for better error detection.

This was SVN commit r11040.
2012-02-09 17:55:25 +00:00

122 lines
4.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<element name="program">
<zeroOrMore>
<element name="define">
<attribute name="name"><text/></attribute>
<attribute name="value"><text/></attribute>
</element>
</zeroOrMore>
<choice>
<group>
<attribute name="type">
<value>arb</value>
</attribute>
<element name="vertex">
<attribute name="file"><text/></attribute>
<zeroOrMore>
<choice>
<ref name="uniformContent"/>
<element name="attrib">
<attribute name="name"><text/></attribute>
<attribute name="loc"><data type="integer"/></attribute>
</element>
<ref name="streamContent"/>
</choice>
</zeroOrMore>
</element>
<element name="fragment">
<attribute name="file"><text/></attribute>
<zeroOrMore>
<ref name="uniformContent"/>
</zeroOrMore>
</element>
</group>
<group>
<attribute name="type">
<value>glsl</value>
</attribute>
<element name="vertex">
<attribute name="file"><text/></attribute>
<zeroOrMore>
<choice>
<element name="attrib">
<attribute name="name"><text/></attribute>
<attribute name="semantics">
<choice>
<value>gl_Vertex</value>
<value>gl_Normal</value>
<value>gl_Color</value>
<value>gl_SecondaryColor</value>
<value>gl_FogCoord</value>
<value>gl_MultiTexCoord0</value>
<value>gl_MultiTexCoord1</value>
<value>gl_MultiTexCoord2</value>
<value>gl_MultiTexCoord3</value>
<value>gl_MultiTexCoord4</value>
<value>gl_MultiTexCoord5</value>
<value>gl_MultiTexCoord6</value>
<value>gl_MultiTexCoord7</value>
</choice>
</attribute>
</element>
<ref name="streamContent"/>
</choice>
</zeroOrMore>
</element>
<element name="fragment">
<attribute name="file"><text/></attribute>
</element>
</group>
</choice>
</element>
</start>
<define name="uniformContent">
<element name="uniform">
<attribute name="name"><text/></attribute>
<attribute name="loc"><data type="integer"/></attribute>
<attribute name="type">
<choice>
<value>float</value>
<value>vec2</value>
<value>vec3</value>
<value>vec4</value>
<value>mat2</value>
<value>mat3</value>
<value>mat4</value>
<value>sampler2D</value>
<value>sampler2DShadow</value>
<value>samplerCube</value>
</choice>
</attribute>
</element>
</define>
<define name="streamContent">
<element name="stream">
<attribute name="name">
<choice>
<value>pos</value>
<value>normal</value>
<value>color</value>
<value>uv0</value>
<value>uv1</value>
<value>uv2</value>
<value>uv3</value>
</choice>
</attribute>
</element>
</define>
</grammar>