nx_ir_world_identity_after_t206.nx
buildroot/runtime/nx_ir_world_identity_after_t206.nx
about
nx_wgsl.nx -- THE SHADER BACKENDS: NishiLang in, GLSL and WGSL out.
CONTRACT SYMBOL: wgsl_emit_module (declared _ABSENT_ on the graphics compare board until now).
THE SOURCE IS NISHILANG, NOT GLSL (operator 2026-08-23). This organ is NOT a GLSL->WGSL
transpiler. A shader is authored ONCE against the nx_shader_ir representation; glsl_emit_module
and wgsl_emit_module are two BACKENDS over that one source, exactly as nx_compile_x86 and the
WAT lane are two backends over one NishiLang front-end. Neither dialect is authored, so neither
can drift from the other -- disagreement is impossible BY CONSTRUCTION rather than by discipline.
RUNG 1, SHIPPED HERE: the fullscreen-triangle VERTEX STAGE. It is not a toy -- it is the exact
stage that ships TODAY, hand-written TWICE in nx_game_page_emit:
GLSL VSH : void main(){vec2 v=vec2((gl_VertexID<<1)&2,gl_VertexID&2);gl_Position=vec4(v*2.-1.,0.,1.);}
WGSL vs : @vertex fn vs(@builtin(vertex_index) vi:u32)->@builtin(position) vec4f{...}
Those two hand copies are the duplication this rung deletes: below, ONE NishiLang source
(shsrc_fullscreen_tri) emits both.
WHY THIS STAGE PROVES THE THESIS. The two dialects are not spelling variants of each other:
* GLSL ASSIGNS gl_Position; WGSL RETURNS @builtin(position). Different STRUCTURE.
* GLSL gl_VertexID is i32; WGSL vertex_index is u32 and must be converted before i32 maths.
* WGSL requires a u32 shift amount (1u); GLSL takes a plain int.
* WGSL requires 0.0, never 0. ; GLSL accepts either.
Every one of those is dialect knowledge the BACKEND owns. A translator would have to rediscover
them from GLSL text; a backend simply knows them, once.
COVERED SUBSET (rung 1) -- anything outside REFUSES BY NAME via sir_refuse and returns -1.
A NAMED REFUSAL IS A CONTRACT; A SILENT MISTRANSLATION IN A SHADER BACKEND IS THE WORST
AVAILABLE FAILURE: it compiles, it links, it runs, and it draws the wrong picture forever.
decls : uniform (scalar + array); attribute and varying are GLSL-covered and, since S1
(2026-09-04), WGSL-REFUSED BY NAME (K_ATTRIB anywhere, K_VARY in a fragment stage) until
the entry-parameter derivation that WGSL needs for them lands; a texture-typed uniform
refuses in WGSL too -- it was being emitted INSIDE struct U
S3 (2026-09-04): a TEXTURE is its own kind (K_TEXTURE / sir_texture) in BOTH backends: GLSL
`uniform highp usampler3D`, WGSL a @group/@binding var OUTSIDE struct U with its binding
DERIVED from declaration order; only texture_3d<u32> is covered, other texture types refuse
S4 (2026-09-04): the FRAGMENT entry signature is DERIVED from the declared parameters (no
longer a literal): a sir_param_position parameter is `@builtin(position) name:vec4f` in WGSL and
gl_FragCoord in GLSL; a position READ with no such parameter, and any entry parameter a backend
cannot bind (plain fragment params, any vertex/compute param), refuse by name
stmts : var, assign, return, if/else, discard
dependencies 0 imports · 0 importers
imports: none
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 269 | const NX_BUF_TINY: nx_size = 64 |
| 270 | const NX_BUF_SMALL: nx_size = 256 |
| 271 | const NX_BUF_MEDIUM: nx_size = 4096 |
| 272 | const NX_BUF_LARGE: nx_size = 65536 |
| 273 | const NX_BUF_HUGE: nx_size = 1048576 |
| 277 | const NX_TIER_MCU: nx_int = 0 |
| 278 | const NX_TIER_SOVEREIGN_CHIP: nx_int = 1 |
| 279 | const NX_TIER_FAMILY_DEVICE: nx_int = 2 |
| 280 | const NX_TIER_WORKSTATION: nx_int = 3 |
| 281 | const NX_TIER_SERVER: nx_int = 4 |
| 282 | const NX_TIER_HPC: nx_int = 5 |
| 286 | const NX_NUM_N0_I32: nx_int = 0 |
| 287 | const NX_NUM_N1_I64: nx_int = 1 |
| 288 | const NX_NUM_N2_I128: nx_int = 2 |
| 289 | const NX_NUM_N3_I256: nx_int = 3 |
| 290 | const NX_NUM_N4_I512: nx_int = 4 |
| 291 | const NX_NUM_N5_BIGINT: nx_int = 5 |
| 299 | const NX_SIZEOF_NX_INT: nx_size = 8 // nx_int currently i64 -> 8 bytes |
| 300 | const NX_SIZEOF_NX_SIZE: nx_size = 8 // nx_size always pointer-width |
| 301 | const NX_SIZEOF_NX_IDX: nx_size = 8 // nx_idx alias of nx_size |
| 305 | const NX_FD_STDIN: nx_fd = 0 |
| 306 | const NX_FD_STDOUT: nx_fd = 1 |
| 307 | const NX_FD_STDERR: nx_fd = 2 |
| 309 | const SYS_MAGIC_1024: i64 = 1024 |
| 310 | const SYS_MAGIC_1000000: i64 = 1000000 |
| 311 | const SYS_MAGIC_4294967296: i64 = 4294967296 |
| 313 | const SYS_READ_GROW_INIT: i64 = 65536 |
| 314 | const SYS_MAGIC_100000: i64 = 100000 |
| 332 | const SYS_READ: i64 = 0 |
| 333 | const SYS_WRITE: i64 = 1 |
| 334 | const SYS_CLOSE: i64 = 3 |
| 335 | const SYS_LSEEK: i64 = 8 |
| 336 | const SYS_OPENAT: i64 = 257 |
| 337 | const SYS_EXIT: i64 = 60 |
| 338 | const SYS_MMAP: i64 = 9 |
| 339 | const SYS_CLOCK_GETTIME: i64 = 228 |
| 340 | const SYS_IOCTL: i64 = 16 |
| 341 | const SYS_CLOCK_NANOSLEEP: i64 = 230 |
| 345 | const SYS_CHROOT: i64 = 161 |
| 346 | const SYS_MOUNT: i64 = 165 |
| 347 | const SYS_UNSHARE: i64 = 272 |
| 348 | const SYS_GETUID: i64 = 102 |
| 349 | const SYS_GETGID: i64 = 104 |
| 350 | const SYS_POLL: i64 = 7 |
| 354 | const SYS_READ: i64 = 63 |
| 355 | const SYS_WRITE: i64 = 64 |
| 356 | const SYS_CLOSE: i64 = 57 |
| 357 | const SYS_LSEEK: i64 = 62 |
| 358 | const SYS_OPENAT: i64 = 56 |
| 359 | const SYS_EXIT: i64 = 93 |
| 360 | const SYS_MMAP: i64 = 222 |
| 361 | const SYS_CLOCK_GETTIME: i64 = 113 |
| 362 | const SYS_IOCTL: i64 = 29 |
| 363 | const SYS_CLOCK_NANOSLEEP: i64 = 115 |
| 370 | const SYS_CHROOT: i64 = 51 |
| 371 | const SYS_MOUNT: i64 = 40 |
| 372 | const SYS_UNSHARE: i64 = 97 |
| 373 | const SYS_GETUID: i64 = 174 |
| 374 | const SYS_GETGID: i64 = 176 |
| 375 | const SYS_POLL: i64 = 73 |
| 433 | const SYS_PATH_MAX: i64 = 4096 // Linux PATH_MAX; getcwd returns -ERANGE below it |
| 437 | const MODE_0755: i64 = 0x1ed // rwxr-xr-x : default mode for a created directory |
| 452 | const AT_FDCWD: i64 = -100 |
| 557 | const NX_MO_RELAXED: i64 = 0 |
| 558 | const NX_MO_CONSUME: i64 = 1 |
| 559 | const NX_MO_ACQUIRE: i64 = 2 |
| 560 | const NX_MO_RELEASE: i64 = 3 |
| 561 | const NX_MO_ACQ_REL: i64 = 4 |
| 562 | const NX_MO_SEQ_CST: i64 = 5 |
| 564 | const NXA_SMALL_MAX: i64 = 256 |
| 565 | const NXA_CHUNK: i64 = 262144 |
| 566 | const NXA_ALIGN: i64 = 16 |
| 567 | const NXA_GAP: i64 = 16 |
| 568 | const NXA_STATE: i64 = 4096 |
| 574 | const NXA_RING: i64 = 128 |
| 575 | const NXA_RBASE: i64 = 64 |
| 610 | const NXA_LOCK: i64 = 4 |
| 618 | const NXA_LOCK_WARN: i64 = NXA_RING * 8 |
| 622 | const NXA_LOCK_WARNED: i64 = 5 |
| 624 | const NXA_CHUNKBASE: i64 = 320 |
| 625 | const NXA_CHUNKMAX: i64 = 192 |
| 646 | const NXA_MAP_INVALID:i64=0-22 // Linux EINVAL, a protocol value rather than a resource budget. |
| 698 | const SYS_STATFS_X86_MEASURED: i64 = 137 |
| 699 | const STATFS_BUF_BYTES: i64 = 144 |
| 700 | const STATFS_I_BSIZE: i64 = 1 |
| 701 | const STATFS_I_BLOCKS: i64 = 2 |
| 702 | const STATFS_I_BAVAIL: i64 = 4 |
| 703 | const STATFS_PERMIL: i64 = 1000 |
| 704 | const STATFS_ERR: i64 = 0 - 1 |
| 1049 | const O_RDONLY: i64 = 0 |
| 1050 | const O_WRONLY_CT: i64 = 0x241 // O_CREAT | O_WRONLY | O_TRUNC |
| 1051 | const O_WRONLY_CA: i64 = 0x441 // O_CREAT | O_WRONLY | O_APPEND |
| 1059 | const O_RDWR_CREATE: i64 = 0x42 |
| 1080 | const MODE_0644: i64 = 0x1a4 // rw-r--r-- : default mode for a generated artifact |
| 1085 | const MODE_0755: i64 = 0x1ed |
| 1098 | const ACCEPT_TMO_S: i64 = 30 |
| 1105 | const O_WRONLY_CREATE_EXCLUSIVE: i64 = 0x1 | 0x40 | 0x80 |
| 1111 | const O_DIRECTORY: i64 = 0x10000 |
| 1125 | const O_CLOEXEC: i64 = 0x80000 |
| 1126 | const O_NOFOLLOW: i64 = 0x20000 |
| 1127 | const O_NONBLOCK: i64 = 0x800 |
| 1128 | const MODE_0600: i64 = 0x180 |
| 1193 | const SYS_LOCK_SH: i64 = 1 |
| 1194 | const SYS_LOCK_EX: i64 = 2 |
| 1195 | const SYS_LOCK_NB: i64 = 4 |
| 1196 | const SYS_LOCK_UN: i64 = 8 |
| 1241 | const SYS_SETPGID: i64 = 109 |
| 1244 | const SYS_SETPGID: i64 = 154 |
| 1267 | const RLIMIT_CPU: i64 = 0 |
| 1268 | const RLIMIT_AS: i64 = 9 |
| 1269 | const WNOHANG: i64 = 1 |
| 1363 | const SYS_CLONE: i64 = 56 |
| 1364 | const SYS_EXECVE: i64 = 59 |
| 1365 | const SYS_WAIT4: i64 = 61 |
| 1366 | const SYS_PIPE2: i64 = 293 |
| 1367 | const SYS_DUP3: i64 = 292 |
| 1371 | const SYS_CLONE: i64 = 220 |
| 1372 | const SYS_EXECVE: i64 = 221 |
| 1373 | const SYS_WAIT4: i64 = 260 |
| 1374 | const SYS_PIPE2: i64 = 59 |
| 1375 | const SYS_DUP3: i64 = 24 |
| 1381 | const CLONE_VM: i64 = 0x00000100 |
| 1382 | const CLONE_VFORK: i64 = 0x00004000 |
| 1383 | const SIGCHLD: i64 = 17 |
| 1433 | const NX_SYS_PRCTL: i64 = 167 |
| 1434 | const NX_PR_SET_PDEATHSIG: i64 = 1 |
| 1435 | const NX_PR_SET_CHILD_SUBREAPER: i64 = 36 |
| 1450 | const SYS_WAITID_PORTABLE: i64 = 95 |
| 1451 | const NX_WAIT_P_PID: i64 = 1 |
| 1452 | const NX_WAIT_EXITED: i64 = 4 |
| 1453 | const NX_WAIT_NOWAIT: i64 = 0x01000000 |
| 1454 | const NX_WAIT_SIGINFO_BYTES: i64 = 128 |
| 1461 | const NX_FD_DENT_BUFFER: i64 = 4096 |
| 1462 | const NX_SYS_CLOSE_RANGE: i64 = 436 // Linux x86_64 and asm-generic ABI |
| 1463 | const NX_FD_UINT_MAX: i64 = 4294967295 |
| 1635 | const SYS_GETDENTS64: i64 = 217 |
| 1638 | const SYS_GETDENTS64: i64 = 61 |
| 1641 | const DT_UNKNOWN: i64 = 0 |
| 1642 | const DT_FIFO: i64 = 1 |
| 1643 | const DT_CHR: i64 = 2 |
| 1644 | const DT_DIR: i64 = 4 |
| 1645 | const DT_BLK: i64 = 6 |
| 1646 | const DT_REG: i64 = 8 |
| 1647 | const DT_LNK: i64 = 10 |
| 1648 | const DT_SOCK: i64 = 12 |
| 1836 | const SYS_SOCKET: i64 = 41 |
| 1837 | const SYS_BIND: i64 = 49 |
| 1838 | const SYS_LISTEN: i64 = 50 |
| 1839 | const SYS_ACCEPT: i64 = 43 |
| 1840 | const SYS_CONNECT: i64 = 42 |
| 1841 | const SYS_SETSOCKOPT: i64 = 54 |
| 1842 | const SYS_SENDTO: i64 = 44 |
| 1843 | const SYS_RECVFROM: i64 = 45 |
| 1844 | const SYS_SHUTDOWN: i64 = 48 |
| 1848 | const SYS_SOCKET: i64 = 198 |
| 1849 | const SYS_BIND: i64 = 200 |
| 1850 | const SYS_LISTEN: i64 = 201 |
| 1851 | const SYS_ACCEPT: i64 = 202 |
| 1852 | const SYS_CONNECT: i64 = 203 |
| 1853 | const SYS_SETSOCKOPT: i64 = 208 |
| 1854 | const SYS_SENDTO: i64 = 206 |
| 1855 | const SYS_RECVFROM: i64 = 207 |
| 1856 | const SYS_SHUTDOWN: i64 = 210 |
| 1860 | const SOL_SOCKET: i64 = 1 |
| 1861 | const SO_REUSEADDR: i64 = 2 |
| 1866 | const SO_SNDTIMEO: i64 = 21 |
| 1867 | const SO_RCVTIMEO: i64 = 20 |
| 1895 | const SYS_ALARM: i64 = 37 |
| 1898 | const AF_INET: i64 = 2 |
| 1899 | const SOCK_STREAM: i64 = 1 |
| 1900 | const SOCK_DGRAM: i64 = 2 |
| 2006 | const SYS_SENDMSG: i64 = 46 |
| 2007 | const SYS_RECVMSG: i64 = 47 |
| 2008 | const SYS_SOCKETPAIR: i64 = 53 |
| 2009 | const SCM_AF_UNIX: i64 = 1 |
| 2010 | const SCM_SOL_SOCKET: i64 = 1 |
| 2011 | const SCM_RIGHTS_TYPE: i64 = 1 |
| 2012 | const SCM_MSG_CMSG_CLOEXEC: i64 = 1073741824 |
| 2013 | const SCM_MSGHDR_BYTES: i64 = 56 |
| 2014 | const SCM_MSGHDR_OFF_IOV: i64 = 16 |
| 2015 | const SCM_MSGHDR_OFF_IOVLEN: i64 = 24 |
| 2016 | const SCM_MSGHDR_OFF_CTRL: i64 = 32 |
| 2017 | const SCM_MSGHDR_OFF_CTRLLEN: i64 = 40 |
| 2018 | const SCM_IOVEC_BYTES: i64 = 16 |
| 2019 | const SCM_IOVEC_OFF_BASE: i64 = 0 |
| 2020 | const SCM_IOVEC_OFF_LEN: i64 = 8 |
| 2021 | const SCM_CMSG_OFF_LEN: i64 = 0 |
| 2022 | const SCM_CMSG_OFF_LEVEL: i64 = 8 |
| 2023 | const SCM_CMSG_OFF_TYPE: i64 = 12 |
| 2024 | const SCM_CMSG_OFF_DATA: i64 = 16 |
| 2025 | const SCM_CMSG_LEN_1FD: i64 = 20 |
| 2026 | const SCM_CMSG_SPACE_1FD: i64 = 24 |
| 2027 | const SCM_IOV_COUNT_ONE: i64 = 1 |
| 2028 | const SCM_U32_BYTES: i64 = 4 |
| 2029 | const SCM_BYTE_RADIX: i64 = 256 |
| 2030 | const SCM_FDPAIR_BYTES: i64 = 8 |
| 2033 | const SCM_PAYLOAD_BYTES: i64 = 1 |
| 2034 | const SCM_PAYLOAD_BYTE: i64 = 70 |
| 2038 | const SCM_ERR_NO_CMSG: i64 = 0 - 901 |
| 2039 | const SCM_ERR_CMSG_LEN: i64 = 0 - 902 |
| 2040 | const SCM_ERR_CMSG_LEVEL: i64 = 0 - 903 |
| 2041 | const SCM_ERR_CMSG_TYPE: i64 = 0 - 904 |
| 2113 | const SCM_SUN_PATH_OFF: i64 = 2 // sockaddr_un = [sa_family: u16][sun_path: 108] |
| 2114 | const SCM_SUN_BYTES: i64 = 110 |
| 2115 | const SCM_SUN_PATH_MAX: i64 = 107 |
| 2304 | const SIR_SLOTS: i64 = 8 |
| 2309 | const SIR_MAXNODE: i64 = 16384 |
| 2310 | const SIR_POOLCAP: i64 = 65536 |
| 2312 | const SIR_KIND: i64 = 0 |
| 2313 | const SIR_TY: i64 = 1 |
| 2314 | const SIR_A: i64 = 2 |
| 2315 | const SIR_B: i64 = 3 |
| 2316 | const SIR_C: i64 = 4 |
| 2317 | const SIR_NAME: i64 = 5 |
| 2318 | const SIR_D: i64 = 6 |
| 2319 | const SIR_NEXT: i64 = 7 |
| 2322 | const M_NODES: i64 = 0 |
| 2323 | const M_NCOUNT: i64 = 1 |
| 2324 | const M_POOL: i64 = 2 |
| 2325 | const M_POOLUSED: i64 = 3 |
| 2326 | const M_DECLH: i64 = 4 |
| 2327 | const M_DECLT: i64 = 5 |
| 2328 | const M_FUNCH: i64 = 6 |
| 2329 | const M_FUNCT: i64 = 7 |
| 2330 | const M_REFUSE: i64 = 8 |
| 2331 | const M_OVER: i64 = 9 |
| 2336 | const M_CURFN: i64 = 10 |
| 2343 | const M_FRAGOUT: i64 = 11 |
| 2348 | const M_VIOMODE: i64 = 12 |
| 2353 | const M_USESII: i64 = 13 |
| 2360 | const M_WGFRAGOUT: i64 = 14 |
| 2366 | const M_BINDGROUP: i64 = 15 |
| 2369 | const M_CLIP_DEPTH: i64 = 16 |
| 2370 | const SIR_MODULE_WORDS: i64 = 17 |
| 2371 | const SIR_CLIP_NATIVE: i64 = 0 |
| 2372 | const SIR_CLIP_NEGATIVE_ONE_TO_ONE: i64 = 1 |
| 2374 | const SIR_LIT_USUFFIX: i64 = 1 |
| 2377 | const K_UNIFORM: i64 = 1 |
| 2378 | const K_ATTRIB: i64 = 2 |
| 2379 | const K_VARY: i64 = 3 |
| 2380 | const K_FUNC: i64 = 4 |
| 2381 | const K_PARAM: i64 = 5 |
| 2389 | const K_STORAGE: i64 = 6 |
| 2396 | const K_TEXTURE: i64 = 7 |
| 2407 | const K_FRAGOUT: i64 = 8 |
| 2415 | const K_STRUCT: i64 = 9 |
| 2416 | const S_RETURN: i64 = 10 |
| 2417 | const S_ASSIGN: i64 = 11 |
| 2418 | const S_VAR: i64 = 12 |
| 2419 | const S_IF: i64 = 13 |
| 2420 | const S_DISCARD: i64 = 14 |
| 2428 | const S_LOOP: i64 = 15 |
| 2429 | const S_BREAK: i64 = 16 |
| 2433 | const S_EXPR: i64 = 17 |
| 2434 | const E_LIT: i64 = 20 |
| 2435 | const E_IDENT: i64 = 21 |
| 2436 | const E_BIN: i64 = 22 |
| 2437 | const E_CALL: i64 = 23 |
| 2438 | const E_SWZ: i64 = 24 |
| 2439 | const E_INDEX: i64 = 25 |
| 2440 | const E_TEXLOAD: i64 = 26 |
| 2441 | const E_TEXSAMPLE: i64 = 27 |
| 2442 | const E_CTOR: i64 = 28 |
| 2446 | const E_CAST: i64 = 29 |
| 2447 | const E_BUILTIN: i64 = 30 |
| 2452 | const E_ATOMIC: i64 = 31 |
| 2458 | const E_SELECT: i64 = 32 |
| 2462 | const E_NEG: i64 = 33 |
| 2468 | const K_PRIVATE: i64 = 34 |
| 2474 | const E_NOT: i64 = 35 |
| 2477 | const T_VOID: i64 = 0 |
| 2478 | const T_F32: i64 = 1 |
| 2479 | const T_I32: i64 = 2 |
| 2480 | const T_U32: i64 = 3 |
| 2481 | const T_BOOL: i64 = 4 |
| 2482 | const T_V2F: i64 = 5 |
| 2483 | const T_V3F: i64 = 6 |
| 2484 | const T_V4F: i64 = 7 |
| 2485 | const T_V3I: i64 = 8 |
| 2486 | const T_TEX3U: i64 = 9 |
| 2487 | const T_TEX2F: i64 = 10 |
| 2489 | const T_V3U: i64 = 11 |
| 2492 | const T_V2I: i64 = 12 |
| 2496 | const T_M3F: i64 = 13 |
| 2497 | const T_MAX: i64 = 13 |
| 2648 | const P_PLAIN: i64 = 0 |
| 2649 | const P_BUILTIN_POSITION: i64 = 1 |
| 2731 | const SIR_VAR_CONST: i64 = 2 |
| 2770 | 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
| 378 | func sys_ioctl(fd: i64, request: i64, arg: i64) -> i64 |
| 389 | func sys_poll(fds: *u8, nfds: i64, timeout_ms: i64) -> i64 |
| 395 | func sys_write(fd: i64, buf: *u8, count: i64) -> i64 |
| 399 | func sys_read(fd: i64, buf: *u8, count: i64) -> i64 called by 1: sys_read_file |
| 403 | func sys_close(fd: i64) -> i64 |
| 413 | func sys_chdir(path: *u8) -> i64 calls 1: sys_mmap |
| 438 | func sys_getcwd(buf: *u8, cap: i64) -> i64 calls 1: sys_mmap |
| 457 | func sys_unlinkat(path: *u8) -> i64 |
| 464 | func sys_fchmodat(path: *u8, mode: i64) -> i64 calls 1: sys_mmap |
| 480 | func sys_exit_group(code: i64) -> i64 |
| 497 | func sys_setpriority(prio: i64) -> i64 |
| 505 | func sys_setpriority_of(pid: i64, prio: i64) -> i64 |
| 647 | func sys_munmap_direct(addr:*u8,len:i64)->i64 |
| 652 | func sys_munmap(addr: *u8, len: i64) -> i64 |
| 659 | func sys_lseek(fd: i64, offset: i64, whence: i64) -> i64 |
| 707 | func sys_statfs(path: *u8, buf: *i64) -> i64 |
| 712 | func sys_fs_avail_bytes(path: *u8) -> i64 |
| 721 | func sys_fs_used_permil(path: *u8) -> i64 |
| 730 | func sys_exit(code: i64) -> i64 called by 1: nxa_die |
| 764 | func nxa_dump_printable(src: i64, n: i64) -> i64 |
| 785 | func nxa_dump_sizes() -> i64 |
| 810 | func nxa_report_overrun(sz: i64, gs: i64) -> i64 |
| 840 | func nxa_die(msg: *u8) -> i64 |
| 850 | func nxa_lock_addr() -> *i64 |
| 858 | func nxa_lock_take() -> i64 |
| 887 | func nxa_lock_give() -> i64 |
| 901 | func sys_mmap_try(size:i64)->*u8 |
| 908 | func sys_mmap(size: i64) -> *u8 |
| 990 | func sys_arena_mark() -> i64 calls 1: sys_mmap |
| 1004 | func sys_arena_reset() -> i64 |
| 1028 | func sys_mmap_shared(size: i64) -> *u8 |
| 1042 | func sys_madvise(addr: *u8, len: i64, advice: i64) -> i64 |
| 1053 | func sys_openat_rd(path: *u8) -> i64 |
| 1060 | func sys_openat_rdwr(path: *u8, mode: i64) -> i64 |
| 1099 | func sys_openat_wr(path: *u8, mode: i64) -> i64 |
| 1106 | func sys_openat_exclusive(path: *u8, mode: i64) -> i64 |
| 1112 | func sys_openat_directory(path: *u8) -> i64 |
| 1119 | func sys_openat_append(path: *u8, mode: i64) -> i64 |
| 1129 | func sys_openat_lock(path: *u8) -> i64 |
| 1137 | func sys_symlinkat(target: *u8, linkpath: *u8) -> i64 |
| 1149 | func sys_readlinkat(path: *u8, buf: *u8, cap: i64) -> i64 |
| 1166 | func sys_renameat(oldpath: *u8, newpath: *u8) -> i64 |
| 1179 | func sys_fsync(fd: i64) -> i64 |
| 1197 | func sys_flock(fd: i64, op: i64) -> i64 |
| 1205 | func sys_fstatat(path: *u8, statbuf: *u8) -> i64 |
| 1212 | func sys_utimensat(path: *u8, times: *i64) -> i64 |
| 1231 | func nx_kill(pid: i64, sig: i64) -> i64 { return __syscall(129, pid, sig, 0, 0, 0, 0) } |
| 1246 | func sys_setpgid(pid: i64, pgid: i64) -> i64 { return __syscall(SYS_SETPGID, pid, pgid, 0, 0, 0, 0) } |
| 1260 | func nx_prlimit(pid: i64, resource: i64, new_limit: *u8, old_limit: *u8) -> i64 |
| 1272 | func sys_mkdir(path: *u8, mode: i64) -> i64 { return __syscall(34, AT_FDCWD, path, mode, 0, 0, 0) } |
| 1275 | func nx_chmod(path: *u8, mode: i64) -> i64 { return __syscall(53, AT_FDCWD, path, mode, 0, 0, 0) } |
| 1279 | func nx_setsid() -> i64 { return __syscall(112, 0, 0, 0, 0, 0, 0) } |
| 1283 | func sys_clock_gettime_mono(ts: *i64) -> i64 |
| 1291 | func sys_clock_gettime_real(ts: *i64) -> i64 |
| 1296 | func sys_now_realtime_sec() -> i64 |
| 1303 | func sys_now_realtime_ms() -> i64 |
| 1315 | func sys_now_realtime_us() -> i64 |
| 1324 | func sys_now_ms() -> i64 |
| 1335 | func sys_now_us() -> i64 |
| 1346 | func sys_clock_now_us() -> i64 calls 1: sys_now_us |
| 1396 | func sys_unshare(flags: i64) -> i64 |
| 1399 | func sys_mount(source: *u8, target: *u8, fs_type: *u8, mountflags: i64, data: *u8) -> i64 |
| 1402 | func sys_chroot(path: *u8) -> i64 |
| 1405 | func sys_getuid() -> i64 |
| 1408 | func sys_getgid() -> i64 |
| 1412 | func sys_fork() -> i64 |
| 1436 | func sys_prctl(option: i64, arg: i64) -> i64 called by 1: sys_bind_parent_lifetime |
| 1439 | func sys_bind_parent_lifetime(expected_parent: i64, signal: i64) -> i64 calls 1: sys_prctl |
| 1455 | func sys_waitid(idtype: i64, id: i64, info: *u8, options: i64) -> i64 |
| 1464 | func sys_close_inherited_proc(first: i64) -> i64 called by 1: sys_close_inherited calls 6: sys_openat_rdsys_mmapsys_getdents64dirent_reclensys_closesys_munmap |
| 1505 | func sys_close_inherited(first: i64) -> i64 |
| 1511 | func sys_execve_clean(path: *u8, argv: *i64, envp: *i64) -> i64 |
| 1517 | func sys_execve(path: *u8, argv: *i64, envp: *i64) -> i64 called by 1: sys_execve_clean |
| 1526 | func sys_wait4(pid: i64, status: *i64, options: i64) -> i64 |
| 1532 | func wait_exit_code(status: i64) -> i64 called by 1: wait_status_rc |
| 1540 | func wait_term_signal(status: i64) -> i64 called by 1: wait_status_rc |
| 1565 | func wait_status_rc(status: i64) -> i64 |
| 1588 | func sys_default_signal(sig: i64) -> i64 calls 1: sys_mmap |
| 1597 | func sys_ignore_sigpipe() -> i64 calls 1: sys_mmap |
| 1612 | func sys_pipe2(fds: *i64, flags: i64) -> i64 |
| 1618 | func sys_dup3(oldfd: i64, newfd: i64, flags: i64) -> i64 |
| 1652 | func sys_getdents64(fd: i64, buf: *u8, buf_len: i64) -> i64 called by 1: sys_close_inherited_proc |
| 1658 | func dirent_reclen(rec: *u8) -> i64 called by 1: sys_close_inherited_proc |
| 1665 | func dirent_type(rec: *u8) -> i64 |
| 1670 | func dirent_name(rec: *u8) -> *u8 |
| 1677 | func sys_read_file(path: *u8, out_len: *i64) -> *u8 |
| 1759 | func sys_free_file(buf: *u8, len: i64) -> i64 calls 1: sys_munmap |
| 1770 | func sys_map_file(path: *u8, out_len: *i64) -> *u8 |
| 1788 | func sys_sleep_ms(ms: i64) -> i64 |
| 1872 | func sys_setsockopt(fd: i64, level: i64, optname: i64, called by 1: sys_set_socket_timeout |
| 1882 | func sys_set_socket_timeout(fd: i64, secs: i64) -> i64 |
| 1896 | func sys_alarm(secs: i64) -> i64 { return __syscall(SYS_ALARM, secs, 0, 0, 0, 0, 0) } |
| 1902 | func sys_socket(domain: i64, sock_type: i64, protocol: i64) -> i64 |
| 1914 | func sockaddr_in_init(addr: *u8, port: i64) -> i64 |
| 1937 | func sys_bind(fd: i64, addr: *u8, addr_len: i64) -> i64 called by 1: sys_unix_listen |
| 1940 | func sys_listen(fd: i64, backlog: i64) -> i64 called by 1: sys_unix_listen |
| 1947 | func sys_accept(fd: i64) -> i64 |
| 1950 | func sys_accept_with_addr(fd: i64, addr: *u8, addr_len: *i64) -> i64 |
| 1954 | func sys_shutdown(fd: i64, how: i64) -> i64 |
| 1957 | func sys_connect(fd: i64, addr: *u8, addr_len: i64) -> i64 called by 1: sys_unix_connect_fd |
| 1960 | func sys_sendto(fd: i64, buf: *u8, n: i64, flags: i64, |
| 1964 | func sys_recvfrom(fd: i64, buf: *u8, n: i64, flags: i64, |
| 2043 | func scm_zero(base: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { base[i] = 0; i = i + 1 } return 0 } |
| 2044 | func scm_put_i64(base: *u8, off: i64, v: i64) -> i64 |
| 2049 | func scm_get_i64(base: *u8, off: i64) -> i64 called by 1: sys_recv_fd |
| 2056 | func scm_put_u32(base: *u8, off: i64, v: i64) -> i64 called by 1: sys_send_fd |
| 2066 | func scm_get_u32(base: *u8, off: i64) -> i64 called by 1: sys_recv_fd |
| 2078 | func sys_sendmsg(fd: i64, msg: *u8, flags: i64) -> i64 called by 1: sys_send_fd |
| 2081 | func sys_recvmsg(fd: i64, msg: *u8, flags: i64) -> i64 called by 1: sys_recv_fd |
| 2105 | func sys_socketpair(domain: i64, sock_type: i64, protocol: i64, sv: *u8) -> i64 |
| 2116 | func sys_unix_listen(path: *u8, backlog: i64) -> i64 |
| 2144 | func sys_unix_connect_fd(path: *u8) -> i64 |
| 2168 | func sys_send_fd(sock: i64, fd: i64) -> i64 |
| 2202 | func sys_recv_fd(sock: i64, flags: i64) -> i64 |
| 2499 | func sir_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 2501 | func sir_new() -> *i64 calls 1: sys_mmap |
| 2518 | func sir_get(m: *i64, id: i64, k: i64) -> i64 |
| 2523 | func sir_set(m: *i64, id: i64, k: i64, v: i64) -> i64 |
| 2531 | func sir_str(m: *i64, s: *u8) -> i64 |
| 2545 | func sir_cstr(m: *i64, off: i64) -> *u8 |
| 2549 | func sir_node(m: *i64, kind: i64, ty: i64, a: i64, b: i64, c: i64, nameoff: i64) -> i64 |
| 2565 | func sir_chain(m: *i64, hw: i64, tw: i64, id: i64) -> i64 |
| 2575 | func sir_uniform(m: *i64, name: *u8, ty: i64, arraylen: i64) -> i64 |
| 2581 | func sir_private(m: *i64, name: *u8, ty: i64, arraylen: i64) -> i64 |
| 2586 | func sir_attrib(m: *i64, name: *u8, ty: i64, location: i64) -> i64 |
| 2591 | func sir_vary(m: *i64, name: *u8, ty: i64, location: i64, flat: i64) -> i64 |
| 2598 | func sir_storage(m: *i64, name: *u8, elemty: i64, binding: i64, readwrite: i64, atomic: i64) -> i64 |
| 2604 | func sir_texture(m: *i64, name: *u8, ty: i64) -> i64 |
| 2611 | func sir_fragout(m: *i64, name: *u8, ty: i64, location: i64) -> i64 |
| 2621 | func sir_struct(m: *i64, name: *u8) -> i64 |
| 2625 | func sir_member(m: *i64, st: i64, name: *u8, ty: i64) -> i64 { return sir_param(m, st, name, ty) } |
| 2626 | func sir_struct_ty(st: i64) -> i64 { return SIR_MAXNODE + st } |
| 2628 | func sir_struct_of(m: *i64, ty: i64) -> i64 calls 1: sir_get |
| 2635 | func sir_member_of(m: *i64, base: i64, name: *u8, ty: i64) -> i64 { return sir_swz(m, base, name, ty) } |
| 2638 | 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 |
| 2651 | 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 |
| 2660 | func sir_param_position(m: *i64, fn: i64, name: *u8) -> i64 |
| 2667 | func sir_stmt(m: *i64, fn: i64, st: i64) -> i64 |
| 2676 | func sir_return(m: *i64, e: i64) -> i64 { return sir_node(m, S_RETURN, T_VOID, e, 0, 0, 0) } |
| 2679 | func sir_return_depth(m: *i64, color: i64, depth: i64) -> i64 calls 1: sir_node |
| 2683 | func sir_assign(m: *i64, lhs: i64, rhs: i64) -> i64 { return sir_node(m, S_ASSIGN, T_VOID, lhs, rhs, 0, 0) } |
| 2684 | 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)) } |
| 2685 | func sir_if(m: *i64, cond: i64, thenh: i64, elseh: i64) -> i64 { return sir_node(m, S_IF, T_VOID, cond, thenh, elseh, 0) } |
| 2686 | func sir_discard(m: *i64) -> i64 { return sir_node(m, S_DISCARD, T_VOID, 0, 0, 0, 0) } calls 1: sir_node |
| 2690 | func sir_loop(m: *i64, body: i64) -> i64 { return sir_node(m, S_LOOP, T_VOID, body, 0, 0, 0) } |
| 2691 | func sir_break(m: *i64) -> i64 { return sir_node(m, S_BREAK, T_VOID, 0, 0, 0, 0) } |
| 2693 | func sir_expr(m: *i64, e: i64) -> i64 { return sir_node(m, S_EXPR, T_VOID, e, 0, 0, 0) } |
| 2702 | 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 |
| 2711 | func sir_seq(m: *i64, a: i64, b: i64) -> i64 |
| 2720 | func sir_lit(m: *i64, text: *u8, ty: i64) -> i64 { return sir_node(m, E_LIT, ty, 0, 0, 0, sir_str(m, text)) } |
| 2724 | func sir_lit_u(m: *i64, text: *u8) -> i64 |
| 2732 | func sir_const(m: *i64, name: *u8, ty: i64, init: i64) -> i64 |
| 2737 | func sir_ident(m: *i64, name: *u8, ty: i64) -> i64 { return sir_node(m, E_IDENT, ty, 0, 0, 0, sir_str(m, name)) } |
| 2738 | 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)) } |
| 2739 | 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)) } |
| 2740 | func sir_index(m: *i64, base: i64, idx: i64, ty: i64) -> i64 { return sir_node(m, E_INDEX, ty, base, idx, 0, 0) } |
| 2744 | func sir_texload(m: *i64, tex: i64, coord: i64, lod: i64) -> i64 |
| 2749 | 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 |
| 2752 | func sir_call(m: *i64, name: *u8, ty: i64) -> i64 { return sir_node(m, E_CALL, ty, 0, 0, 0, sir_str(m, name)) } |
| 2753 | func sir_ctor(m: *i64, ty: i64) -> i64 { return sir_node(m, E_CTOR, ty, 0, 0, 0, 0) } |
| 2754 | func sir_cast(m: *i64, e: i64, ty: i64) -> i64 { return sir_node(m, E_CAST, ty, e, 0, 0, 0) } |
| 2755 | func sir_builtin(m: *i64, which: *u8, ty: i64) -> i64 |
| 2761 | 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)) } |
| 2763 | 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) } |
| 2765 | func sir_neg(m: *i64, e: i64, ty: i64) -> i64 { return sir_node(m, E_NEG, ty, e, 0, 0, 0) } |
| 2767 | func sir_not(m: *i64, e: i64) -> i64 { return sir_node(m, E_NOT, T_BOOL, e, 0, 0, 0) } |
| 2771 | func sir_let(m: *i64, name: *u8, ty: i64, init: i64) -> i64 |
| 2777 | func sir_arg(m: *i64, callid: i64, e: i64) -> i64 |
| 2794 | func sir_refuse(m: *i64, what: *u8) -> i64 calls 1: sir_str |
| 2798 | func sir_refused(m: *i64) -> i64 { return m[M_REFUSE] } |
| 2801 | func eb_put(out: *u8, pos: i64, cap: i64, s: *u8) -> i64 |
| 2809 | func eb_num(out: *u8, pos: i64, cap: i64, v: i64) -> i64 |
| 2826 | 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, near_depth:i64, far_depth:i64) -> i64 |