Line 354: |
Line 354: |
| | | |
| == DVOJ == | | == DVOJ == |
− | There is another file format for shaders which starts with the string "DVOJ". Little is known about this format, but it seems to be used for unlinked shader objects. It seems likely that one or multiple DVOJs can be linked to a DVLB file, similarly to the C compilation model. | + | There is another file format for shaders which starts with the string "DVOJ". This format seems to be used for unlinked shader objects. It seems likely that one or multiple DVOJs can be linked to a DVLB file, similarly to the C compilation model. |
| + | |
| + | Structurally, a DVOJ header captures all information there is about a single shader instance. It uses the same fields like the DVLB, DVLP, and DVLE structures, but also stores two unknown blocks of data. It seems that the entry point of a DVOJ is always the first shader instruction. |
| + | |
| + | All offsets in the following table are given relative to the DVOJ start. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x00 |
| + | | 0x4 |
| + | | Magic "DVOJ" |
| + | |- |
| + | | 0x04 |
| + | | 0x4 |
| + | | Unknown. Seems to be related to the DVLE shader type. |
| + | |- |
| + | | 0x08 |
| + | | 0x4 |
| + | | Unknown. |
| + | |- |
| + | | 0x0C |
| + | | 0x4 |
| + | | Padding? (usually 0xFFFFFFFF) |
| + | |- |
| + | | 0x10 |
| + | | 0x4 |
| + | | Offset to constant table |
| + | |- |
| + | | 0x14 |
| + | | 0x4 |
| + | | Number of entries in constant table (each entry is 0x14-byte long) |
| + | |- |
| + | | 0x18 |
| + | | 0x4 |
| + | | Offset to label table |
| + | |- |
| + | | 0x1C |
| + | | 0x4 |
| + | | Number of entries in label table (each entry is 0x10-byte long) |
| + | |- |
| + | | 0x20 |
| + | | 0x4 |
| + | | Offset to the compiled shader binary blob |
| + | |- |
| + | | 0x24 |
| + | | 0x4 |
| + | | Size of compiled shader binary blob, in words |
| + | |- |
| + | | 0x28 |
| + | | 0x4 |
| + | | Offset (relative to DVLP start) to shader instruction extension table |
| + | |- |
| + | | 0x2C |
| + | | 0x4 |
| + | | Number of shader instruction extension table entries (each entry is 8-byte long) |
| + | |- |
| + | | 0x30 |
| + | | 0x4 |
| + | | Offset to unknown block 1 |
| + | |- |
| + | | 0x34 |
| + | | 0x4 |
| + | | Number of items in unknown block 1 (each item is 8-byte long) |
| + | |- |
| + | | 0x38 |
| + | | 0x4 |
| + | | Offset to unknown block 2 |
| + | |- |
| + | | 0x3C |
| + | | 0x4 |
| + | | Number of items in unknown block 2 (each item is 12-byte long) |
| + | |- |
| + | | 0x40 |
| + | | 0x4 |
| + | | Offset to output register table |
| + | |- |
| + | | 0x44 |
| + | | 0x4 |
| + | | Number of entries in output register table (each entry is 0x8-byte long) |
| + | |- |
| + | | 0x48 |
| + | | 0x4 |
| + | | Offset to uniform table |
| + | |- |
| + | | 0x4C |
| + | | 0x4 |
| + | | Number of entries in uniform table (each entry is 0x8-byte long) |
| + | |- |
| + | | 0x50 |
| + | | 0x4 |
| + | | Offset to symbol table |
| + | |- |
| + | | 0x54 |
| + | | 0x4 |
| + | | Size of symbol table (in bytes) |
| + | |- |
| + | |} |