nx_eye_aperture_reuse_expanded_t206.nx
buildroot/runtime/nx_eye_aperture_reuse_expanded_t206.nx
about
nx_shader_ir.nx -- THE SHADER IR: ONE source of truth, N dialect backends.
WHY THIS EXISTS (measured 2026-08-23). The estate's shaders are hand-written GLSL string
literals inside nx_game_page_emit. Drawing characters on the WebGPU tier therefore demanded a
SECOND HAND COPY in WGSL -- ~600 lines (dual-quaternion skinning off a joint texture, instance
uniform arrays, the voxel occlusion march, the procedural anatomy/eye/hair/skin paint) of the
most actively-edited shader in the estate: three separate feature edits landed in it on the day
this was written. Two artifacts that must agree, kept in agreement by discipline, is the exact
shape the banked law forbids. This module is the construction that makes disagreement
IMPOSSIBLE: neither dialect is authored, both are EMITTED from this representation.
HOUSE SHAPE. This mirrors the NishiLang compiler itself -- lex_source -> parse_module ->
opt_run -> {nx_compile_x86, nx_compile_wat}: one front-end representation, many backends.
nx_glsl.nx and nx_wgsl.nx are backends over this IR, not transpilers bolted to a call site.
THE SOURCE OF TRUTH IS NISHILANG (operator, 2026-08-23: "we dont want python or glsl or
javascript or all that it should be nishi lang and nishi ecosystem from the first byte up each
rung gaining all these capabilities"). GLSL IS A TARGET, NOT AN INPUT. This is NOT a GLSL->WGSL
transpiler: translating would enshrine GLSL as the canonical language and make a foreign dialect
the artifact we maintain. A shader is authored ONCE in NishiLang; GLSL and WGSL are both OUTPUTS,
exactly as x86_64 and WAT are outputs of the same NishiLang front-end. The ~600 lines of GLSL in
MVS/MFS are therefore a MIGRATION TARGET, not the source: each rung expresses more of them in
NishiLang and PROVES the emitted GLSL equivalent to the hand-written GLSL that ships today.
LADDER (each rung widens the covered subset; rung 1 is what this lane ships):
rung 1 the fullscreen-triangle vertex stage -- authored in NishiLang, emitting BOTH the GLSL
VSH and the WGSL vs that are hand-written and SHIPPING today, proven against them.
rung 2 lower the real NishiLang AST (nx_tokenizer/nx_parse) into this IR, so a shader is an
ordinary NishiLang function rather than builder calls -- the full 'target, not
translator' shape, sharing the front-end with nx_compile_x86 and the WAT lane.
rung 3 widen the subset to the MFS paint set; rung 4 the MVS skinning set; then the character
pass becomes a compile target and the WebGPU abstention flips from owed to shipped.
THE SOURCE OF TRUTH IS NISHILANG (operator, 2026-08-23: "we dont want python or glsl or
javascript or all that it should be nishi lang and nishi ecosystem from the first byte up each
rung gaining all these capabilities"). GLSL IS A TARGET, NOT AN INPUT. This is NOT a GLSL->WGSL
transpiler: translating would enshrine GLSL as the canonical language and make a foreign dialect
the artifact we maintain. A shader is authored ONCE in NishiLang; GLSL and WGSL are both OUTPUTS,
exactly as x86_64 and WAT are outputs of the same NishiLang front-end. The ~600 lines of GLSL in
MVS/MFS are therefore a MIGRATION TARGET, not the source: each rung expresses more of them in
dependencies 0 imports · 0 importers
imports: none
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 273 | const NX_BUF_TINY: nx_size = 64 |
| 274 | const NX_BUF_SMALL: nx_size = 256 |
| 275 | const NX_BUF_MEDIUM: nx_size = 4096 |
| 276 | const NX_BUF_LARGE: nx_size = 65536 |
| 277 | const NX_BUF_HUGE: nx_size = 1048576 |
| 281 | const NX_TIER_MCU: nx_int = 0 |
| 282 | const NX_TIER_SOVEREIGN_CHIP: nx_int = 1 |
| 283 | const NX_TIER_FAMILY_DEVICE: nx_int = 2 |
| 284 | const NX_TIER_WORKSTATION: nx_int = 3 |
| 285 | const NX_TIER_SERVER: nx_int = 4 |
| 286 | const NX_TIER_HPC: nx_int = 5 |
| 290 | const NX_NUM_N0_I32: nx_int = 0 |
| 291 | const NX_NUM_N1_I64: nx_int = 1 |
| 292 | const NX_NUM_N2_I128: nx_int = 2 |
| 293 | const NX_NUM_N3_I256: nx_int = 3 |
| 294 | const NX_NUM_N4_I512: nx_int = 4 |
| 295 | const NX_NUM_N5_BIGINT: nx_int = 5 |
| 303 | const NX_SIZEOF_NX_INT: nx_size = 8 // nx_int currently i64 -> 8 bytes |
| 304 | const NX_SIZEOF_NX_SIZE: nx_size = 8 // nx_size always pointer-width |
| 305 | const NX_SIZEOF_NX_IDX: nx_size = 8 // nx_idx alias of nx_size |
| 309 | const NX_FD_STDIN: nx_fd = 0 |
| 310 | const NX_FD_STDOUT: nx_fd = 1 |
| 311 | const NX_FD_STDERR: nx_fd = 2 |
| 313 | const SYS_MAGIC_1024: i64 = 1024 |
| 314 | const SYS_MAGIC_1000000: i64 = 1000000 |
| 315 | const SYS_MAGIC_4294967296: i64 = 4294967296 |
| 317 | const SYS_READ_GROW_INIT: i64 = 65536 |
| 318 | const SYS_MAGIC_100000: i64 = 100000 |
| 336 | const SYS_READ: i64 = 0 |
| 337 | const SYS_WRITE: i64 = 1 |
| 338 | const SYS_CLOSE: i64 = 3 |
| 339 | const SYS_LSEEK: i64 = 8 |
| 340 | const SYS_OPENAT: i64 = 257 |
| 341 | const SYS_EXIT: i64 = 60 |
| 342 | const SYS_MMAP: i64 = 9 |
| 343 | const SYS_CLOCK_GETTIME: i64 = 228 |
| 344 | const SYS_IOCTL: i64 = 16 |
| 345 | const SYS_CLOCK_NANOSLEEP: i64 = 230 |
| 349 | const SYS_CHROOT: i64 = 161 |
| 350 | const SYS_MOUNT: i64 = 165 |
| 351 | const SYS_UNSHARE: i64 = 272 |
| 352 | const SYS_GETUID: i64 = 102 |
| 353 | const SYS_GETGID: i64 = 104 |
| 354 | const SYS_POLL: i64 = 7 |
| 358 | const SYS_READ: i64 = 63 |
| 359 | const SYS_WRITE: i64 = 64 |
| 360 | const SYS_CLOSE: i64 = 57 |
| 361 | const SYS_LSEEK: i64 = 62 |
| 362 | const SYS_OPENAT: i64 = 56 |
| 363 | const SYS_EXIT: i64 = 93 |
| 364 | const SYS_MMAP: i64 = 222 |
| 365 | const SYS_CLOCK_GETTIME: i64 = 113 |
| 366 | const SYS_IOCTL: i64 = 29 |
| 367 | const SYS_CLOCK_NANOSLEEP: i64 = 115 |
| 374 | const SYS_CHROOT: i64 = 51 |
| 375 | const SYS_MOUNT: i64 = 40 |
| 376 | const SYS_UNSHARE: i64 = 97 |
| 377 | const SYS_GETUID: i64 = 174 |
| 378 | const SYS_GETGID: i64 = 176 |
| 379 | const SYS_POLL: i64 = 73 |
| 437 | const SYS_PATH_MAX: i64 = 4096 // Linux PATH_MAX; getcwd returns -ERANGE below it |
| 441 | const MODE_0755: i64 = 0x1ed // rwxr-xr-x : default mode for a created directory |
| 456 | const AT_FDCWD: i64 = -100 |
| 561 | const NX_MO_RELAXED: i64 = 0 |
| 562 | const NX_MO_CONSUME: i64 = 1 |
| 563 | const NX_MO_ACQUIRE: i64 = 2 |
| 564 | const NX_MO_RELEASE: i64 = 3 |
| 565 | const NX_MO_ACQ_REL: i64 = 4 |
| 566 | const NX_MO_SEQ_CST: i64 = 5 |
| 568 | const NXA_SMALL_MAX: i64 = 256 |
| 569 | const NXA_CHUNK: i64 = 262144 |
| 570 | const NXA_ALIGN: i64 = 16 |
| 571 | const NXA_GAP: i64 = 16 |
| 572 | const NXA_STATE: i64 = 4096 |
| 578 | const NXA_RING: i64 = 128 |
| 579 | const NXA_RBASE: i64 = 64 |
| 614 | const NXA_LOCK: i64 = 4 |
| 622 | const NXA_LOCK_WARN: i64 = NXA_RING * 8 |
| 626 | const NXA_LOCK_WARNED: i64 = 5 |
| 628 | const NXA_CHUNKBASE: i64 = 320 |
| 629 | const NXA_CHUNKMAX: i64 = 192 |
| 650 | const NXA_MAP_INVALID:i64=0-22 // Linux EINVAL, a protocol value rather than a resource budget. |
| 702 | const SYS_STATFS_X86_MEASURED: i64 = 137 |
| 703 | const STATFS_BUF_BYTES: i64 = 144 |
| 704 | const STATFS_I_BSIZE: i64 = 1 |
| 705 | const STATFS_I_BLOCKS: i64 = 2 |
| 706 | const STATFS_I_BAVAIL: i64 = 4 |
| 707 | const STATFS_PERMIL: i64 = 1000 |
| 708 | const STATFS_ERR: i64 = 0 - 1 |
| 1053 | const O_RDONLY: i64 = 0 |
| 1054 | const O_WRONLY_CT: i64 = 0x241 // O_CREAT | O_WRONLY | O_TRUNC |
| 1055 | const O_WRONLY_CA: i64 = 0x441 // O_CREAT | O_WRONLY | O_APPEND |
| 1063 | const O_RDWR_CREATE: i64 = 0x42 |
| 1084 | const MODE_0644: i64 = 0x1a4 // rw-r--r-- : default mode for a generated artifact |
| 1089 | const MODE_0755: i64 = 0x1ed |
| 1102 | const ACCEPT_TMO_S: i64 = 30 |
| 1109 | const O_WRONLY_CREATE_EXCLUSIVE: i64 = 0x1 | 0x40 | 0x80 |
| 1115 | const O_DIRECTORY: i64 = 0x10000 |
| 1129 | const O_CLOEXEC: i64 = 0x80000 |
| 1130 | const O_NOFOLLOW: i64 = 0x20000 |
| 1131 | const O_NONBLOCK: i64 = 0x800 |
| 1132 | const MODE_0600: i64 = 0x180 |
| 1197 | const SYS_LOCK_SH: i64 = 1 |
| 1198 | const SYS_LOCK_EX: i64 = 2 |
| 1199 | const SYS_LOCK_NB: i64 = 4 |
| 1200 | const SYS_LOCK_UN: i64 = 8 |
| 1245 | const SYS_SETPGID: i64 = 109 |
| 1248 | const SYS_SETPGID: i64 = 154 |
| 1271 | const RLIMIT_CPU: i64 = 0 |
| 1272 | const RLIMIT_AS: i64 = 9 |
| 1273 | const WNOHANG: i64 = 1 |
| 1367 | const SYS_CLONE: i64 = 56 |
| 1368 | const SYS_EXECVE: i64 = 59 |
| 1369 | const SYS_WAIT4: i64 = 61 |
| 1370 | const SYS_PIPE2: i64 = 293 |
| 1371 | const SYS_DUP3: i64 = 292 |
| 1375 | const SYS_CLONE: i64 = 220 |
| 1376 | const SYS_EXECVE: i64 = 221 |
| 1377 | const SYS_WAIT4: i64 = 260 |
| 1378 | const SYS_PIPE2: i64 = 59 |
| 1379 | const SYS_DUP3: i64 = 24 |
| 1385 | const CLONE_VM: i64 = 0x00000100 |
| 1386 | const CLONE_VFORK: i64 = 0x00004000 |
| 1387 | const SIGCHLD: i64 = 17 |
| 1437 | const NX_SYS_PRCTL: i64 = 167 |
| 1438 | const NX_PR_SET_PDEATHSIG: i64 = 1 |
| 1439 | const NX_PR_SET_CHILD_SUBREAPER: i64 = 36 |
| 1454 | const SYS_WAITID_PORTABLE: i64 = 95 |
| 1455 | const NX_WAIT_P_PID: i64 = 1 |
| 1456 | const NX_WAIT_EXITED: i64 = 4 |
| 1457 | const NX_WAIT_NOWAIT: i64 = 0x01000000 |
| 1458 | const NX_WAIT_SIGINFO_BYTES: i64 = 128 |
| 1465 | const NX_FD_DENT_BUFFER: i64 = 4096 |
| 1466 | const NX_SYS_CLOSE_RANGE: i64 = 436 // Linux x86_64 and asm-generic ABI |
| 1467 | const NX_FD_UINT_MAX: i64 = 4294967295 |
| 1639 | const SYS_GETDENTS64: i64 = 217 |
| 1642 | const SYS_GETDENTS64: i64 = 61 |
| 1645 | const DT_UNKNOWN: i64 = 0 |
| 1646 | const DT_FIFO: i64 = 1 |
| 1647 | const DT_CHR: i64 = 2 |
| 1648 | const DT_DIR: i64 = 4 |
| 1649 | const DT_BLK: i64 = 6 |
| 1650 | const DT_REG: i64 = 8 |
| 1651 | const DT_LNK: i64 = 10 |
| 1652 | const DT_SOCK: i64 = 12 |
| 1840 | const SYS_SOCKET: i64 = 41 |
| 1841 | const SYS_BIND: i64 = 49 |
| 1842 | const SYS_LISTEN: i64 = 50 |
| 1843 | const SYS_ACCEPT: i64 = 43 |
| 1844 | const SYS_CONNECT: i64 = 42 |
| 1845 | const SYS_SETSOCKOPT: i64 = 54 |
| 1846 | const SYS_SENDTO: i64 = 44 |
| 1847 | const SYS_RECVFROM: i64 = 45 |
| 1848 | const SYS_SHUTDOWN: i64 = 48 |
| 1852 | const SYS_SOCKET: i64 = 198 |
| 1853 | const SYS_BIND: i64 = 200 |
| 1854 | const SYS_LISTEN: i64 = 201 |
| 1855 | const SYS_ACCEPT: i64 = 202 |
| 1856 | const SYS_CONNECT: i64 = 203 |
| 1857 | const SYS_SETSOCKOPT: i64 = 208 |
| 1858 | const SYS_SENDTO: i64 = 206 |
| 1859 | const SYS_RECVFROM: i64 = 207 |
| 1860 | const SYS_SHUTDOWN: i64 = 210 |
| 1864 | const SOL_SOCKET: i64 = 1 |
| 1865 | const SO_REUSEADDR: i64 = 2 |
| 1870 | const SO_SNDTIMEO: i64 = 21 |
| 1871 | const SO_RCVTIMEO: i64 = 20 |
| 1899 | const SYS_ALARM: i64 = 37 |
| 1902 | const AF_INET: i64 = 2 |
| 1903 | const SOCK_STREAM: i64 = 1 |
| 1904 | const SOCK_DGRAM: i64 = 2 |
| 2010 | const SYS_SENDMSG: i64 = 46 |
| 2011 | const SYS_RECVMSG: i64 = 47 |
| 2012 | const SYS_SOCKETPAIR: i64 = 53 |
| 2013 | const SCM_AF_UNIX: i64 = 1 |
| 2014 | const SCM_SOL_SOCKET: i64 = 1 |
| 2015 | const SCM_RIGHTS_TYPE: i64 = 1 |
| 2016 | const SCM_MSG_CMSG_CLOEXEC: i64 = 1073741824 |
| 2017 | const SCM_MSGHDR_BYTES: i64 = 56 |
| 2018 | const SCM_MSGHDR_OFF_IOV: i64 = 16 |
| 2019 | const SCM_MSGHDR_OFF_IOVLEN: i64 = 24 |
| 2020 | const SCM_MSGHDR_OFF_CTRL: i64 = 32 |
| 2021 | const SCM_MSGHDR_OFF_CTRLLEN: i64 = 40 |
| 2022 | const SCM_IOVEC_BYTES: i64 = 16 |
| 2023 | const SCM_IOVEC_OFF_BASE: i64 = 0 |
| 2024 | const SCM_IOVEC_OFF_LEN: i64 = 8 |
| 2025 | const SCM_CMSG_OFF_LEN: i64 = 0 |
| 2026 | const SCM_CMSG_OFF_LEVEL: i64 = 8 |
| 2027 | const SCM_CMSG_OFF_TYPE: i64 = 12 |
| 2028 | const SCM_CMSG_OFF_DATA: i64 = 16 |
| 2029 | const SCM_CMSG_LEN_1FD: i64 = 20 |
| 2030 | const SCM_CMSG_SPACE_1FD: i64 = 24 |
| 2031 | const SCM_IOV_COUNT_ONE: i64 = 1 |
| 2032 | const SCM_U32_BYTES: i64 = 4 |
| 2033 | const SCM_BYTE_RADIX: i64 = 256 |
| 2034 | const SCM_FDPAIR_BYTES: i64 = 8 |
| 2037 | const SCM_PAYLOAD_BYTES: i64 = 1 |
| 2038 | const SCM_PAYLOAD_BYTE: i64 = 70 |
| 2042 | const SCM_ERR_NO_CMSG: i64 = 0 - 901 |
| 2043 | const SCM_ERR_CMSG_LEN: i64 = 0 - 902 |
| 2044 | const SCM_ERR_CMSG_LEVEL: i64 = 0 - 903 |
| 2045 | const SCM_ERR_CMSG_TYPE: i64 = 0 - 904 |
| 2117 | const SCM_SUN_PATH_OFF: i64 = 2 // sockaddr_un = [sa_family: u16][sun_path: 108] |
| 2118 | const SCM_SUN_BYTES: i64 = 110 |
| 2119 | const SCM_SUN_PATH_MAX: i64 = 107 |
| 2247 | const SIR_SLOTS: i64 = 8 |
| 2252 | const SIR_MAXNODE: i64 = 16384 |
| 2253 | const SIR_POOLCAP: i64 = 65536 |
| 2255 | const SIR_KIND: i64 = 0 |
| 2256 | const SIR_TY: i64 = 1 |
| 2257 | const SIR_A: i64 = 2 |
| 2258 | const SIR_B: i64 = 3 |
| 2259 | const SIR_C: i64 = 4 |
| 2260 | const SIR_NAME: i64 = 5 |
| 2261 | const SIR_D: i64 = 6 |
| 2262 | const SIR_NEXT: i64 = 7 |
| 2265 | const M_NODES: i64 = 0 |
| 2266 | const M_NCOUNT: i64 = 1 |
| 2267 | const M_POOL: i64 = 2 |
| 2268 | const M_POOLUSED: i64 = 3 |
| 2269 | const M_DECLH: i64 = 4 |
| 2270 | const M_DECLT: i64 = 5 |
| 2271 | const M_FUNCH: i64 = 6 |
| 2272 | const M_FUNCT: i64 = 7 |
| 2273 | const M_REFUSE: i64 = 8 |
| 2274 | const M_OVER: i64 = 9 |
| 2279 | const M_CURFN: i64 = 10 |
| 2286 | const M_FRAGOUT: i64 = 11 |
| 2291 | const M_VIOMODE: i64 = 12 |
| 2296 | const M_USESII: i64 = 13 |
| 2303 | const M_WGFRAGOUT: i64 = 14 |
| 2309 | const M_BINDGROUP: i64 = 15 |
| 2312 | const M_CLIP_DEPTH: i64 = 16 |
| 2313 | const SIR_MODULE_WORDS: i64 = 17 |
| 2314 | const SIR_CLIP_NATIVE: i64 = 0 |
| 2315 | const SIR_CLIP_NEGATIVE_ONE_TO_ONE: i64 = 1 |
| 2317 | const SIR_LIT_USUFFIX: i64 = 1 |
| 2320 | const K_UNIFORM: i64 = 1 |
| 2321 | const K_ATTRIB: i64 = 2 |
| 2322 | const K_VARY: i64 = 3 |
| 2323 | const K_FUNC: i64 = 4 |
| 2324 | const K_PARAM: i64 = 5 |
| 2332 | const K_STORAGE: i64 = 6 |
| 2339 | const K_TEXTURE: i64 = 7 |
| 2350 | const K_FRAGOUT: i64 = 8 |
| 2358 | const K_STRUCT: i64 = 9 |
| 2359 | const S_RETURN: i64 = 10 |
| 2360 | const S_ASSIGN: i64 = 11 |
| 2361 | const S_VAR: i64 = 12 |
| 2362 | const S_IF: i64 = 13 |
| 2363 | const S_DISCARD: i64 = 14 |
| 2371 | const S_LOOP: i64 = 15 |
| 2372 | const S_BREAK: i64 = 16 |
| 2376 | const S_EXPR: i64 = 17 |
| 2377 | const E_LIT: i64 = 20 |
| 2378 | const E_IDENT: i64 = 21 |
| 2379 | const E_BIN: i64 = 22 |
| 2380 | const E_CALL: i64 = 23 |
| 2381 | const E_SWZ: i64 = 24 |
| 2382 | const E_INDEX: i64 = 25 |
| 2383 | const E_TEXLOAD: i64 = 26 |
| 2384 | const E_TEXSAMPLE: i64 = 27 |
| 2385 | const E_CTOR: i64 = 28 |
| 2389 | const E_CAST: i64 = 29 |
| 2390 | const E_BUILTIN: i64 = 30 |
| 2395 | const E_ATOMIC: i64 = 31 |
| 2401 | const E_SELECT: i64 = 32 |
| 2405 | const E_NEG: i64 = 33 |
| 2411 | const K_PRIVATE: i64 = 34 |
| 2417 | const E_NOT: i64 = 35 |
| 2420 | const T_VOID: i64 = 0 |
| 2421 | const T_F32: i64 = 1 |
| 2422 | const T_I32: i64 = 2 |
| 2423 | const T_U32: i64 = 3 |
| 2424 | const T_BOOL: i64 = 4 |
| 2425 | const T_V2F: i64 = 5 |
| 2426 | const T_V3F: i64 = 6 |
| 2427 | const T_V4F: i64 = 7 |
| 2428 | const T_V3I: i64 = 8 |
| 2429 | const T_TEX3U: i64 = 9 |
| 2430 | const T_TEX2F: i64 = 10 |
| 2432 | const T_V3U: i64 = 11 |
| 2435 | const T_V2I: i64 = 12 |
| 2439 | const T_M3F: i64 = 13 |
| 2440 | const T_MAX: i64 = 13 |
| 2591 | const P_PLAIN: i64 = 0 |
| 2592 | const P_BUILTIN_POSITION: i64 = 1 |
| 2674 | const SIR_VAR_CONST: i64 = 2 |
| 2713 | const SIR_VAR_LET: i64 = 1 |
| 3097 | const CB_BASE: *u8 = "180.0" // the incumbent sheet's height in blocks, now the slab base |
| 3098 | const CB_TOP: *u8 = "300.0" |
| 3099 | const CB_RLO: *u8 = "24.0" // density ramps in over this many blocks above the base |
| 3100 | const CB_RHI: *u8 = "48.0" // and out over this many below the top |
| 3101 | const CB_CELL: *u8 = "180.0" // one noise cell in blocks, horizontal |
| 3102 | const CB_CELLY: *u8 = "120.0" // and vertical (flatter cells read as stratus) |
| 3103 | const CB_DRIFT_X: *u8 = "240.0" // the incumbent sheet's drift divisors, kept so the motion does not change |
| 3104 | const CB_DRIFT_Z: *u8 = "540.0" |
| 3105 | const CB_THR0: *u8 = "0.78" // coverage threshold at cld=0 |
| 3106 | const CB_THRK: *u8 = "0.30" // and how far cld=1 lowers it |
| 3107 | const CB_GAIN: *u8 = "1.4" |
| 3108 | const CB_STEPS: *u8 = "48" |
| 3109 | const CB_STEPS_F: *u8 = "48.0" |
| 3110 | const CB_SIGMA: *u8 = "0.04" // extinction per block of unit density |
| 3111 | const CB_LIT0: *u8 = "0.70" // ambient at the base |
| 3112 | const CB_LIT1: *u8 = "0.30" // brighter toward the top |
| 3113 | const CB_SUNK: *u8 = "0.15" // silver toward the sun |
| 3117 | const CB_EROSION: *u8 = "0.22" |
| 3118 | const CB_SUN_Y_MIN: *u8 = "0.01" |
| 3119 | const CB_LIGHT_DISTANCE: *u8 = "480.0" |
| 3120 | const CB_LIGHT_STEPS: *u8 = "6" |
| 3121 | const CB_LIGHT_STEPS_F: *u8 = "6.0" |
| 3122 | const CB_VIEW_DISTANCE: *u8 = "1400.0" |
| 3123 | const CB_PHASE_G: *u8 = "0.35" |
| 3124 | const CB_AMBIENT: *u8 = "0.85" |
| 3125 | const CB_DIRECT: *u8 = "0.72" |
| 3477 | const SD_GRAIN_PER_BLOCK: *u8 = "32.0" // facets per block edge: 3 cm at a 1 m block, coarse beach sand |
| 3478 | const SD_GRAIN_SLOPE: *u8 = "1.2" // facet steepness as a normal slope |
| 3479 | const SD_RIPPLE_PER_BLOCK: *u8 = "9.0" // wind ripples per block: an 11 cm wavelength at a 1 m block |
| 3480 | const SD_RIPPLE_SLOPE: *u8 = "0.45" // crest slope |
| 3481 | const SD_RIPPLE_DX: *u8 = "0.8" // ripple normal heading (unit): the wind heading, a data hook |
| 3482 | const SD_RIPPLE_DZ: *u8 = "0.6" |
| 3483 | const SD_PATCH: *u8 = "0.25" // ripple phase jitter per 4-block patch so the field is not one sine |
| 3484 | const SD_TAU: *u8 = "6.2831853" |
| 3485 | const SD_QUARTER_TURN: *u8 = "1.5707963" |
| 3486 | const SD_EIGHTH_TURN: *u8 = "0.7853982" |
| 3487 | const SD_RING_DIRS: *u8 = "8" |
| 3488 | const SD_RING_STEPS: *u8 = "24" // SD_RING_DIRS x SD_WET_R |
| 3489 | const SD_WET_R: *u8 = "3.0" // wet band reach in cells |
| 3490 | const SD_WET_DRY: *u8 = "4.0" // SD_WET_R + 1: no water within reach |
| 3491 | const SD_WET_DARK: *u8 = "0.55" // wet albedo multiplier |
| 3492 | const SD_FILM_POW: *u8 = "48.0" |
| 3493 | const SD_FILM_GAIN: *u8 = "0.55" |
| 3494 | const SD_SHEEN_GAIN: *u8 = "0.10" |
| 3495 | const SD_GLINT_POW: *u8 = "96.0" |
| 3496 | const SD_GLINT_GAIN: *u8 = "0.35" |
| 3497 | const SD_GLINT_FRAC: *u8 = "0.9" // facets whose hash exceeds this are quartz glints |
| 3498 | const SD_NDV_FLOOR: *u8 = "0.15" // the footprint stretch floor at grazing angles |
| 3499 | const SD_SHADOW_SPEC: *u8 = "0.2" // in a block shadow the film keeps its sky sheen and loses the sun |
| 3500 | const SD_TWO: *u8 = "2.0" |
| 3501 | const SD_HALF: *u8 = "0.5" |
functions
| 382 | func sys_ioctl(fd: i64, request: i64, arg: i64) -> i64 |
| 393 | func sys_poll(fds: *u8, nfds: i64, timeout_ms: i64) -> i64 |
| 399 | func sys_write(fd: i64, buf: *u8, count: i64) -> i64 |
| 403 | func sys_read(fd: i64, buf: *u8, count: i64) -> i64 called by 1: sys_read_file |
| 407 | func sys_close(fd: i64) -> i64 |
| 417 | func sys_chdir(path: *u8) -> i64 calls 1: sys_mmap |
| 442 | func sys_getcwd(buf: *u8, cap: i64) -> i64 calls 1: sys_mmap |
| 461 | func sys_unlinkat(path: *u8) -> i64 |
| 468 | func sys_fchmodat(path: *u8, mode: i64) -> i64 calls 1: sys_mmap |
| 484 | func sys_exit_group(code: i64) -> i64 |
| 501 | func sys_setpriority(prio: i64) -> i64 |
| 509 | func sys_setpriority_of(pid: i64, prio: i64) -> i64 |
| 651 | func sys_munmap_direct(addr:*u8,len:i64)->i64 |
| 656 | func sys_munmap(addr: *u8, len: i64) -> i64 |
| 663 | func sys_lseek(fd: i64, offset: i64, whence: i64) -> i64 |
| 711 | func sys_statfs(path: *u8, buf: *i64) -> i64 |
| 716 | func sys_fs_avail_bytes(path: *u8) -> i64 |
| 725 | func sys_fs_used_permil(path: *u8) -> i64 |
| 734 | func sys_exit(code: i64) -> i64 called by 1: nxa_die |
| 768 | func nxa_dump_printable(src: i64, n: i64) -> i64 |
| 789 | func nxa_dump_sizes() -> i64 |
| 814 | func nxa_report_overrun(sz: i64, gs: i64) -> i64 |
| 844 | func nxa_die(msg: *u8) -> i64 |
| 854 | func nxa_lock_addr() -> *i64 |
| 862 | func nxa_lock_take() -> i64 |
| 891 | func nxa_lock_give() -> i64 |
| 905 | func sys_mmap_try(size:i64)->*u8 |
| 912 | func sys_mmap(size: i64) -> *u8 |
| 994 | func sys_arena_mark() -> i64 calls 1: sys_mmap |
| 1008 | func sys_arena_reset() -> i64 |
| 1032 | func sys_mmap_shared(size: i64) -> *u8 |
| 1046 | func sys_madvise(addr: *u8, len: i64, advice: i64) -> i64 |
| 1057 | func sys_openat_rd(path: *u8) -> i64 |
| 1064 | func sys_openat_rdwr(path: *u8, mode: i64) -> i64 |
| 1103 | func sys_openat_wr(path: *u8, mode: i64) -> i64 |
| 1110 | func sys_openat_exclusive(path: *u8, mode: i64) -> i64 |
| 1116 | func sys_openat_directory(path: *u8) -> i64 |
| 1123 | func sys_openat_append(path: *u8, mode: i64) -> i64 |
| 1133 | func sys_openat_lock(path: *u8) -> i64 |
| 1141 | func sys_symlinkat(target: *u8, linkpath: *u8) -> i64 |
| 1153 | func sys_readlinkat(path: *u8, buf: *u8, cap: i64) -> i64 |
| 1170 | func sys_renameat(oldpath: *u8, newpath: *u8) -> i64 |
| 1183 | func sys_fsync(fd: i64) -> i64 |
| 1201 | func sys_flock(fd: i64, op: i64) -> i64 |
| 1209 | func sys_fstatat(path: *u8, statbuf: *u8) -> i64 |
| 1216 | func sys_utimensat(path: *u8, times: *i64) -> i64 |
| 1235 | func nx_kill(pid: i64, sig: i64) -> i64 { return __syscall(129, pid, sig, 0, 0, 0, 0) } |
| 1250 | func sys_setpgid(pid: i64, pgid: i64) -> i64 { return __syscall(SYS_SETPGID, pid, pgid, 0, 0, 0, 0) } |
| 1264 | func nx_prlimit(pid: i64, resource: i64, new_limit: *u8, old_limit: *u8) -> i64 |
| 1276 | func sys_mkdir(path: *u8, mode: i64) -> i64 { return __syscall(34, AT_FDCWD, path, mode, 0, 0, 0) } |
| 1279 | func nx_chmod(path: *u8, mode: i64) -> i64 { return __syscall(53, AT_FDCWD, path, mode, 0, 0, 0) } |
| 1283 | func nx_setsid() -> i64 { return __syscall(112, 0, 0, 0, 0, 0, 0) } |
| 1287 | func sys_clock_gettime_mono(ts: *i64) -> i64 |
| 1295 | func sys_clock_gettime_real(ts: *i64) -> i64 |
| 1300 | func sys_now_realtime_sec() -> i64 |
| 1307 | func sys_now_realtime_ms() -> i64 |
| 1319 | func sys_now_realtime_us() -> i64 |
| 1328 | func sys_now_ms() -> i64 |
| 1339 | func sys_now_us() -> i64 |
| 1350 | func sys_clock_now_us() -> i64 calls 1: sys_now_us |
| 1400 | func sys_unshare(flags: i64) -> i64 |
| 1403 | func sys_mount(source: *u8, target: *u8, fs_type: *u8, mountflags: i64, data: *u8) -> i64 |
| 1406 | func sys_chroot(path: *u8) -> i64 |
| 1409 | func sys_getuid() -> i64 |
| 1412 | func sys_getgid() -> i64 |
| 1416 | func sys_fork() -> i64 |
| 1440 | func sys_prctl(option: i64, arg: i64) -> i64 called by 1: sys_bind_parent_lifetime |
| 1443 | func sys_bind_parent_lifetime(expected_parent: i64, signal: i64) -> i64 calls 1: sys_prctl |
| 1459 | func sys_waitid(idtype: i64, id: i64, info: *u8, options: i64) -> i64 |
| 1468 | func sys_close_inherited_proc(first: i64) -> i64 called by 1: sys_close_inherited calls 6: sys_openat_rdsys_mmapsys_getdents64dirent_reclensys_closesys_munmap |
| 1509 | func sys_close_inherited(first: i64) -> i64 |
| 1515 | func sys_execve_clean(path: *u8, argv: *i64, envp: *i64) -> i64 |
| 1521 | func sys_execve(path: *u8, argv: *i64, envp: *i64) -> i64 called by 1: sys_execve_clean |
| 1530 | func sys_wait4(pid: i64, status: *i64, options: i64) -> i64 |
| 1536 | func wait_exit_code(status: i64) -> i64 called by 1: wait_status_rc |
| 1544 | func wait_term_signal(status: i64) -> i64 called by 1: wait_status_rc |
| 1569 | func wait_status_rc(status: i64) -> i64 |
| 1592 | func sys_default_signal(sig: i64) -> i64 calls 1: sys_mmap |
| 1601 | func sys_ignore_sigpipe() -> i64 calls 1: sys_mmap |
| 1616 | func sys_pipe2(fds: *i64, flags: i64) -> i64 |
| 1622 | func sys_dup3(oldfd: i64, newfd: i64, flags: i64) -> i64 |
| 1656 | func sys_getdents64(fd: i64, buf: *u8, buf_len: i64) -> i64 called by 1: sys_close_inherited_proc |
| 1662 | func dirent_reclen(rec: *u8) -> i64 called by 1: sys_close_inherited_proc |
| 1669 | func dirent_type(rec: *u8) -> i64 |
| 1674 | func dirent_name(rec: *u8) -> *u8 |
| 1681 | func sys_read_file(path: *u8, out_len: *i64) -> *u8 |
| 1763 | func sys_free_file(buf: *u8, len: i64) -> i64 calls 1: sys_munmap |
| 1774 | func sys_map_file(path: *u8, out_len: *i64) -> *u8 |
| 1792 | func sys_sleep_ms(ms: i64) -> i64 |
| 1876 | func sys_setsockopt(fd: i64, level: i64, optname: i64, called by 1: sys_set_socket_timeout |
| 1886 | func sys_set_socket_timeout(fd: i64, secs: i64) -> i64 |
| 1900 | func sys_alarm(secs: i64) -> i64 { return __syscall(SYS_ALARM, secs, 0, 0, 0, 0, 0) } |
| 1906 | func sys_socket(domain: i64, sock_type: i64, protocol: i64) -> i64 |
| 1918 | func sockaddr_in_init(addr: *u8, port: i64) -> i64 |
| 1941 | func sys_bind(fd: i64, addr: *u8, addr_len: i64) -> i64 called by 1: sys_unix_listen |
| 1944 | func sys_listen(fd: i64, backlog: i64) -> i64 called by 1: sys_unix_listen |
| 1951 | func sys_accept(fd: i64) -> i64 |
| 1954 | func sys_accept_with_addr(fd: i64, addr: *u8, addr_len: *i64) -> i64 |
| 1958 | func sys_shutdown(fd: i64, how: i64) -> i64 |
| 1961 | func sys_connect(fd: i64, addr: *u8, addr_len: i64) -> i64 called by 1: sys_unix_connect_fd |
| 1964 | func sys_sendto(fd: i64, buf: *u8, n: i64, flags: i64, |
| 1968 | func sys_recvfrom(fd: i64, buf: *u8, n: i64, flags: i64, |
| 2047 | func scm_zero(base: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { base[i] = 0; i = i + 1 } return 0 } |
| 2048 | func scm_put_i64(base: *u8, off: i64, v: i64) -> i64 |
| 2053 | func scm_get_i64(base: *u8, off: i64) -> i64 called by 1: sys_recv_fd |
| 2060 | func scm_put_u32(base: *u8, off: i64, v: i64) -> i64 called by 1: sys_send_fd |
| 2070 | func scm_get_u32(base: *u8, off: i64) -> i64 called by 1: sys_recv_fd |
| 2082 | func sys_sendmsg(fd: i64, msg: *u8, flags: i64) -> i64 called by 1: sys_send_fd |
| 2085 | func sys_recvmsg(fd: i64, msg: *u8, flags: i64) -> i64 called by 1: sys_recv_fd |
| 2109 | func sys_socketpair(domain: i64, sock_type: i64, protocol: i64, sv: *u8) -> i64 |
| 2120 | func sys_unix_listen(path: *u8, backlog: i64) -> i64 |
| 2148 | func sys_unix_connect_fd(path: *u8) -> i64 |
| 2172 | func sys_send_fd(sock: i64, fd: i64) -> i64 |
| 2206 | func sys_recv_fd(sock: i64, flags: i64) -> i64 |
| 2442 | func sir_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 2444 | func sir_new() -> *i64 calls 1: sys_mmap |
| 2461 | func sir_get(m: *i64, id: i64, k: i64) -> i64 |
| 2466 | func sir_set(m: *i64, id: i64, k: i64, v: i64) -> i64 |
| 2474 | func sir_str(m: *i64, s: *u8) -> i64 |
| 2488 | func sir_cstr(m: *i64, off: i64) -> *u8 |
| 2492 | func sir_node(m: *i64, kind: i64, ty: i64, a: i64, b: i64, c: i64, nameoff: i64) -> i64 |
| 2508 | func sir_chain(m: *i64, hw: i64, tw: i64, id: i64) -> i64 |
| 2518 | func sir_uniform(m: *i64, name: *u8, ty: i64, arraylen: i64) -> i64 |
| 2524 | func sir_private(m: *i64, name: *u8, ty: i64, arraylen: i64) -> i64 |
| 2529 | func sir_attrib(m: *i64, name: *u8, ty: i64, location: i64) -> i64 |
| 2534 | func sir_vary(m: *i64, name: *u8, ty: i64, location: i64, flat: i64) -> i64 |
| 2541 | func sir_storage(m: *i64, name: *u8, elemty: i64, binding: i64, readwrite: i64, atomic: i64) -> i64 |
| 2547 | func sir_texture(m: *i64, name: *u8, ty: i64) -> i64 |
| 2554 | func sir_fragout(m: *i64, name: *u8, ty: i64, location: i64) -> i64 |
| 2564 | func sir_struct(m: *i64, name: *u8) -> i64 |
| 2568 | func sir_member(m: *i64, st: i64, name: *u8, ty: i64) -> i64 { return sir_param(m, st, name, ty) } |
| 2569 | func sir_struct_ty(st: i64) -> i64 { return SIR_MAXNODE + st } |
| 2571 | func sir_struct_of(m: *i64, ty: i64) -> i64 calls 1: sir_get |
| 2578 | func sir_member_of(m: *i64, base: i64, name: *u8, ty: i64) -> i64 { return sir_swz(m, base, name, ty) } |
| 2581 | func sir_func(m: *i64, name: *u8, rettype: i64) -> i64 called by 22: ws_fn_rgb9ws_fn_upkws_fn_vxws_fn_h21ws_fn_h31ws_fn_pal9+16 calls 3: sir_nodesir_strsir_chain |
| 2594 | func sir_param(m: *i64, fn: i64, name: *u8, ty: i64) -> i64 called by 22: sir_membersir_param_positionws_fn_rgb9ws_fn_vxws_fn_h21ws_fn_h31+16 calls 4: sir_nodesir_strsir_getsir_set |
| 2603 | func sir_param_position(m: *i64, fn: i64, name: *u8) -> i64 |
| 2610 | func sir_stmt(m: *i64, fn: i64, st: i64) -> i64 |
| 2619 | func sir_return(m: *i64, e: i64) -> i64 { return sir_node(m, S_RETURN, T_VOID, e, 0, 0, 0) } |
| 2622 | func sir_return_depth(m: *i64, color: i64, depth: i64) -> i64 calls 1: sir_node |
| 2626 | func sir_assign(m: *i64, lhs: i64, rhs: i64) -> i64 { return sir_node(m, S_ASSIGN, T_VOID, lhs, rhs, 0, 0) } |
| 2627 | func sir_var(m: *i64, name: *u8, ty: i64, init: i64) -> i64 { return sir_node(m, S_VAR, ty, init, 0, 0, sir_str(m, name)) } |
| 2628 | func sir_if(m: *i64, cond: i64, thenh: i64, elseh: i64) -> i64 { return sir_node(m, S_IF, T_VOID, cond, thenh, elseh, 0) } |
| 2629 | func sir_discard(m: *i64) -> i64 { return sir_node(m, S_DISCARD, T_VOID, 0, 0, 0, 0) } calls 1: sir_node |
| 2633 | func sir_loop(m: *i64, body: i64) -> i64 { return sir_node(m, S_LOOP, T_VOID, body, 0, 0, 0) } |
| 2634 | func sir_break(m: *i64) -> i64 { return sir_node(m, S_BREAK, T_VOID, 0, 0, 0, 0) } |
| 2636 | func sir_expr(m: *i64, e: i64) -> i64 { return sir_node(m, S_EXPR, T_VOID, e, 0, 0, 0) } |
| 2645 | func sir_for_until(m: *i64, fn: i64, init: i64, until: i64, step: i64, body: i64) -> i64 called by 5: ws_fn_csunws_fn_cld3ws_fn_smarchws_fn_marchws_fn_sand calls 5: sir_stmtsir_ifsir_breaksir_loopsir_seq |
| 2654 | func sir_seq(m: *i64, a: i64, b: i64) -> i64 |
| 2663 | func sir_lit(m: *i64, text: *u8, ty: i64) -> i64 { return sir_node(m, E_LIT, ty, 0, 0, 0, sir_str(m, text)) } |
| 2667 | func sir_lit_u(m: *i64, text: *u8) -> i64 |
| 2675 | func sir_const(m: *i64, name: *u8, ty: i64, init: i64) -> i64 |
| 2680 | func sir_ident(m: *i64, name: *u8, ty: i64) -> i64 { return sir_node(m, E_IDENT, ty, 0, 0, 0, sir_str(m, name)) } |
| 2681 | func sir_bin(m: *i64, op: *u8, l: i64, r: i64, ty: i64) -> i64 { return sir_node(m, E_BIN, ty, l, r, 0, sir_str(m, op)) } |
| 2682 | func sir_swz(m: *i64, base: i64, sel: *u8, ty: i64) -> i64 { return sir_node(m, E_SWZ, ty, base, 0, 0, sir_str(m, sel)) } |
| 2683 | func sir_index(m: *i64, base: i64, idx: i64, ty: i64) -> i64 { return sir_node(m, E_INDEX, ty, base, idx, 0, 0) } |
| 2687 | func sir_texload(m: *i64, tex: i64, coord: i64, lod: i64) -> i64 |
| 2692 | func sir_texsample(m: *i64, tex: i64, coord: i64) -> i64 { return sir_node(m, E_TEXSAMPLE, T_V4F, tex, coord, 0, 0) } calls 1: sir_node |
| 2695 | func sir_call(m: *i64, name: *u8, ty: i64) -> i64 { return sir_node(m, E_CALL, ty, 0, 0, 0, sir_str(m, name)) } |
| 2696 | func sir_ctor(m: *i64, ty: i64) -> i64 { return sir_node(m, E_CTOR, ty, 0, 0, 0, 0) } |
| 2697 | func sir_cast(m: *i64, e: i64, ty: i64) -> i64 { return sir_node(m, E_CAST, ty, e, 0, 0, 0) } |
| 2698 | func sir_builtin(m: *i64, which: *u8, ty: i64) -> i64 |
| 2704 | func sir_atomic(m: *i64, op: *u8, target: i64, val: i64, ty: i64) -> i64 { return sir_node(m, E_ATOMIC, ty, target, val, 0, sir_str(m, op)) } |
| 2706 | func sir_select(m: *i64, cond: i64, tval: i64, fval: i64, ty: i64) -> i64 { return sir_node(m, E_SELECT, ty, cond, tval, fval, 0) } |
| 2708 | func sir_neg(m: *i64, e: i64, ty: i64) -> i64 { return sir_node(m, E_NEG, ty, e, 0, 0, 0) } |
| 2710 | func sir_not(m: *i64, e: i64) -> i64 { return sir_node(m, E_NOT, T_BOOL, e, 0, 0, 0) } |
| 2714 | func sir_let(m: *i64, name: *u8, ty: i64, init: i64) -> i64 |
| 2720 | func sir_arg(m: *i64, callid: i64, e: i64) -> i64 |
| 2737 | func sir_refuse(m: *i64, what: *u8) -> i64 calls 1: sir_str |
| 2741 | func sir_refused(m: *i64) -> i64 { return m[M_REFUSE] } |
| 2744 | func eb_put(out: *u8, pos: i64, cap: i64, s: *u8) -> i64 |
| 2752 | func eb_num(out: *u8, pos: i64, cap: i64, v: i64) -> i64 |
| 2769 | func tr_add(trace: *i64, tcap: i64, tn: *i64, id: i64) -> i64 |
| 2868 | func ws_f(m: *i64, s: *u8) -> i64 { return sir_lit(m, s, T_F32) } |
| 2869 | func ws_i(m: *i64, s: *u8) -> i64 { return sir_lit(m, s, T_I32) } |
| 2871 | func ws_u(m: *i64, s: *u8) -> i64 { return sir_cast(m, sir_lit(m, s, T_I32), T_U32) } |
| 2872 | func ws_id(m: *i64, n: *u8, ty: i64) -> i64 { return sir_ident(m, n, ty) } |
| 2873 | func ws_bin(m: *i64, op: *u8, a: i64, b: i64, ty: i64) -> i64 { return sir_bin(m, op, a, b, ty) } |
| 2874 | func ws_cmp(m: *i64, op: *u8, a: i64, b: i64) -> i64 { return sir_bin(m, op, a, b, T_BOOL) } |
| 2875 | func ws_and(m: *i64, a: i64, b: i64) -> i64 { return sir_bin(m, "&&" as *u8, a, b, T_BOOL) } |
| 2876 | func ws_or(m: *i64, a: i64, b: i64) -> i64 { return sir_bin(m, "||" as *u8, a, b, T_BOOL) } |
| 2877 | func ws_sw(m: *i64, a: i64, sel: *u8, ty: i64) -> i64 { return sir_swz(m, a, sel, ty) } |
| 2879 | func ws_sx(m: *i64, n: *u8, nty: i64, sel: *u8, ty: i64) -> i64 { return sir_swz(m, sir_ident(m, n, nty), sel, ty) } |
| 2880 | func ws_mem(m: *i64, a: i64, name: *u8, ty: i64) -> i64 { return sir_member_of(m, a, name, ty) } |
| 2881 | func ws_c1(m: *i64, name: *u8, a: i64, ty: i64) -> i64 { let c: i64 = sir_call(m, name, ty); sir_arg(m, c, a); return c } |
| 2882 | func ws_c2(m: *i64, name: *u8, a: i64, b: i64, ty: i64) -> i64 { let c: i64 = sir_call(m, name, ty); sir_arg(m, c, a); sir_arg(m, c, b); return c } |
| 2883 | func ws_c3(m: *i64, name: *u8, a: i64, b: i64, c3: i64, ty: i64) -> i64 { let c: i64 = sir_call(m, name, ty); sir_arg(m, c, a); sir_arg(m, c, b); sir_arg(m, c, c3); return c } |
| 2884 | func ws_c4(m: *i64, name: *u8, a: i64, b: i64, c3: i64, d: i64, ty: i64) -> i64 { let c: i64 = sir_call(m, name, ty); sir_arg(m, c, a); sir_arg(m, c, b); sir_arg(m, c, c3); sir_arg(m, c, d); return c } |
| 2885 | func ws_c5(m: *i64, name: *u8, a: i64, b: i64, c3: i64, d: i64, e: i64, ty: i64) -> i64 { let c: i64 = sir_call(m, name, ty); sir_arg(m, c, a); sir_arg(m, c, b); sir_arg(m, c, c3); sir_arg(m, c, d); sir_arg(m, c, e); return c } |
| 2886 | func ws_c6(m: *i64, name: *u8, a: i64, b: i64, c3: i64, d: i64, e: i64, g: i64, ty: i64) -> i64 { let c: i64 = sir_call(m, name, ty); sir_arg(m, c, a); sir_arg(m, c, b); sir_arg(m, c, c3); sir_arg(m, c, d); sir_arg(m, c, e); sir_arg(m, c, g); return c } |
| 2887 | func ws_v1(m: *i64, ty: i64, a: i64) -> i64 { let c: i64 = sir_ctor(m, ty); sir_arg(m, c, a); return c } |
| 2888 | func ws_vt2(m: *i64, ty: i64, a: i64, b: i64) -> i64 { let c: i64 = sir_ctor(m, ty); sir_arg(m, c, a); sir_arg(m, c, b); return c } |
| 2889 | func ws_vt3(m: *i64, ty: i64, a: i64, b: i64, c3: i64) -> i64 { let c: i64 = sir_ctor(m, ty); sir_arg(m, c, a); sir_arg(m, c, b); sir_arg(m, c, c3); return c } |
| 2890 | func ws_v2(m: *i64, a: i64, b: i64) -> i64 { return ws_vt2(m, T_V2F, a, b) } |
| 2891 | func ws_v3(m: *i64, a: i64, b: i64, c3: i64) -> i64 { return ws_vt3(m, T_V3F, a, b, c3) } |
| 2892 | func ws_v3i(m: *i64, a: i64, b: i64, c3: i64) -> i64 { return ws_vt3(m, T_V3I, a, b, c3) } |
| 2893 | func ws_v4(m: *i64, a: i64, b: i64, c3: i64, d: i64) -> i64 { let c: i64 = sir_ctor(m, T_V4F); sir_arg(m, c, a); sir_arg(m, c, b); sir_arg(m, c, c3); sir_arg(m, c, d); return c } |
| 2895 | func ws_v2f(m: *i64, a: *u8, b: *u8) -> i64 { return ws_v2(m, ws_f(m, a), ws_f(m, b)) } |
| 2896 | func ws_v3f(m: *i64, a: *u8, b: *u8, c3: *u8) -> i64 { return ws_v3(m, ws_f(m, a), ws_f(m, b), ws_f(m, c3)) } |
| 2897 | func ws_q2(m: *i64, a: i64, b: i64) -> i64 { return sir_seq(m, a, b) } |
| 2898 | func ws_q3(m: *i64, a: i64, b: i64, c: i64) -> i64 { return sir_seq(m, sir_seq(m, a, b), c) } |
| 2899 | func ws_q4(m: *i64, a: i64, b: i64, c: i64, d: i64) -> i64 { return sir_seq(m, ws_q3(m, a, b, c), d) } |
| 2900 | func ws_q5(m: *i64, a: i64, b: i64, c: i64, d: i64, e: i64) -> i64 { return sir_seq(m, ws_q4(m, a, b, c, d), e) } |
| 2901 | func ws_set(m: *i64, lhs: i64, rhs: i64) -> i64 { return sir_assign(m, lhs, rhs) } |
| 2903 | func ws_op(m: *i64, name: *u8, ty: i64, op: *u8, rhs: i64) -> i64 { return sir_assign(m, sir_ident(m, name, ty), sir_bin(m, op, sir_ident(m, name, ty), rhs, ty)) } called by 11: ws_fn_csunws_fn_cld3ws_fn_smarchws_fn_marchws_liws_ao+5 calls 3: sir_assignsir_identsir_bin |
| 2905 | func ws_opx(m: *i64, name: *u8, nty: i64, sel: *u8, ty: i64, op: *u8, rhs: i64) -> i64 { return sir_assign(m, ws_sx(m, name, nty, sel, ty), sir_bin(m, op, ws_sx(m, name, nty, sel, ty), rhs, ty)) } |
| 2906 | func ws_if(m: *i64, c: i64, t: i64, e: i64) -> i64 { return sir_if(m, c, t, e) } |
| 2907 | func ws_ret(m: *i64, e: i64) -> i64 { return sir_return(m, e) } |
| 2908 | func ws_st(m: *i64, f: i64, s: i64) -> i64 { return sir_stmt(m, f, s) } |
| 2912 | func ws_world_uniforms(m: *i64) -> i64 calls 1: sir_uniform |
| 2942 | func ws_ru(m: *i64, n: *u8, ty: i64) -> i64 { return sir_uniform(m, n, ty, 0) } |
| 2943 | func ws_world_uniforms_raw(m: *i64) -> i64 calls 1: ws_ru |
| 2959 | func ws_world_privates(m: *i64) -> i64 calls 1: sir_private |
| 2969 | func ws_fi(m: *i64, n: *u8) -> i64 { return sir_cast(m, sir_ident(m, n, T_I32), T_F32) } |
| 2971 | func ws_fn_rgb9(m: *i64) -> i64 |
| 2981 | func ws_pal(m: *i64, f: i64, arr: *u8, k: *u8, rn: *u8) -> i64 |
| 2989 | func ws_fn_upk(m: *i64) -> i64 |
| 3027 | func ws_fn_vx(m: *i64) -> i64 |
| 3045 | func ws_fn_h21(m: *i64) -> i64 |
| 3054 | func ws_fn_h31(m: *i64) -> i64 |
| 3063 | func ws_fn_pal9(m: *i64) -> i64 |
| 3077 | func ws_noise2(m: *i64, iname: *u8, fname: *u8) -> i64 |
| 3126 | func ws_h31o(m: *i64, a: *u8, b: *u8, c: *u8) -> i64 |
| 3129 | func ws_fx(m: *i64, sel: *u8) -> i64 { return ws_sx(m, "f" as *u8, T_V3F, sel, T_F32) } |
| 3130 | func ws_py(m: *i64) -> i64 { return ws_sx(m, "p" as *u8, T_V3F, "y" as *u8, T_F32) } calls 1: ws_sx |
| 3132 | func ws_fn_vn3(m: *i64) -> i64 |
| 3152 | func ws_fn_cvol(m: *i64) -> i64 |
| 3168 | func ws_fn_csun(m: *i64) -> i64 |
| 3181 | func ws_fn_cld3(m: *i64) -> i64 |
| 3213 | func ws_fn_sky(m: *i64) -> i64 |
| 3233 | func ws_struct_hit(m: *i64) -> i64 |
| 3243 | func ws_dda_step(m: *i64, ax: *u8, fneg: *u8, fpos: *u8) -> i64 |
| 3254 | func ws_fn_hq(m: *i64) -> i64 |
| 3270 | func ws_fn_surf(m: *i64) -> i64 |
| 3292 | func ws_fn_terrain(m: *i64) -> i64 |
| 3304 | func ws_fn_smarch(m: *i64) -> i64 |
| 3341 | func ws_fn_gnd(m: *i64) -> i64 |
| 3365 | func ws_fn_march(m: *i64, hty: i64) -> i64 |
| 3422 | func ws_face(m: *i64, sw: *u8, ax: *u8, op: *u8, nx: *u8, ny: *u8, nz: *u8) -> i64 |
| 3429 | func ws_li(m: *i64, k: *u8) -> i64 { return ws_op(m, "li" as *u8, T_F32, "*" as *u8, ws_f(m, k)) } |
| 3431 | func ws_fce(m: *i64, k: *u8) -> i64 { return ws_cmp(m, "==" as *u8, ws_id(m, "fce" as *u8, T_I32), ws_i(m, k)) } |
| 3433 | func ws_beq(m: *i64, k: *u8) -> i64 { return ws_cmp(m, "==" as *u8, ws_id(m, "b" as *u8, T_U32), ws_u(m, k)) } |
| 3435 | func ws_ao(m: *i64, fa: *u8, cmp: *u8, edge: *u8, nudge: i64, gain: i64) -> i64 |
| 3442 | func ws_nb(m: *i64, ax: *u8, op: *u8) -> i64 { return ws_opx(m, "nb" as *u8, T_V3I, ax, T_I32, op, ws_i(m, "1" as *u8)) } |
| 3444 | func ws_topbot(m: *i64) -> i64 { return ws_or(m, ws_fce(m, "3" as *u8), ws_fce(m, "4" as *u8)) } |
| 3449 | func ws_smooth(m: *i64) -> i64 |
| 3454 | func ws_cont_water(m: *i64) -> i64 |
| 3457 | func ws_cont_surface(m: *i64) -> i64 { return ws_or(m, ws_smooth(m), ws_cont_water(m)) } |
| 3459 | func ws_step_down(m: *i64) -> i64 |
| 3503 | func ws_sd_pxz(m: *i64) -> i64 { return ws_sx(m, "hp" as *u8, T_V3F, "xz" as *u8, T_V2F) } |
| 3504 | func ws_sd_f(m: *i64, n: *u8) -> i64 { return ws_id(m, n, T_F32) } |
| 3505 | func ws_sd_v3(m: *i64, n: *u8) -> i64 { return ws_id(m, n, T_V3F) } |
| 3507 | func ws_sd_surf(m: *i64, op: *u8, dx: *u8, dz: *u8) -> i64 { return ws_c1(m, "surf" as *u8, ws_bin(m, op, ws_sd_pxz(m), ws_v2f(m, dx, dz), T_V2F), T_F32) } |
| 3509 | func ws_sd_g(m: *i64, dx: *u8, dz: *u8) -> i64 { return ws_c1(m, "h21" as *u8, ws_bin(m, "+" as *u8, ws_id(m, "gc" as *u8, T_V2F), ws_v2f(m, dx, dz), T_V2F), T_F32) } |
| 3510 | func ws_sd_lt0(m: *i64, n: *u8) -> i64 { return ws_cmp(m, "<" as *u8, ws_id(m, n, T_F32), ws_f(m, "0.0" as *u8)) } |
| 3511 | func ws_sd_dk(m: *i64, n: *u8) -> i64 { return ws_bin(m, "*" as *u8, ws_id(m, n, T_I32), ws_id(m, "k" as *u8, T_I32), T_I32) } |
| 3513 | func ws_sd_wat(m: *i64, y: *u8) -> i64 { return ws_cmp(m, "==" as *u8, ws_c1(m, "vx" as *u8, ws_bin(m, "+" as *u8, ws_id(m, "c" as *u8, T_V3I), ws_vt3(m, T_V3I, ws_sd_dk(m, "dx" as *u8), ws_i(m, y), ws_sd_dk(m, "dz" as *u8)), T_V3I), T_U32), ws_u(m, "4" as *u8)) } |
| 3515 | func ws_sd_dir(m: *i64, shift: *u8) -> i64 { return sir_cast(m, ws_c1(m, "floor" as *u8, ws_bin(m, "+" as *u8, ws_c1(m, "sin" as *u8, ws_bin(m, "+" as *u8, ws_id(m, "a" as *u8, T_F32), ws_f(m, shift), T_F32), T_F32), ws_f(m, SD_HALF), T_F32), T_F32), T_I32) } |
| 3517 | func ws_sd_fade(m: *i64, freq: *u8) -> i64 { return ws_c3(m, "clamp" as *u8, ws_bin(m, "-" as *u8, ws_f(m, "1.0" as *u8), ws_bin(m, "*" as *u8, ws_bin(m, "*" as *u8, ws_f(m, SD_TWO), ws_sd_f(m, "fp" as *u8), T_F32), ws_f(m, freq), T_F32), T_F32), ws_f(m, "0.0" as *u8), ws_f(m, "1.0" as *u8), T_F32) } |
| 3519 | func ws_sd_dslope(m: *i64, a: *u8, b: *u8, k: *u8) -> i64 { return ws_bin(m, "*" as *u8, ws_bin(m, "-" as *u8, ws_sd_f(m, a), ws_sd_f(m, b), T_F32), ws_f(m, k), T_F32) } |
| 3521 | func ws_sd_tilt(m: *i64, s: *u8, g: *u8, rdk: *u8) -> i64 |
| 3528 | func ws_sandcls(m: *i64) -> i64 { return ws_or(m, ws_or(m, ws_beq(m, "1" as *u8), ws_beq(m, "2" as *u8)), ws_beq(m, "5" as *u8)) } |
| 3529 | func ws_sandy(m: *i64) -> i64 { return ws_and(m, ws_smooth(m), ws_sandcls(m)) } |
| 3531 | func ws_shd(m: *i64) -> i64 { return ws_q2(m, ws_li(m, "0.55" as *u8), ws_op(m, "sp" as *u8, T_F32, "*" as *u8, ws_f(m, SD_SHADOW_SPEC))) } |
| 3532 | func ws_fn_sand(m: *i64) -> i64 |
| 3600 | func ws_fn_shade(m: *i64, hty: i64) -> i64 |
| 3698 | func ws_bt(m: *i64, k: *u8, v: *u8, els: i64) -> i64 |
| 3702 | func ws_pxo(m: *i64, a: *u8, op: *u8, e: i64) -> i64 { return ws_cmp(m, op, ws_sx(m, "px" as *u8, T_V2F, a, T_F32), ws_bin(m, "+" as *u8, ws_sx(m, "o" as *u8, T_V2F, a, T_F32), e, T_F32)) } |
| 3708 | func ws_fn_water_hit(m: *i64, hty: i64) -> i64 |
| 3733 | func ws_fn_scene_hit(m: *i64, hty: i64) -> i64 |
| 3765 | func ws_fn_fs(m: *i64, hty: i64) -> i64 |