program

Element Information

Model

Children: shader

Source

<xs:element name="program" minOccurs="0">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="shader" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Declare and prepare a shader for execution in the rendering pipeline of a pass.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="sources">
              <xs:annotation>
                <xs:documentation>collect the sources together for the shader. Use concat to make the final string.</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                <xs:complexContent>
                  <xs:extension base="fx_sources_type">
                    <xs:attribute name="entry" type="xs:token" use="required">
                      <xs:annotation>
                        <xs:documentation>entry function name for this shader</xs:documentation>
                      </xs:annotation>
                    </xs:attribute>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>
            </xs:element>
            <xs:element name="compiler" type="fx_target_type" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="bind_uniform" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation>
                <xs:documentation>Binds values to uniform inputs of a shader.</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                <xs:choice>
                  <xs:element name="param">
                    <xs:annotation>
                      <xs:documentation>References a predefined parameter in shader binding declarations.</xs:documentation>
                    </xs:annotation>
                    <xs:complexType>
                      <xs:attribute name="ref" type="xs:NCName" use="required"/>
                    </xs:complexType>
                  </xs:element>
                  <xs:group ref="cg_param_group"/>
                </xs:choice>
                <xs:attribute name="symbol" type="xs:NCName" use="required">
                  <xs:annotation>
                    <xs:documentation>The identifier for a uniform input parameter to the shader (a formal function parameter or in-scope global) that will be bound to an external resource.</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="stage" type="fx_pipeline_stage_enum" use="required">
            <xs:annotation>
              <xs:documentation>In which pipeline stage this programmable shader is designed to execute, for example, VERTEX, FRAGMENT, etc.</xs:documentation>
            </xs:annotation>
          </xs:attribute>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:element>

Sample