-
Notifications
You must be signed in to change notification settings - Fork 9
shader_debugging
Raw notes on xemu shader debugging:
xemu generates glsl shaders to emulate the behavior of the nv2a hardware, both the fixed function pipeline and any custom shaders implemented by games.
You can determine which shader is in use at a given time by looking for NV097_SET_TRANSFORM_EXECUTION_MODE in the logs. When using the fixed function pipeline, the low 3 bits will be set to 0
, when using a custom shader it will be 2
.
xemu generates glsl code to emulate the assembly instructions available in the DirectX
The v0
to v12
vectors hold information about the incoming vertex. The values they represent are in this set of #define
s:
- Position
- Weight
- Normal
- Diffuse
- Specular
- Fog
- Point size
- Back diffuse
- Back specular
- Texture 0 coordinates
- Texture 1 coordinates
- Texture 2 coordinates
- Texture 3 coordinates
There are 12 temporary registers (r0
...r11
) plus a special shadow register (r12
) for the oPos
(output position)
There are 192 constants, populated via a combination of NV097_SET_TRANSFORM_CONSTANT_LOAD
and NV097_SET_TRANSFORM_CONSTANT
.
- nVidia's description of the vertex shaders in DirectX8
- Overview of the OpenGL vertex program extension that is closely related to the nv2a hardware implementation
- Description of the combiner behavior that seems likely to be similar to the nv2a hardware implementation
- General overview of the nVidia GPU architecture