Simulator/debugger for the Xbox nv2a vertex shader
Project description
Simulator/debugger for the original Xbox nv2a vertex shader.
Use
Very raw instruction summary as of Jun 12, 2022:
NOTE: You'll need to load the file via the commandline right now, import is not implemented
Sections
The UI is divided into two sections, the top menu and the source window. You can use the F1
and F2
keys to switch between sections (1
and 2
also work to allow navigation when running under CLion for development purposes). The asterisk (*
) in the side bar on the left indicates the active section.
Menu window
- "e" will export the current source view to a file in the current working directory.
Source window
-
Cursor up/down in the source window navigates lines, page-up/down jump farther.
-
"a" will toggle ancestry tracing for the currently selected line, marking every line that contributes to the line's outputs.
At the time of this writing there is no way to choose between the MAC and ILU component of a paired command, both will be traced. If you only care about one or the other, the best option is to go to the first ancestor that contributes solely to the one you care about and do the trace from there.
-
Pressing "f" with ancestor tracking enabled will filter out all of the lines that do not contribute to the instruction being traced. Press "f" again to return to full source view.
-
"o" will toggle the display of the outputs of the selected line.
Helpful hints
- You can convert the contents of a xemu vertex shader using RenderDoc to examine the draw and running it through https://github.com/abaire/renderdoc_util/blob/main/util/xemu_shader_to_nv2a.py to sanitize it.
- You can set initial values with csv dumps from RenderDoc (use
-h
to see the appropriate commands, the mesh view will have the input register values and you can expand the uniforms in the pipeline view to get the constant registers)
Example output
File Export
* 0 a MUL R6, v1, c[121]
1 MUL R4, v3, c[120]
2 DP4 R5.x, R6, c[128] + MOV oD0.w, v0.w
3 > DP4 R5.y, R6, c[129]
4 DP4 R5.z, R6, c[130]
5 DP4 R5.w, R6, c[131]
6 = ADD R11.xyz, R6.xyz, -c[136].xyz
7 ADD R10.yzw, R6.yzx, -c[137].yzx
8 MUL R2.xyz, R11.xyz, R11.xyz
9 DP3 R2.x, c[135].z, R2.xyz
10 MUL R2.yzw, R10.yzw, R10.yzw
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
R1, R15, R3, c[100], c[101], c[102], c[103], c[104], c[105], c[106], c[107], c[108], c[109], c[110], c[111], c[112], c[113], c[114], c[115], c[120], c[121], c[128], c[129], c[130], c[131], c[135], c[136], c[137], c[138], c[139],
c[140], c[141], c[142], c[143], c[144], c[145], c[146], c[147], c[58], c[59], c[96], c[97], c[98], c[99], v0, v1, v3
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Result: R5.y: -993.2607421875, 1464.3172607421875, 0.0, 0.0
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 Distributions
Hashes for nv2a_debug-0.0.3-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2409d365c7f474df103e9477bf20c5d8a7e1a8a9d6ff818c84812e47c3d5d22f |
|
MD5 | 9b33c985b2c9c04c362a4b3c01826ea6 |
|
BLAKE2b-256 | 8f69849a4b01c9863465d1493525855285f3d9cfd668b752eb01b97dbacf90d8 |
Hashes for nv2a_debug-0.0.3-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b89cd5d95bc291887530ae8f781dd006ac3ed586e1686aaa7dec0bbb7693b3e |
|
MD5 | 0989ba1a40a924602258945d18850768 |
|
BLAKE2b-256 | 561ee2749908648e9a0d40ceef2585ceb69726352f6e29d96c72674300a2bae8 |
Hashes for nv2a_debug-0.0.3-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8dd07e2366d35bdd7e159f871b1a49f54877c601dcf3577fa6c82931d2a9ec6 |
|
MD5 | 643e41135ee3f5b4609ae2d1cb2e8784 |
|
BLAKE2b-256 | 5ea5941ff9267aac18384cc0e530a103228145f40717c7718e0bb379f6b6531c |
Hashes for nv2a_debug-0.0.3-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 580933ff7737ff02dd265614ee1810a8a17e9bbac99b4d78c3292840b764a521 |
|
MD5 | fd3f7da3e477392313bc84cf6e1ebb08 |
|
BLAKE2b-256 | b8cf3e61a37b0ea0ccd67b42cd06dbdeb60ce8e98e188ba2d0d6fc4a9b8f3dfc |