Assembler/disassembler for the Xbox nv2a vertex shader
Project description
Trivial assembler for the nv2a vertex shader.
The Cg -> vp20 path performs various optimizations that sometimes make it hard to force unusual test conditions. This assembler performs no optimizations, and simply translates operands into machine code.
Instructions
- ADD
- ARL
- DP3
- DP4
- DPH
- DST
- EXPP
- LIT
- LOGP
- MAD
- MAX
- MIN
- MOV
- MUL
- RCC
- RCP
- RSQ
- SGE
- SLT
Registers
Temporary registers
- r0 - r11
Constant/uniform registers
- c0 - c191
Constant registers may also use relative addressing via bracket syntax. E.g.,
c[A0 + 12]
Address register
- a0
May only be set via the ARL
instruction. E.g., ARL a0, v12
Inputs
- v0, iPos
- v1, iWeight
- v2, iNormal
- v3, iDiffuse
- v4, iSpecular
- v5, iFog
- v6, iPts
- v7, iBackDiffuse
- v8, iBackSpecular
- v9, iTex0
- v10, iTex1
- v11, iTex2
- v12, iTex3
- v13
- v14
- v15
Outputs
- oB0, oBackDiffuse
- oB1, oBackSpecular
- oD0, oDiffuse
- oD1, oSpecular
- oFog
- oPos
- oPts
- oTex0, oT0
- oTex1, oT1
- oTex2, oT2
- oTex3, oT3
Swizzle/destination masks
- xyzw
- rgba
Uniform macros
A simple macro syntax is supported to allow symbolic naming for c
-register
access. Two types are currently implemented, vector
and matrix4
.
A vector
type
aliases a single c
register. E.g., to give a symbolic name to c10:
#uniform_name vector 10
. The macro can then be used in subsequent
instructions; e.g., mov r0, #uniform_name
.
A matrix4
type aliases a contiguous set of 4 c
registers. E.g., to give a
symbolic name to a model matrix passed at 'c96': #my_model_matrix matrix4 96
.
To access the second row: mul r0, v0.y, #my_model_matrix[1]
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nv2a_vsh-0.1.1.tar.gz
.
File metadata
- Download URL: nv2a_vsh-0.1.1.tar.gz
- Upload date:
- Size: 31.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a900f0da597eb376324ac1138c7ca230296506f11dd46a1c3e9732ddbfda9404 |
|
MD5 | 20d5b1809a04f980e9c5579b2e707e14 |
|
BLAKE2b-256 | 8fadc34e0727d287186df09a92e2d9ae559192aae191321090a2a15ddf78edf3 |
File details
Details for the file nv2a_vsh-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: nv2a_vsh-0.1.1-py3-none-any.whl
- Upload date:
- Size: 71.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9cb5331ef50429c51e983ab14a4669f7dd49111d2555d6eefe1cc1387bfcfed |
|
MD5 | 8f9f6ddf7fa3b2dba9e42e93313a59c2 |
|
BLAKE2b-256 | 2e6b1b50110eddcb5ad8a2d822dbb544f4ed922f14341bf831e2389f2d6543f9 |