code wiki / (root) / nx_dxbc_exec.nx

nx_dxbc_exec.nx

buildroot/runtime/nx_dxbc_exec.nx

7058 B163 linesdepth 3pulls 4 transitivereach 3 importersview sourcekind librarytopic dxbc
docsdependenciesstructsconstsfunctions

about

nx_dxbc_exec.nx -- D2 of the D3D-game ladder: DECODE OPERANDS + EXECUTE a real DXBC shader. A minimal SM5 interpreter over 4-component float32 registers (input v[], output o[], temp r[]) using REAL hardware float32 (nx_f32_hw mulss/addss = the same IEEE-754 ops D3D uses -> bit-matching semantics). Operand token layout decoded from Microsoft fxc's actual output (confirmed): [0:1]=ncomp [2:3]=selmode [4:11]=swizzle/mask [12:19]=optype (0=temp 1=input 2=output 4=immediate32) [20:21]=index-dim. Subset: mov + mad (enough to execute + GRADE a real fxc arithmetic shader vs its known output). Extended operand tokens + full opcode coverage = D2b. license_tier: ORIGINAL

dependencies 3 imports · 3 importers

nx_syscalls.nx nx_dxbc.nx nx_f32_hw.nx nx_dxbc_exec.nx nishi_export_lib.nx nx_d3d_shade_gate.nx nx_dxbc_exec_gate.nx

imports: nx_syscalls.nxnx_dxbc.nxnx_f32_hw.nx

imported by: nishi_export_lib.nxnx_d3d_shade_gate.nxnx_dxbc_exec_gate.nx

structs

none

consts

10const K_MAGIC_100000: i64 = 100000
11const K_MAGIC_2047: i64 = 2047

functions

15func op_decode(b: *u8, off: i64, out: *i64) -> i64
called by 2: sh_execute_scratchsh_execute calls 1: dx_u32
37func sh_regbase(regs: *i64, optype: i64, idx: i64) -> *i64
47func sh_read_src(regs: *i64, opd: *i64, dst: *i64) -> i64
66func sh_write_dest(regs: *i64, opd: *i64, src: *i64) -> i64
78func sh_execute_scratch(b: *u8, payoff: i64, n: i64, regs: *i64, scratch: *i64) -> i64
122func sh_execute(b: *u8, payoff: i64, n: i64, regs: *i64) -> i64