Root (<pfx>)

The root element of any PFX file is a <pfx> element

The <pfx> element is the root attribute of the XML document and must be present in any PFX file.

It can contain any number of optional attributes, which will be passed through to the implementation as simple name/value string pairs. These are used to pass any number of PFX metadata, copyright notices, authors, special considerations, and so on.

XML Attributes (pfx element)

ATTRIBUTE

Description

Any attribute

(OPTIONAL) Any attributes in the root element will be passed as-is as name-value pairs in the PFX file. Typically, information like the file (not pfx) version, description, and so on is passed.

Child elements (pfx element)

ELEMENT

Description

<effect>

Rendering effect definitions (Zero or more items)

<pipeline>

Definitions of pipelines (Zero or more items)

<buffer>

Definition of buffer structure/contents (Zero or more)

<shader>

Definition of shader sources (Zero or more)

<texture>

Definition of images that can be used for rendering or sampling (Zero or more)

Example code

    <pfx version="01.00.00.00" description="DeferredShading Effects. Multiple Render Target version." copyright="Imagination Technologies">
      <texture name="GBufferAlbedo" format="r8g8b8a8_unorm" />
      <texture name="GBufferNormal" format="r16g16b16a16_sfloat" />
      <texture name="GBufferDepth" format="r32_sfloat" />
      <texture name="DepthStencil" format="d24s8"/>
      <effect name="RenderObject">
      <pass targetDepthStencil="DepthStencil">
      <!--    GBUFFER PASS
      Gbuffer pass will simply render the scene in to the gbuffer attachments albedo, normal and depth which will the be
      used in following subpasses.
      -->
      <subpass name="GBufferSubPass" target0="GBufferAlbedo" target1="GBufferNormal" 
      target2="GBufferDepth">
      <pipeline name="RenderGBuffer">
      <condition type="requiresUniformSemantic" name="NORMALTEXTURE"/>
      </pipeline>
      </subpass>
      </pass>
      </effect>
    
    <!--
    ============================================================================
    PIPELINES BUFFERS
    ============================================================================
    -->
      <buffer name="StaticPerScene" layout="STD140" scope="effect" multibuffering="false">
      <entry semantic="FARCLIPDIST" dataType="float"/>
      </buffer>
      
      <buffer name="GBufferStaticPerMaterial" layout="STD140" scope="node" multibuffering="false">
      <entry semantic="SPECULARSTRENGTH" dataType="float"/>
      <entry semantic="DIFFUSECOLOR" dataType="vec4"/>
      </buffer>
      
      <buffer name="GBufferPerFramePerModelBuffer" layout="STD140" scope="node" 
      multibuffering="true">
      <entry semantic="MODELVIEWPROJECTIONMATRIX" dataType="mat4x4"/>
      <entry semantic="MODELVIEWMATRIX" dataType="mat4x4"/>
      <entry semantic="MODELWORLDITMATRIX" dataType="mat4x4"/>
      </buffer>
    <!--
    ============================================================================
    PIPELINES
    ============================================================================
    -->
    
      <pipeline name="RenderGBuffer">
      <blending srcColor="ONE" srcAlpha="" dstAlpha="" dstColor="" blendOpColor="" blendOpAlpha=""/>
      <stencil enabled="true" ref="0xFF" />
      <depthstencil depthTest="true" func="less" stencilWriteMask="0xFF" 
      stencilReference="1" stencilOpDepthPass="replace" stencilFunc="always" 
      stencilTest="true"/>
      <rasterization faceCulling="back"/>
      
      <attribute variable="inVertex" semantic="POSITION" dataType="vec3" location="0" 
      vboBinding="0"/>
      <attribute variable="inNormal" semantic="NORMAL" dataType="vec3" location="1" vboBinding="0"/>
      <attribute variable="inTexCoord" semantic="UV0" dataType="vec2" location="2" vboBinding="0"/>
      <attribute variable="inTangent" semantic="TANGENT" dataType="vec3" location="3" 
      vboBinding="0"/>
      
      <buffer set="0" binding="0"  name="StaticPerScene" type="Uniform" apiVersion="VULKAN"/>
      <buffer set="1" binding="0"  name="GBufferStaticPerMaterial" type="UniformDynamic" apiVersion="VULKAN"/>
      <buffer set="1" binding="1"  name="GBufferPerFramePerModelBuffer" type="UniformDynamic" apiVersion="VULKAN"/>
      
      <texture set="1" binding="2" variable="sTexture" semantic="DIFFUSETEXTURE"/>
      <texture set="1" binding="3" variable="sBumpMap" semantic="NORMALTEXTURE" />
      
      <shader name="GBufferVertexShader"/>
      <shader name="GBufferFragmentShader"/>
      </pipeline>
    
    <!--
    ============================================================================
    SHADERS
    ============================================================================
    -->
      <shader type="vertex" name="GBufferVertexShader">
      <file path="GBufferVertexShader.vsh.spv" apiVersion="VULKAN"/>
      </shader>
      <shader type="fragment" name="GBufferFragmentShader">
      <file path="GBufferFragmentShader.fsh.spv" apiVersion="VULKAN"/>
      </shader>
    </pfx>