Changes

Jump to navigation Jump to search
198 bytes added ,  09:32, 24 May 2021
Clarify unknowns in DVLE and DVLP and further fill out DVLP header
Line 1: Line 1:  
[[Category:File formats]]
 
[[Category:File formats]]
   −
The SHBIN (SHader BINary) file is used to contain compiled and linked shader programs. These can include vertex shaders (typically compiled from .vsh files) and geometry shaders (typically compiled from .gsh files, though .asm have been observed). In commercial applications, SHBIN files can be found as standalone files with the extension .shbin, or contained within .bcsdr files. BCSDR files use CGFX as a container, but the underlying DVLB/DVLP/DVLE structure remains unchanged.
+
The SHBIN (SHader BINary) file is used to contain compiled and linked shader programs. These can include vertex shaders (typically compiled from .vsh files) and geometry shaders (typically compiled from .gsh files, though .asm have been observed). In commercial applications, SHBIN files can be found as standalone files with the extension .shbin, or contained within .bcsdr files. BCSDR files use [[CGFX]] as a container, but the underlying DVLB/DVLP/DVLE structure remains unchanged.
   −
A SHBIN's structure starts with a generic header (DVLB), then a single program header (DVLP), then DVLE(s). The program header specifies the generic parts of the shader, i.e. the shader program data, the operand descriptor data, and a filename symbol table. The contextual details (entry point, constant values, debug symbols, etc) are specified in an executable header (DVLE). There may be multiple DVLE headers, so in this sense multiple shaders sharing the same program code can be stored in a single SHBIN. Hence for the following note the distinction between "program" and "executable".
+
A SHBIN's structure starts with a binary header (DVLB), then a single program header (DVLP), then one or more executable headers DVLE(s). The program header specifies the generic parts of the shader, i.e. the shader program data, the operand descriptor data, and a filename symbol table. The contextual details (entry point, constant values, debug symbols, etc) are specified in an executable header (DVLE). There may be multiple DVLE headers, so in this sense multiple shaders sharing the same program code can be stored in a single SHBIN. Hence for the following note the distinction between "program" and "executable".
    
For a description of the instruction set, see the following page : [[Shader Instruction Set]]
 
For a description of the instruction set, see the following page : [[Shader Instruction Set]]
Line 29: Line 29:  
|}
 
|}
   −
The DVLP file comes directly after the header.
+
The DVLP section comes directly after the binary header.
    
== DVLP ==
 
== DVLP ==
Line 45: Line 45:  
|  0x4
 
|  0x4
 
|  0x4
 
|  0x4
? (Maybe a version number?)
+
Unknown, same value as in DVLE. (Possibly a version number?)
 
|-
 
|-
 
|  0x8
 
|  0x8
Line 57: Line 57:  
|  0x10
 
|  0x10
 
|  0x4
 
|  0x4
|  Offset (relative to DVLP start) to shader instruction extension table
+
|  Offset (relative to DVLP start) to operand descriptor table
 
|-
 
|-
 
|  0x14
 
|  0x14
 
|  0x4
 
|  0x4
|  Number of shader instruction extension table entries (each entry is 8-byte long)
+
|  Number of operand descriptor table entries (each entry is 8-bytes long)
 
|-
 
|-
 
|  0x18
 
|  0x18
 
|  0x4
 
|  0x4
 
|  Offset (relative to DVLP start) to filename symbol table
 
|  Offset (relative to DVLP start) to filename symbol table
 +
|-
 +
|  0x1C
 +
|  0x4
 +
|  Unknown
 +
|-
 +
|  0x20
 +
|  0x4
 +
|  Unknown
 +
|-
 +
|  0x24
 +
|  0x4
 +
|  Unknown
 
|-
 
|-
 
|}
 
|}
Line 83: Line 95:  
|  0x4
 
|  0x4
 
|  0x2
 
|  0x2
|  Unknown
+
|  Unknown, same value as in DVLP. (Possibly a version number?)
 
|-
 
|-
 
|  0x6
 
|  0x6
35

edits

Navigation menu