Direct3D 8 - Pixel Shader - Instructions - ps

Last edited 2026-02-20


The ps instruction specifies which Pixel Shader version the shader should use.

It is inserted at the very beginning of the assembly code as a "header."


The ps syntax looks like this:

ps.X.Y;


X: specifies the generic pixel shader version to use.

Y: specifies the subversion of the pixel shader to use.


An incorrect or unsupported version (ps.X.Y) causes the shader to be rejected by the compilator or GPU.

List of allowed combinations:

Combination

Note

ps.1.0

Uses Pixel Shader version 1.0

ps.1.1

Uses Pixel Shader version 1.1

ps.1.2

Uses Pixel Shader version 1.2

ps.1.3

Uses Pixel Shader version 1.3

ps.1.4

Uses Pixel Shader version 1.4

Example code:


texture T_Image;                            // <- Main texture

technique tech_main
{
    pass P0
    {
        Texture[0] = <T_Image>;
        PixelShader = asm
        {
            ps.1.1;                         // <- Pixel shader version


            tex t0;                         // <- Load the T_Image texture
            
            mov r0, t0;                     // <- Assigning colors from the texture to the result.
        };
    }
}


This example requires the following in the .XML file:
  • Flag <dx8>yes</dx8>


(More information about .XML files can be found here)

Details table:

Type

Instruction

Description

Instruction slots

ps.1.0

ps.1.1

ps.1.2

ps.1.3

ps.1.4

Note

asm

ps

Version number

0

Yes

Yes

Yes

Yes

Yes

Defines the pixel shader model used by the assembly program.

Must be the first instruction in the shader source code.

Created with the Personal Edition of HelpNDoc: Full-featured EBook editor