This page describes the format of executable binary files created using ctr_VertexShaderLinker32.
Executable binary files consist of the following blocks.
| Blocks | Structures | Start position offset (in bytes) | Number of blocks | Size per block (in bytes) |
|---|---|---|---|---|
| Binary File Header | BINFILEHEADER | 0 | 1 | 12 |
| Package Information | ---- | 12 | 1 | ---- |
| Executable Image Information | ---- | BINFILEHEADER.exeOffsetTop | BINFILEHEADER.exeCount | ---- |
Binary files include a variable length binary file header located at the start of the file.
The binary file header consists of the following.
typedef struct tagBINFILEHEADER { char signature[4]; unsigned int exeCount; unsigned int exeOffsetTop; } BINFILEHEADER
| Name | Description |
|---|---|
| signature | Stores the character string "DVLB". |
| exeCount | The number of instances of executable image information. |
| exeOffsetTop | Stores the offset in bytes from the start of the file to the first byte of executable image information. If exeCount is greater than 1, the binary file includes more than one instance of executable image information.An offset in bytes to each instance of executable image information is stored every four bytes, immediately after exeOffsetTop. |
Package information is located immediately after the binary file header.
Package information consists of the following.
| Blocks | Structures | Start position offset (in bytes) | Number of blocks | Size per block (in bytes) |
|---|---|---|---|---|
| Package Information Header | PKGHEADER | 0 | 1 | 40 |
| Program Code Information | ---- | PKGHEADER.instOffset | 1 | PKGHEADER.instCount |
| Swizzle Data Information | SWIZZLEINFO | PKGHEADER.swizzleOffset | PKGHEADER.swizzleCount | 8 |
| Line Information | LINEINFO | PKGHEADER.lineOffset | PKGHEADER.lineCount | 8 |
| String Data | ---- | PKGHEADER.stringOffset | 1 | PKGHEADER.stringSize |
The fixed header is located at the start of package information.
You can get the location of data in each information block and the number of instances of data based on header information.
The package information header consists of the following.
typedef struct tagPKGHEADER { char signature[4]; char version[2]; unsigned short reserved0; unsigned int instOffset; unsigned int instCount; unsigned int swizzleOffset; unsigned int swizzleCount; unsigned int lineOffset; unsigned int lineCount; unsigned int stringOffset; unsigned int stringSize; } PKGHEADER
| Name | Description |
|---|---|
| signature | Stores the character string "DVLP". |
| version | Stores the linker tool version. The first byte represents the major version number and the second byte represents the minor version number. |
| instOffset | The byte index included in package information for the program code information block. |
| instCount | The number of instances of data in program code information. |
| swizzleOffset | The byte index included in package information for the swizzle data information block. |
| swizzleCount | The number of instances of data in swizzle data information. |
| lineOffset | The byte index included in package information for the line information block. |
| lineCount | The number of instances of line information. |
| stringOffset | The byte index inside package information to the string data block. |
| stringSize | The number of bytes of string data. |
The program code information block given by instOffset in the package information header stores the number of instances of program code information given by instCount.
Program code information is represented by 32-bit data that corresponds to a single shader assembler instruction. (Not including define instructions. Macro instructions and flow control instructions do not always have a one-to-one correspondence between a single instruction and a single instance of program code information.)
The swizzle data information block given by swizzleOffset in the package information header stores the number of instances of swizzle data information given by swizzleCount.
Swizzle data information consists of the following.
typedef struct tagSWIZZLEINFO { unsigned int value; unsigned short usedInfo; unsigned short reserve; } SWIZZLEINFO
| Name | Description |
|---|---|
| value | Swizzle information data. |
| usedInfo | Internal information used during linking. |
| reserve | The reserved region. |
The line information block, given by lineOffset in the package information header, stores the number of instances of line information given by lineCount.
Line information has a one-to-one correspondence with program code information. It possesses the same information regarding the file name and number of lines for the shader assembler having program code information with the same index.
Line information consists of the following.
typedef struct tagLINEINFO { unsigned int stringIndex; unsigned int lineNo; } LINEINFO
| Name | Description |
|---|---|
| stringIndex | The index to the location where the shader assembler file name is stored for the corresponding program code. This is the byte index inside the string data block. |
| lineNo | The number of shader assembler lines for the corresponding program code. |
The string data block, given by stringOffset in the package information header, stores string data having the byte size given by stringSize.
This includes strings such as the label name, symbol name, and file name. Each string is delimited by '\0'.
Executable image information includes information set for each linked object file.
Executable image information is created for each main object that is linked.
The executable image file is located at the position given by the byte offset from the start of the file stored in exeOffsetTop in the binary file header. If there is more than one instance of executable image information, a byte offset is stored every four bytes immediately after exeOffsetTop.
Executable image information consists of the following.
| Blocks | Structures | Start position offset (in bytes) | Number of blocks | Size per block (in bytes) |
|---|---|---|---|---|
| Executable Image Information Header | EXEIMAGEHEADER | 0 | 1 | 64 |
| Setup Information | SETUPINFO | EXEIMAGEHEADER.setupOffset | EXEIMAGEHEADER.setupCount | 20 |
| Label Information | LABELINFO | EXEIMAGEHEADER.labelOffset | EXEIMAGEHEADER.labelCount | 16 |
| Outmap Information | OUTMAPINFO | EXEIMAGEHEADER.outmapOffset | EXEIMAGEHEADER.outmapCount | 8 |
| Bind Symbol Information | BINDSYMBOLINFO | EXEIMAGEHEADER.bsymOffset | EXEIMAGEHEADER.bsymCount | 8 |
| String Data | ---- | EXEIMAGEHEADER.stringOffset | 1 | EXEIMAGEHEADER.stringSize |
A header is located in each instance of executable image information.
The executable image information header consists of the following.
typedef struct tagEXEIMAGEHEADER { char signature[4]; char version[2]; unsigned char shaderType; unsigned char mergeOutputMapsDebug; unsigned int mainAddr; unsigned int endAddr; unsigned short inputMask; unsigned short outputMask; unsigned char geometryDataMode; unsigned char startIndex; unsigned char subdPatchSize; unsigned char constVertexNumber; unsigned int setupOffset; unsigned int setupCount; unsigned int labelOffset; unsigned int labelCount; unsigned int outmapOffset; unsigned int outmapCount; unsigned int bsymOffset; unsigned int bsymCount; unsigned int stringOffset; unsigned int stringSize; } EXEIMAGEHEADER
| Name | Description |
|---|---|
| signature | Stores the string "DVLE". |
| version | Stores the assembler tool version. The first byte represents the major version number and the second byte represents the minor version number. |
| shaderType | Set to 0 if the executable image is a vertex shader assembler, or 1 if it is a geometry shader assembler. |
| mergeOutputMapsDebug | Bit 0 is used for internal settings of the geometry shader.Bit 1 indicates a debug build if set to 1, or other than a debug build if set to 0. |
| mainAddr | The program address set for the main label. |
| endAddr | The program address set for the endmain label. |
| inputMask | Information on input registers being used. 1 is set for input registers defined using #pragma bind_symbol. |
| outputMask | Information on output registers being used. 1 is set for output registers defined using #pragma output_map. |
| geometryDataMode | Internal information about the geometry shaders. |
| startIndex | Internal information about the geometry shaders. |
| subdivPatchSize | Internal information about the geometry shaders. |
| constVertexNumber | Internal information about the geometry shaders. |
| setupOffset | The offset in bytes from the start of the file to the setup information block. |
| setupCount | The number of instances of setup information. |
| labelOffset | The offset in bytes from the start of the file to the label information block. |
| labelCount | The number of instances of label information. |
| outmapOffset | The offset in bytes from the start of the file to the outmap information block. |
| outmapCount | The number of instances of outmap information. |
| bsymOffset | The offset in bytes from the start of the file to the bind symbol information block. |
| bsymCount | The number of instances of bind symbol information. |
| stringOffset | The offset in bytes from the start of the file to the string data block. |
| stringSize | The number of bytes of string data. |
The setup information block, given by setupOffset in the executable image information header, stores the number of instances of setup information given by setupCount.
Setup information is that information set by the shader assembler using the def, defi, and defb instructions.
Setup information consists of the following.
typedef struct tagSETUPINFO { unsigned short type; unsigned short index; unsigned int value[4]; } SETUPINFO
| Name | Description |
|---|---|
| type | 0: Boolean register setting information 1: Integer register setting information 2: Floating point constant register setting information |
| index | The register index. |
| value | Stores 1 if value[0] is true or 0 if false in the case of a Boolean register.Stores three values defined by a defi instruction in Bit[7:0], Bit[15:8], and Bit[23:16], respectively, of value[0] in the case of an integer register.Converts four values defined using a def instruction to 24-bit floating point numbers and stores them in value[0] through value[3] in the case of a floating point constant register. |
The label information block, given by labelOffset in the executable image information header, stores the number of instances of label information given by labelCount.
Label information represents information about labels used in the shader assembler.
Label information consists of the following.
typedef struct tagLABELINFO { unsigned int index; unsigned int address; unsigned int length; unsigned int stringIndex; } LABELINFO
| Name | Description |
|---|---|
| index | The label information index. Indices are assigned in order labels are defined in the shader assembler starting from 0x00010000. |
| address | The address of the shader program where the label is used. |
| length | The length in bytes from the address the label is used to the associated ret instruction. This is the subroutine length. |
| stringIndex | The byte index inside the string data block storing the label name. |
The output information block, given by outmapOffset in the executable image information header, stores the number of instances of output information given by outmapCount.
Outmap information represents information about #pragma output_map instructions defined in the shader assembler.
Outmap information consists of the following.
typedef struct tagOUTMAPINFO { unsigned short type; unsigned short index; unsigned short mask; unsigned short reserve; } OUTMAPINFO
| Name | Description |
|---|---|
| type | Stores the attribute type. 0: position 1: quaternion 2: color 3: texcoord0 4: texcoord0w 5: texcoord1 6: texcoord2 8: view 9: generic |
| index | The output register index. |
| mask | The specified components. Represents x, y, z and w beginning from the low-order bit. |
| reserve | The reserved region. |
The bind symbol information block, given by bsymOffset in the executable image information header, stores the number of instances of bind symbol information given by bsymCount.
Bind symbol information represents information about #pragma bind_symbol instructions defined in the shader assembler.
Bind symbol information consists of the following.
typedef struct tagBINDSYMBOLINFO { unsigned int stringIndex; unsigned short startIndex; unsigned short endIndex; } BINDSYMBOLINFO
| Name | Description |
|---|---|
| stringIndex | The byte index inside the string data block storing the symbol name. |
| startIndex | The start register index. 0 -15: Input registers 0 to 15 16 - 111: Floating point constant registers 0 to 95 112 - 115: Integer registers 0 to 3 120 - 135: Boolean registers 0 to 15 |
| endIndex | The end register index. Values are the same as for startIndex. |
The string data block, given by stringOffset in the executable image information header, stores string data having the byte size given by stringSize.
This includes strings such as the label name, symbol name, and file name. Each string is delimited by '\0'.
CONFIDENTIAL