Shader Program Buffer

From Burnout Wiki
Revision as of 19:57, 24 September 2023 by Burninrubber0 (talk | contribs) (Created page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
RwShaderProgramBuffer
aka PixelShader, VertexShader, and ShaderProgramState
No Example
Resource names Unknown
Type ID 0x12
Category Generic
Memory
distribution
Shader in Main Memory
Buffer in secondary
Imports Unknown
Imported by Shader Technique
Editor
available?
No

The shader program buffer, as the name suggests, describes a buffer for compiled shaders. Shaders are platform-specific and their formats vary greatly, and differences between pixel shaders and vertex shaders double this diversity. This makes documenting the formats extremely challenging; as such, although attempts have been made to do so, they will most likely remain undocumented on this wiki.

PlayStation 3 uses shaders compiled with Nvidia's Cg compiler. The primary resource portion has a discernible header, but for the most part it is made up of the the _CGprogram structure, which is unfortunately not publicly documented and does not appear in any symbols. The secondary resource portion is usually null, though it can sometimes contain garbage near the end. These do vary in size, however, indicating they are valid and loaded into memory regardless.

For information on Xbox 360 shaders, see Microsoft's documentation of ps_3_0 and vs_3_0.

PC (Remastered) and PlayStation 4 shaders were compiled with Microsoft HLSL 10.1. The format appears identical on both platforms; this is likely true on Xbox One as well. See Tim Jones' blog post on parsing the DXBC format for more information.

Nintendo Switch shaders use a proprietary NVIDIA format. In addition to the compiled shader, their buffers contain what appears to be complete (albeit uncommented) uncompiled assembly code for the shader, if not the source code itself. There is further uncompiled shader code in the executable.

This resource type is unused in the original PC game. Instead, see Shader Technique.