code wiki / (root) / nx_nxa_gpu_lib.nx

nx_nxa_gpu_lib.nx

buildroot/runtime/nx_nxa_gpu_lib.nx

12516 B318 linesdepth 1pulls 1 transitivereach 23 importersview sourcekind librarytopic nxa
docsdependenciesstructsconstsfunctions

about

Native NXA geometry conversion for GPU upload; no platform API or allocator dependency.

dependencies 1 imports · 4 importers

nx_nxa.nx nx_nxa_gpu_lib.nx nx_nxa_garment_bind_candidate_t132 nx_nxa_garment_bind_lib.nx nx_nxa_gpu_gate.nx nx_nxa_gpu_wasm_gate.nx

imports: nx_nxa.nx

imported by: nx_nxa_garment_bind_candidate_t132.nxnx_nxa_garment_bind_lib.nxnx_nxa_gpu_gate.nxnx_nxa_gpu_wasm_gate.nx

structs

none

consts

4const NGP_COMPONENTS: i64 = 3 // VERT xyz and TRIS corners in the NXA v1 schema.
5const NGP_GPU_WORD: i64 = 4 // WebGPU float32/uint32 wire representation.
6const NGP_U32_MAX: i64 = 4294967295
7const NGP_E_OUTPUT: i64 = 0-4
8const NGP_E_INDEX: i64 = 0-5
9const NGP_E_OVERLAP: i64 = 0-6
11const NGP_SKIN_INFLUENCES: i64 = 4 // NXA v1: four joint indices, then four Q12 weights.
12const NGP_SKIN_WORDS: i64 = NGP_SKIN_INFLUENCES*2
13const NGP_SKEL_WORDS: i64 = 8 // NXA v1 parent, bind translation xyz, quaternion xyzw.
14const NGP_WEIGHT_ONE: i64 = 4096 // NXA v1 Q12 weight denominator.
15const NGP_F32_INTEGER_BITS: i64 = 24 // IEEE-754 binary32 significand precision.
16const NGP_E_SKIN_COUNT: i64 = 0-7
17const NGP_E_SKIN_JOINT: i64 = 0-8
18const NGP_E_SKIN_WEIGHT: i64 = 0-9
19const NGP_E_TEXC_SHAPE: i64=0-10
20const NGP_E_TEXC_VALUE: i64=0-11
21const NGP_F32_ABS_MASK: i64=2147483647
22const NGP_F32_SIGN_MASK: i64=2147483648
166const NGP_TEXC_HEADER: i64=4 // NXA TEXC nv, stride, atlas grid, optional region table offset.
167const NGP_TEXC_STRIDE: i64=3 // u Q16, v Q16, owning joint.
168const NGP_TEXC_UV: i64=2
169const NGP_TEXC_ONE: i64=65536

functions

24func ngp_reason(rc: i64) -> *u8
38func ngp_section(b: *u8,n: i64,tag: *u8) -> i64
41func ngp_bytes(b: *u8,n: i64,tag: *u8) -> i64
called by 1: main calls 1: ngp_section
48func ngp_output(b: *u8,n: i64,out: *u8,cap: i64,need: i64) -> i64
61func ngp_vertices(b: *u8,n: i64,out: *u8,cap: i64) -> i64
called by 1: main calls 2: ngp_sectionngp_output
74func ngp_indices(b: *u8,n: i64,out: *u8,cap: i64) -> i64
called by 1: main calls 2: ngp_sectionngp_output
101func ngp_skin_section(b: *u8,n: i64) -> i64
133func ngp_skin_bytes(b: *u8,n: i64) -> i64
called by 2: gg_skinmain calls 1: ngp_skin_section
141func ngp_skin(b: *u8,n: i64,out: *u8,cap: i64) -> i64
172func ngp_texcoord_section(b: *u8,n: i64) -> i64
199func ngp_texcoord_bytes(b: *u8,n: i64) -> i64
205func ngp_texcoords(b: *u8,n: i64,out: *u8,cap: i64) -> i64
230func ngp_normal_length(square: i64) -> i64
called by 1: ngp_normals
241func ngp_normal_edge(h: *i64,va: i64,a: i64,b: i64,k: i64,scale: i64) -> i64
called by 1: ngp_normals calls 1: ngp_float_difference
246func ngp_float_difference(a: i64,b: i64) -> i64 { return __f32_add(a,b^NGP_F32_SIGN_MASK) }
249func ngp_normals(b: *u8,n: i64,out: *u8,cap: i64) -> i64