Skip to main content

Module level9

Module level9 

Source
Expand description

The Aon9 part of a container compiled for a Direct3D 9 feature level (ps_4_0_level_9_1 and the like): the Shader Model 2 program the runtime runs on such hardware, and the tables that map the Shader Model 4 program’s constant buffers, samplers and resources onto Direct3D 9 registers. An XNA build’s XNAP (prepass) and XNAS parts have the same layout, each with its own program and tables.

The layout below was read from containers fxc 10.0.26100.4654 built for every combination the tables have (no constants, float/int/uint/bool constants from several buffers, loops over int constants, branches on bool constants, several texture and sampler pairs, vertex and pixel programs at levels 9_1 and 9_3), each checked against D3DDisassemble’s printing of the same tables. Words, from the start of the part:

  • 0: the part’s size in bytes;
  • 1: a Direct3D 9 version token, the program’s version at the feature level’s minimum (vs_2_0 where the program is vs_2_x);
  • 2 and 3: the program’s size and its offset in the part, in bytes;
  • 4 to 8: five tables, each a u16 count then a u16 byte offset: constant buffer ranges (12 bytes a row), int constants (8), bool constants (8), samplers (4), constants the runtime fills (4).

Structs§

ConstantMapping
One range of a constant buffer copied into float constant registers.
Level9
The Aon9 part.
RuntimeConstant
A float constant register the runtime fills itself.
SamplerMapping
A Direct3D 9 sampler register and the Shader Model 4 sampler and resource it stands for.
ScalarMapping
One component of a constant buffer copied into an int (i#) or bool (b#) constant register.

Functions§

level9
The Aon9 part: None for a container without one. Refuses a container parts refuses, a part whose stated size is not its own, and a program or table that runs past the part; errors name the part’s word.