Jump to content

Shader Program Buffer: Difference between revisions

Added some information on PC and PC (Remastered) shaders.
No edit summary
(Added some information on PC and PC (Remastered) shaders.)
Line 8:
}}
 
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. Some basic information is provided below.
 
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 resources and get loaded into memory regardless. See [https://developer.nvidia.com/cg-toolkit-download NVIDIA's reference manual] or the SCE PS3 SDK for more information.
 
For information on Xbox 360 and PC shaders, see Microsoft's documentation of [https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx9-graphics-reference-asm-ps-3-0 ps_3_0] and [https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx9-graphics-reference-asm-vs-3-0 vs_3_0]. Note that PC shaders are compiled at runtime from source code contained in [[Shader Technique]] resources using Microsoft HLSL 9.2; they are cached in <code>%LOCALAPPDATA%/Criterion Games/Burnout Paradise/ShaderCache</code>.
 
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 [http://timjones.io/blog/archive/2015/09/02/parsing-direct3d-shader-bytecode Tim Jones' blog post] on parsing the DXBC format for more information. Note that because PC hardware configurations differ, the compiled shaders that ship with PC (Remastered) are optimized at runtime; these are not cached.
 
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]].
Cookies help us deliver our services. By using our services, you agree to our use of cookies.