Direct3D 8 - Vertex Shader - Input/Output Registers

Last edited 2026-01-27


This section contains reference information for the input and output registers implemented by vs.1.0 and vs.1.1.


The meaning of colors in the Type column:

Color

Description

Green

The instruction works in Fusion.

Yellow

The instruction has not been confirmed to work in Fusion.

Red

The instruction does not work in Fusion.

Input/Output registers for Vertex Shader (Microsoft)

Information for the entire table:

    • The Register column describes what it looks like. The "#" should be replaced by a value, for example: "a0", "c1", "v0", "r2". The description describes the register's purpose.
    • Read Port Limit describes the restrictions on using multiple registers in a single instruction.



Type

Register

Description

Input / Output

vs.1.0

vs.1.1

Note

asm

a#

Address Register

Input

Unknown

Count: 1

Read/Write

Read limit: 1
Reads inst: Unlimited

Dimension: Only .x channel is available
Default Value None

RelAddr: No

Requires DCL: No


asm

c#

Constant Float Register

Input

Unknown

Count: Equal to D3DCAPS9.MaxVertexShaderConst

(at least 96 for vs.1.1).

Read-Only

Read limit: 1
Reads inst: Unlimited

Dimension: 4
Default Value: (0, 0, 0, 0)

RelAddr: a0.x

Requires DCL: No

We don't know the value of D3DCAPS9.MaxVertexShaderConst in Fusion, it's probably 96

asm

v#

Input Register

Input

Unknown

Count: 16

Read-Only

Read limit: 1
Reads inst: Unlimited

Dimension: 4
Default Value: *See following note*

RelAddr: No

Requires DCL: Yes

For default value: 
Partial (0, 0, 0, 1) - If only a subset of channels are updated, the remaining channels will default to (0, 0, 0, 1).

asm

r#

Temporary Register

Input

Unknown

Count: 12

Read/Write

Read limit: 3
Reads inst: Unlimited

Dimension: 4
Default Value: None

RelAddr: No

Requires DCL: No


asm

oPos

Position Register

Output

Unknown

Count: 1

Write-Only

Read limit: 0
Reads inst: 0

Dimension: 4
Default Value: None

RelAddr: No

Requires DCL: No


asm

oFog

Fog Register

Output

Unknown

Count: 1

Write-Only

Read limit: 0
Reads inst: 0

Dimension: 1
Default Value: None

RelAddr: No

Requires DCL: No


asm

oPts

Point Size Register

Output

Unknown

Count: 1

Write-Only

Read limit: 0
Reads inst: 0

Dimension: 1
Default Value: None

RelAddr: No

Requires DCL: No


asm

oD#

Color Register

Output

Unknown

Count: 2

Write-Only

Read limit: 0
Reads inst: 0

Dimension: 4
Default Value: None

RelAddr: No

Requires DCL: No

oD0 is the diffuse color output; oD1 is the specular color output.

asm

oT#

Texture Coordinate Register

Output

Unknown

Count: 8

Write-Only

Read limit: 0
Reads inst: 0

Dimension: 4
Default Value: None

RelAddr: No

Requires DCL: No


Description of each register

Address Register:

The a0 register is an address register. A single register is available in version vs.1.1. The address register, designated as a0.x in vs.1.1, can be used as a signed integer offset for relative addressing into the constant register file.


The address register cannot be read by a vertex shader, it can only be used for relative addressing of a constant register.

Reading values outside of the legal range will return (0.0, 0.0, 0.0, 0.0).


The address register can only be a destination for the mov instruction. If a floating-point number is moved into an integer register, a round-to-nearest conversion happens.


All shaders must initialize the address register before using it.


Constant Float Register:

Vertex shader input register for a four component floating-point constant. Set a constant register with either def.


The constant register file is read-only from the perspective of the vertex shader.

Any single instruction may access only one constant register. However, each source in that instruction may independently swizzle and negate that vector as it is read.


For Direct3D 8, constants set with defx or the APIs both assign values to the shader constant space.

Each time the shader is executed, the constants are used by the current shader regardless of the technique used to set them.


Input Register:

Data from each vertex (using one or more input vertex streams) is loaded into the vertex input registers before the vertex shader is run.

The input registers consist of 16 four-component floating-point vectors, designated as v0 through v15. These registers are read-only.


An input register is bound to vertex data through a vertex declaration.


Temporary Register:

A vertex shader temporary register is used to hold intermediate results.


A temporary register must be initialized before it is used.

Each temporary register has single-write and triple-read access.

This means that a single shader instruction can use as many as three temporary registers as inputs.


Values in a temporary register that remain from preceding invocations of the vertex shader cannot be used.


Each temporary register has single-write and triple-read access.

Therefore, an instruction can have as many as three temporary registers in its set of input source operands.


No values in a temporary register that remain from preceding invocations of the vertex shader can be used.

Vertex shaders that read a value from a temporary register before writing to it will fail the Direct3D API call to create the vertex shader.


Position Register:

TODO


Fog Register:

TODO


Point Size Register:

TODO


Color Register:

TODO


Texture Coordinate Register:

TODO


Details information

DSL:

dcl (declaration) it's assembly instruction used to define input registers and samplers before executable code begins. They declare the usage of input registers, such as mapping v0 to position or v1 to texture coordinates. 


Created with the Personal Edition of HelpNDoc: Effortlessly upgrade your WinHelp HLP help files to CHM with HelpNDoc