nx_cast_surface_scope_expanded_t181.nx
buildroot/runtime/nx_cast_surface_scope_expanded_t181.nx
about
nx_cast_shader_src.nx -- THE CHARACTER CAST VERTEX STAGE, WRITTEN ONCE (gameengine S12c, 2026-09-05).
The cast vertex shader that nx_game_page_emit ships as the hand-written GLSL literal MVS (extracted to the board as
buildroot/knowledge/compare/cast_mvs_hand.glsl, 2,485 raw / 2,521 expanded / 3,097 canonical tokens) is transcribed here
SLICE BY SLICE as shader-IR builder calls, so that BOTH dialects are emitted from one source: GLSL for the WebGL2 door
(proven against the hand text by nx_glsl_tokdiff -- an emitted slice is accepted when its canonical token stream is a PREFIX
of the hand's up to main's closing brace, slice_prefix=1, and the whole stage when the verdict reads IDENTICAL) and WGSL for
the WebGPU door (the S12 cast pipeline). The vocabulary is nx_world_shader_src's ws_* shorthands over nx_shader_ir; nothing
here re-implements a builder. RULES THAT KEEP THE CANONICAL FORM REACHABLE: a negative literal is sir_neg over the positive
literal ((-999.0), never a "-999.0" literal); every literal is spelled with the hand's own digits, canonically (0.5 not .5,
0.930 not 0.93 -- the ruler canonicalises spelling, never value); a compound assignment is x=(x op (y)); left-associative
chains are built left-nested exactly as the grammar parses them; the hand's grouping parentheses are simply the tree's shape.
The f32 uniform arrays the hand declares (uOF uGB uGT uGN, float[12]) are declared EXACTLY as the hand does -- the
uniform-space stride rule is a WGSL-dialect fact and belongs in the WGSL backend's lowering (S12c-2b), never in this source.
SLICES (each measured, journaled on gameengine.plan under GE59):
1 declarations + hsh + the instance/lock prologue (through vII=ii;) -- MEASURED 602/3097 canonical, slice_prefix
2 dual-quaternion skinning off the joint table, garment displacement, the PASS-1 face cut, the y-up rotation and world
placement (through vec3 wp=...;)
3 soft-body fields (hb2, sbo over the DYNA anchors, hair wind, dress inheritance, the body branch), wp+=sbo
4 garment degeneration, the cast-shadow projection, vW, the clip transform (gl_Position)
license_tier: ORIGINAL No hw writes (Rule 26).
nx_world_shader_src.nx -- THE WORLD SHADER, WRITTEN ONCE (gameengine GE44 R-G, 2026-09-04).
The voxel world pass that nx_game_page_emit ships hand-written twice (a GLSL FSH for the WebGL2 door and a WGSL
module for the WebGPU door) is authored here ONCE as shader-IR builder calls and emitted to BOTH dialects by
nx_wgsl. Every function below is the hand WGSL, statement for statement (vx, h21, h31, pal9, sky, struct Hit,
march, shade, the fragment entry); the vertex entry is the backend's own fullscreen triangle (shsrc_fullscreen_tri).
Deliberate deltas from the hand text, all semantic no-ops: compound assignments are spelled x=(x+y); unsigned
constants are casts (u32(0) / uint(0)) because the GLSL backend spells a u32 literal without its suffix and a bare 0
beside a uint is a GLSL type error; the WebGPU top-left fragment origin is carried as the uniform `yflip` (1 on the
WebGPU door, 0 on WebGL2) instead of a per-dialect edit, so ONE source serves both doors. The uniform block is
declared ONCE here (ws_world_uniforms) and `nx_wgsl layout` derives its memory layout from it.
GE55 (2026-09-05): the world module now takes the sim's RAW state words as its uniform block (ws_world_uniforms_raw,
the same 40-word table as nx_wasm_craft UR_*) and derives every float in upk() into module-scope private state, so
the page packs nothing and computes nothing; ws_world_uniforms (the f32 block) stays as the R-F layout ruler fixture.
license_tier: ORIGINAL
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
dependencies 0 imports · 0 importers
imports: none
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 307 | const NX_BUF_TINY: nx_size = 64 |
| 308 | const NX_BUF_SMALL: nx_size = 256 |
| 309 | const NX_BUF_MEDIUM: nx_size = 4096 |
| 310 | const NX_BUF_LARGE: nx_size = 65536 |
| 311 | const NX_BUF_HUGE: nx_size = 1048576 |
| 315 | const NX_TIER_MCU: nx_int = 0 |
| 316 | const NX_TIER_SOVEREIGN_CHIP: nx_int = 1 |
| 317 | const NX_TIER_FAMILY_DEVICE: nx_int = 2 |
| 318 | const NX_TIER_WORKSTATION: nx_int = 3 |
| 319 | const NX_TIER_SERVER: nx_int = 4 |
| 320 | const NX_TIER_HPC: nx_int = 5 |
| 324 | const NX_NUM_N0_I32: nx_int = 0 |
| 325 | const NX_NUM_N1_I64: nx_int = 1 |
| 326 | const NX_NUM_N2_I128: nx_int = 2 |
| 327 | const NX_NUM_N3_I256: nx_int = 3 |
| 328 | const NX_NUM_N4_I512: nx_int = 4 |
| 329 | const NX_NUM_N5_BIGINT: nx_int = 5 |
| 337 | const NX_SIZEOF_NX_INT: nx_size = 8 // nx_int currently i64 -> 8 bytes |
| 338 | const NX_SIZEOF_NX_SIZE: nx_size = 8 // nx_size always pointer-width |
| 339 | const NX_SIZEOF_NX_IDX: nx_size = 8 // nx_idx alias of nx_size |
| 343 | const NX_FD_STDIN: nx_fd = 0 |
| 344 | const NX_FD_STDOUT: nx_fd = 1 |
| 345 | const NX_FD_STDERR: nx_fd = 2 |
| 347 | const SYS_MAGIC_1024: i64 = 1024 |
| 348 | const SYS_MAGIC_1000000: i64 = 1000000 |
| 349 | const SYS_MAGIC_4294967296: i64 = 4294967296 |
| 351 | const SYS_READ_GROW_INIT: i64 = 65536 |
| 352 | const SYS_MAGIC_100000: i64 = 100000 |
| 370 | const SYS_READ: i64 = 0 |
| 371 | const SYS_WRITE: i64 = 1 |
| 372 | const SYS_CLOSE: i64 = 3 |
| 373 | const SYS_LSEEK: i64 = 8 |
| 374 | const SYS_OPENAT: i64 = 257 |
| 375 | const SYS_EXIT: i64 = 60 |
| 376 | const SYS_MMAP: i64 = 9 |
| 377 | const SYS_CLOCK_GETTIME: i64 = 228 |
| 378 | const SYS_IOCTL: i64 = 16 |
| 379 | const SYS_CLOCK_NANOSLEEP: i64 = 230 |
| 383 | const SYS_CHROOT: i64 = 161 |
| 384 | const SYS_MOUNT: i64 = 165 |
| 385 | const SYS_UNSHARE: i64 = 272 |
| 386 | const SYS_GETUID: i64 = 102 |
| 387 | const SYS_GETGID: i64 = 104 |
| 388 | const SYS_POLL: i64 = 7 |
| 392 | const SYS_READ: i64 = 63 |
| 393 | const SYS_WRITE: i64 = 64 |
| 394 | const SYS_CLOSE: i64 = 57 |
| 395 | const SYS_LSEEK: i64 = 62 |
| 396 | const SYS_OPENAT: i64 = 56 |
| 397 | const SYS_EXIT: i64 = 93 |
| 398 | const SYS_MMAP: i64 = 222 |
| 399 | const SYS_CLOCK_GETTIME: i64 = 113 |
| 400 | const SYS_IOCTL: i64 = 29 |
| 401 | const SYS_CLOCK_NANOSLEEP: i64 = 115 |
| 408 | const SYS_CHROOT: i64 = 51 |
| 409 | const SYS_MOUNT: i64 = 40 |
| 410 | const SYS_UNSHARE: i64 = 97 |
| 411 | const SYS_GETUID: i64 = 174 |
| 412 | const SYS_GETGID: i64 = 176 |
| 413 | const SYS_POLL: i64 = 73 |
| 471 | const SYS_PATH_MAX: i64 = 4096 // Linux PATH_MAX; getcwd returns -ERANGE below it |
| 475 | const MODE_0755: i64 = 0x1ed // rwxr-xr-x : default mode for a created directory |
| 490 | const AT_FDCWD: i64 = -100 |
| 595 | const NX_MO_RELAXED: i64 = 0 |
| 596 | const NX_MO_CONSUME: i64 = 1 |
| 597 | const NX_MO_ACQUIRE: i64 = 2 |
| 598 | const NX_MO_RELEASE: i64 = 3 |
| 599 | const NX_MO_ACQ_REL: i64 = 4 |
| 600 | const NX_MO_SEQ_CST: i64 = 5 |
| 602 | const NXA_SMALL_MAX: i64 = 256 |
| 603 | const NXA_CHUNK: i64 = 262144 |
| 604 | const NXA_ALIGN: i64 = 16 |
| 605 | const NXA_GAP: i64 = 16 |
| 606 | const NXA_STATE: i64 = 4096 |
| 612 | const NXA_RING: i64 = 128 |
| 613 | const NXA_RBASE: i64 = 64 |
| 648 | const NXA_LOCK: i64 = 4 |
| 656 | const NXA_LOCK_WARN: i64 = NXA_RING * 8 |
| 660 | const NXA_LOCK_WARNED: i64 = 5 |
| 662 | const NXA_CHUNKBASE: i64 = 320 |
| 663 | const NXA_CHUNKMAX: i64 = 192 |
| 684 | const NXA_MAP_INVALID:i64=0-22 // Linux EINVAL, a protocol value rather than a resource budget. |
| 736 | const SYS_STATFS_X86_MEASURED: i64 = 137 |
| 737 | const STATFS_BUF_BYTES: i64 = 144 |
| 738 | const STATFS_I_BSIZE: i64 = 1 |
| 739 | const STATFS_I_BLOCKS: i64 = 2 |
| 740 | const STATFS_I_BAVAIL: i64 = 4 |
| 741 | const STATFS_PERMIL: i64 = 1000 |
| 742 | const STATFS_ERR: i64 = 0 - 1 |
| 1087 | const O_RDONLY: i64 = 0 |
| 1088 | const O_WRONLY_CT: i64 = 0x241 // O_CREAT | O_WRONLY | O_TRUNC |
| 1089 | const O_WRONLY_CA: i64 = 0x441 // O_CREAT | O_WRONLY | O_APPEND |
| 1097 | const O_RDWR_CREATE: i64 = 0x42 |
| 1118 | const MODE_0644: i64 = 0x1a4 // rw-r--r-- : default mode for a generated artifact |
| 1123 | const MODE_0755: i64 = 0x1ed |
| 1136 | const ACCEPT_TMO_S: i64 = 30 |
| 1143 | const O_WRONLY_CREATE_EXCLUSIVE: i64 = 0x1 | 0x40 | 0x80 |
| 1149 | const O_DIRECTORY: i64 = 0x10000 |
| 1163 | const O_CLOEXEC: i64 = 0x80000 |
| 1164 | const O_NOFOLLOW: i64 = 0x20000 |
| 1165 | const O_NONBLOCK: i64 = 0x800 |
| 1166 | const MODE_0600: i64 = 0x180 |
| 1231 | const SYS_LOCK_SH: i64 = 1 |
| 1232 | const SYS_LOCK_EX: i64 = 2 |
| 1233 | const SYS_LOCK_NB: i64 = 4 |
| 1234 | const SYS_LOCK_UN: i64 = 8 |
| 1279 | const SYS_SETPGID: i64 = 109 |
| 1282 | const SYS_SETPGID: i64 = 154 |
| 1305 | const RLIMIT_CPU: i64 = 0 |
| 1306 | const RLIMIT_AS: i64 = 9 |
| 1307 | const WNOHANG: i64 = 1 |
| 1401 | const SYS_CLONE: i64 = 56 |
| 1402 | const SYS_EXECVE: i64 = 59 |
| 1403 | const SYS_WAIT4: i64 = 61 |
| 1404 | const SYS_PIPE2: i64 = 293 |
| 1405 | const SYS_DUP3: i64 = 292 |
| 1409 | const SYS_CLONE: i64 = 220 |
| 1410 | const SYS_EXECVE: i64 = 221 |
| 1411 | const SYS_WAIT4: i64 = 260 |
| 1412 | const SYS_PIPE2: i64 = 59 |
| 1413 | const SYS_DUP3: i64 = 24 |
| 1419 | const CLONE_VM: i64 = 0x00000100 |
| 1420 | const CLONE_VFORK: i64 = 0x00004000 |
| 1421 | const SIGCHLD: i64 = 17 |
| 1471 | const NX_SYS_PRCTL: i64 = 167 |
| 1472 | const NX_PR_SET_PDEATHSIG: i64 = 1 |
| 1473 | const NX_PR_SET_CHILD_SUBREAPER: i64 = 36 |
| 1488 | const SYS_WAITID_PORTABLE: i64 = 95 |
| 1489 | const NX_WAIT_P_PID: i64 = 1 |
| 1490 | const NX_WAIT_EXITED: i64 = 4 |
| 1491 | const NX_WAIT_NOWAIT: i64 = 0x01000000 |
| 1492 | const NX_WAIT_SIGINFO_BYTES: i64 = 128 |
| 1499 | const NX_FD_DENT_BUFFER: i64 = 4096 |
| 1500 | const NX_SYS_CLOSE_RANGE: i64 = 436 // Linux x86_64 and asm-generic ABI |
| 1501 | const NX_FD_UINT_MAX: i64 = 4294967295 |
| 1673 | const SYS_GETDENTS64: i64 = 217 |
| 1676 | const SYS_GETDENTS64: i64 = 61 |
| 1679 | const DT_UNKNOWN: i64 = 0 |
| 1680 | const DT_FIFO: i64 = 1 |
| 1681 | const DT_CHR: i64 = 2 |
| 1682 | const DT_DIR: i64 = 4 |
| 1683 | const DT_BLK: i64 = 6 |
| 1684 | const DT_REG: i64 = 8 |
| 1685 | const DT_LNK: i64 = 10 |
| 1686 | const DT_SOCK: i64 = 12 |
| 1874 | const SYS_SOCKET: i64 = 41 |
| 1875 | const SYS_BIND: i64 = 49 |
| 1876 | const SYS_LISTEN: i64 = 50 |
| 1877 | const SYS_ACCEPT: i64 = 43 |
| 1878 | const SYS_CONNECT: i64 = 42 |
| 1879 | const SYS_SETSOCKOPT: i64 = 54 |
| 1880 | const SYS_SENDTO: i64 = 44 |
| 1881 | const SYS_RECVFROM: i64 = 45 |
| 1882 | const SYS_SHUTDOWN: i64 = 48 |
| 1886 | const SYS_SOCKET: i64 = 198 |
| 1887 | const SYS_BIND: i64 = 200 |
| 1888 | const SYS_LISTEN: i64 = 201 |
| 1889 | const SYS_ACCEPT: i64 = 202 |
| 1890 | const SYS_CONNECT: i64 = 203 |
| 1891 | const SYS_SETSOCKOPT: i64 = 208 |
| 1892 | const SYS_SENDTO: i64 = 206 |
| 1893 | const SYS_RECVFROM: i64 = 207 |
| 1894 | const SYS_SHUTDOWN: i64 = 210 |
| 1898 | const SOL_SOCKET: i64 = 1 |
| 1899 | const SO_REUSEADDR: i64 = 2 |
| 1904 | const SO_SNDTIMEO: i64 = 21 |
| 1905 | const SO_RCVTIMEO: i64 = 20 |
| 1933 | const SYS_ALARM: i64 = 37 |
| 1936 | const AF_INET: i64 = 2 |
| 1937 | const SOCK_STREAM: i64 = 1 |
| 1938 | const SOCK_DGRAM: i64 = 2 |
| 2044 | const SYS_SENDMSG: i64 = 46 |
| 2045 | const SYS_RECVMSG: i64 = 47 |
| 2046 | const SYS_SOCKETPAIR: i64 = 53 |
| 2047 | const SCM_AF_UNIX: i64 = 1 |
| 2048 | const SCM_SOL_SOCKET: i64 = 1 |
| 2049 | const SCM_RIGHTS_TYPE: i64 = 1 |
| 2050 | const SCM_MSG_CMSG_CLOEXEC: i64 = 1073741824 |
| 2051 | const SCM_MSGHDR_BYTES: i64 = 56 |
| 2052 | const SCM_MSGHDR_OFF_IOV: i64 = 16 |
| 2053 | const SCM_MSGHDR_OFF_IOVLEN: i64 = 24 |
| 2054 | const SCM_MSGHDR_OFF_CTRL: i64 = 32 |
| 2055 | const SCM_MSGHDR_OFF_CTRLLEN: i64 = 40 |
| 2056 | const SCM_IOVEC_BYTES: i64 = 16 |
| 2057 | const SCM_IOVEC_OFF_BASE: i64 = 0 |
| 2058 | const SCM_IOVEC_OFF_LEN: i64 = 8 |
| 2059 | const SCM_CMSG_OFF_LEN: i64 = 0 |
| 2060 | const SCM_CMSG_OFF_LEVEL: i64 = 8 |
| 2061 | const SCM_CMSG_OFF_TYPE: i64 = 12 |
| 2062 | const SCM_CMSG_OFF_DATA: i64 = 16 |
| 2063 | const SCM_CMSG_LEN_1FD: i64 = 20 |
| 2064 | const SCM_CMSG_SPACE_1FD: i64 = 24 |
| 2065 | const SCM_IOV_COUNT_ONE: i64 = 1 |
| 2066 | const SCM_U32_BYTES: i64 = 4 |
| 2067 | const SCM_BYTE_RADIX: i64 = 256 |
| 2068 | const SCM_FDPAIR_BYTES: i64 = 8 |
| 2071 | const SCM_PAYLOAD_BYTES: i64 = 1 |
| 2072 | const SCM_PAYLOAD_BYTE: i64 = 70 |
| 2076 | const SCM_ERR_NO_CMSG: i64 = 0 - 901 |
| 2077 | const SCM_ERR_CMSG_LEN: i64 = 0 - 902 |
| 2078 | const SCM_ERR_CMSG_LEVEL: i64 = 0 - 903 |
| 2079 | const SCM_ERR_CMSG_TYPE: i64 = 0 - 904 |
| 2151 | const SCM_SUN_PATH_OFF: i64 = 2 // sockaddr_un = [sa_family: u16][sun_path: 108] |
| 2152 | const SCM_SUN_BYTES: i64 = 110 |
| 2153 | const SCM_SUN_PATH_MAX: i64 = 107 |
| 2278 | const NX_FILE_PERMISSION_MASK:i64=511 |
| 2279 | const NX_FILE_DESCRIPTOR_INVALID:i64=0-22 |
| 2285 | const NX_STAT_X64_BYTES:i64=144 |
| 2286 | const NX_STAT_X64_MODE_OFFSET:i64=24 |
| 2287 | const NX_STAT_X64_BLOCK_OFFSET:i64=56 |
| 2288 | const NX_STAT_X64_SIZE_OFFSET:i64=48 |
| 2289 | const NX_STAT_X64_DEVICE_OFFSET:i64=0 |
| 2290 | const NX_STAT_X64_INODE_OFFSET:i64=8 |
| 2291 | const NX_STAT_TYPE_MASK:i64=61440 |
| 2292 | const NX_STAT_REGULAR_FILE:i64=32768 |
| 2306 | const SIR_SLOTS: i64 = 8 |
| 2311 | const SIR_MAXNODE: i64 = 16384 |
| 2312 | const SIR_POOLCAP: i64 = 65536 |
| 2314 | const SIR_KIND: i64 = 0 |
| 2315 | const SIR_TY: i64 = 1 |
| 2316 | const SIR_A: i64 = 2 |
| 2317 | const SIR_B: i64 = 3 |
| 2318 | const SIR_C: i64 = 4 |
| 2319 | const SIR_NAME: i64 = 5 |
| 2320 | const SIR_D: i64 = 6 |
| 2321 | const SIR_NEXT: i64 = 7 |
| 2324 | const M_NODES: i64 = 0 |
| 2325 | const M_NCOUNT: i64 = 1 |
| 2326 | const M_POOL: i64 = 2 |
| 2327 | const M_POOLUSED: i64 = 3 |
| 2328 | const M_DECLH: i64 = 4 |
| 2329 | const M_DECLT: i64 = 5 |
| 2330 | const M_FUNCH: i64 = 6 |
| 2331 | const M_FUNCT: i64 = 7 |
| 2332 | const M_REFUSE: i64 = 8 |
| 2333 | const M_OVER: i64 = 9 |
| 2338 | const M_CURFN: i64 = 10 |
| 2345 | const M_FRAGOUT: i64 = 11 |
| 2350 | const M_VIOMODE: i64 = 12 |
| 2355 | const M_USESII: i64 = 13 |
| 2362 | const M_WGFRAGOUT: i64 = 14 |
| 2368 | const M_BINDGROUP: i64 = 15 |
| 2371 | const M_CLIP_DEPTH: i64 = 16 |
| 2372 | const SIR_MODULE_WORDS: i64 = 17 |
| 2373 | const SIR_CLIP_NATIVE: i64 = 0 |
| 2374 | const SIR_CLIP_NEGATIVE_ONE_TO_ONE: i64 = 1 |
| 2376 | const SIR_LIT_USUFFIX: i64 = 1 |
| 2379 | const K_UNIFORM: i64 = 1 |
| 2380 | const K_ATTRIB: i64 = 2 |
| 2381 | const K_VARY: i64 = 3 |
| 2382 | const K_FUNC: i64 = 4 |
| 2383 | const K_PARAM: i64 = 5 |
| 2391 | const K_STORAGE: i64 = 6 |
| 2398 | const K_TEXTURE: i64 = 7 |
| 2409 | const K_FRAGOUT: i64 = 8 |
| 2417 | const K_STRUCT: i64 = 9 |
| 2418 | const S_RETURN: i64 = 10 |
| 2419 | const S_ASSIGN: i64 = 11 |
| 2420 | const S_VAR: i64 = 12 |
| 2421 | const S_IF: i64 = 13 |
| 2422 | const S_DISCARD: i64 = 14 |
| 2430 | const S_LOOP: i64 = 15 |
| 2431 | const S_BREAK: i64 = 16 |
| 2435 | const S_EXPR: i64 = 17 |
| 2436 | const E_LIT: i64 = 20 |
| 2437 | const E_IDENT: i64 = 21 |
| 2438 | const E_BIN: i64 = 22 |
| 2439 | const E_CALL: i64 = 23 |
| 2440 | const E_SWZ: i64 = 24 |
| 2441 | const E_INDEX: i64 = 25 |
| 2442 | const E_TEXLOAD: i64 = 26 |
| 2443 | const E_TEXSAMPLE: i64 = 27 |
| 2444 | const E_CTOR: i64 = 28 |
| 2448 | const E_CAST: i64 = 29 |
| 2449 | const E_BUILTIN: i64 = 30 |
| 2454 | const E_ATOMIC: i64 = 31 |
| 2460 | const E_SELECT: i64 = 32 |
| 2464 | const E_NEG: i64 = 33 |
| 2470 | const K_PRIVATE: i64 = 34 |
| 2476 | const E_NOT: i64 = 35 |
| 2479 | const T_VOID: i64 = 0 |
| 2480 | const T_F32: i64 = 1 |
| 2481 | const T_I32: i64 = 2 |
| 2482 | const T_U32: i64 = 3 |
| 2483 | const T_BOOL: i64 = 4 |
| 2484 | const T_V2F: i64 = 5 |
| 2485 | const T_V3F: i64 = 6 |
| 2486 | const T_V4F: i64 = 7 |
| 2487 | const T_V3I: i64 = 8 |
| 2488 | const T_TEX3U: i64 = 9 |
| 2489 | const T_TEX2F: i64 = 10 |
| 2491 | const T_V3U: i64 = 11 |
| 2494 | const T_V2I: i64 = 12 |
| 2498 | const T_M3F: i64 = 13 |
| 2499 | const T_MAX: i64 = 13 |
| 2650 | const P_PLAIN: i64 = 0 |
| 2651 | const P_BUILTIN_POSITION: i64 = 1 |
| 2733 | const SIR_VAR_CONST: i64 = 2 |
| 2772 | const SIR_VAR_LET: i64 = 1 |
| 3064 | const CB_BASE: *u8 = "180.0" // the incumbent sheet's height in blocks, now the slab base |
| 3065 | const CB_TOP: *u8 = "300.0" |
| 3066 | const CB_RLO: *u8 = "24.0" // density ramps in over this many blocks above the base |
| 3067 | const CB_RHI: *u8 = "48.0" // and out over this many below the top |
| 3068 | const CB_CELL: *u8 = "180.0" // one noise cell in blocks, horizontal |
| 3069 | const CB_CELLY: *u8 = "120.0" // and vertical (flatter cells read as stratus) |
| 3070 | const CB_DRIFT_X: *u8 = "240.0" // the incumbent sheet's drift divisors, kept so the motion does not change |
| 3071 | const CB_DRIFT_Z: *u8 = "540.0" |
| 3072 | const CB_THR0: *u8 = "0.78" // coverage threshold at cld=0 |
| 3073 | const CB_THRK: *u8 = "0.30" // and how far cld=1 lowers it |
| 3074 | const CB_GAIN: *u8 = "1.4" |
| 3075 | const CB_STEPS: *u8 = "48" |
| 3076 | const CB_STEPS_F: *u8 = "48.0" |
| 3077 | const CB_SIGMA: *u8 = "0.04" // extinction per block of unit density |
| 3078 | const CB_LIT0: *u8 = "0.70" // ambient at the base |
| 3079 | const CB_LIT1: *u8 = "0.30" // brighter toward the top |
| 3080 | const CB_SUNK: *u8 = "0.15" // silver toward the sun |
| 3084 | const CB_EROSION: *u8 = "0.22" |
| 3085 | const CB_SUN_Y_MIN: *u8 = "0.01" |
| 3086 | const CB_LIGHT_DISTANCE: *u8 = "480.0" |
| 3087 | const CB_LIGHT_STEPS: *u8 = "6" |
| 3088 | const CB_LIGHT_STEPS_F: *u8 = "6.0" |
| 3089 | const CB_VIEW_DISTANCE: *u8 = "1400.0" |
| 3090 | const CB_PHASE_G: *u8 = "0.35" |
| 3091 | const CB_AMBIENT: *u8 = "0.85" |
| 3092 | const CB_DIRECT: *u8 = "0.72" |
| 3444 | const SD_GRAIN_PER_BLOCK: *u8 = "32.0" // facets per block edge: 3 cm at a 1 m block, coarse beach sand |
| 3445 | const SD_GRAIN_SLOPE: *u8 = "1.2" // facet steepness as a normal slope |
| 3446 | const SD_RIPPLE_PER_BLOCK: *u8 = "9.0" // wind ripples per block: an 11 cm wavelength at a 1 m block |
| 3447 | const SD_RIPPLE_SLOPE: *u8 = "0.45" // crest slope |
| 3448 | const SD_RIPPLE_DX: *u8 = "0.8" // ripple normal heading (unit): the wind heading, a data hook |
| 3449 | const SD_RIPPLE_DZ: *u8 = "0.6" |
| 3450 | const SD_PATCH: *u8 = "0.25" // ripple phase jitter per 4-block patch so the field is not one sine |
| 3451 | const SD_TAU: *u8 = "6.2831853" |
| 3452 | const SD_QUARTER_TURN: *u8 = "1.5707963" |
| 3453 | const SD_EIGHTH_TURN: *u8 = "0.7853982" |
| 3454 | const SD_RING_DIRS: *u8 = "8" |
| 3455 | const SD_RING_STEPS: *u8 = "24" // SD_RING_DIRS x SD_WET_R |
| 3456 | const SD_WET_R: *u8 = "3.0" // wet band reach in cells |
| 3457 | const SD_WET_DRY: *u8 = "4.0" // SD_WET_R + 1: no water within reach |
| 3458 | const SD_WET_DARK: *u8 = "0.55" // wet albedo multiplier |
| 3459 | const SD_FILM_POW: *u8 = "48.0" |
| 3460 | const SD_FILM_GAIN: *u8 = "0.55" |
| 3461 | const SD_SHEEN_GAIN: *u8 = "0.10" |
| 3462 | const SD_GLINT_POW: *u8 = "96.0" |
| 3463 | const SD_GLINT_GAIN: *u8 = "0.35" |
| 3464 | const SD_GLINT_FRAC: *u8 = "0.9" // facets whose hash exceeds this are quartz glints |
| 3465 | const SD_NDV_FLOOR: *u8 = "0.15" // the footprint stretch floor at grazing angles |
| 3466 | const SD_SHADOW_SPEC: *u8 = "0.2" // in a block shadow the film keeps its sky sheen and loses the sun |
| 3467 | const SD_TWO: *u8 = "2.0" |
| 3468 | const SD_HALF: *u8 = "0.5" |
functions
| 416 | func sys_ioctl(fd: i64, request: i64, arg: i64) -> i64 |
| 427 | func sys_poll(fds: *u8, nfds: i64, timeout_ms: i64) -> i64 |
| 433 | func sys_write(fd: i64, buf: *u8, count: i64) -> i64 |
| 437 | func sys_read(fd: i64, buf: *u8, count: i64) -> i64 called by 1: sys_read_file |
| 441 | func sys_close(fd: i64) -> i64 |
| 451 | func sys_chdir(path: *u8) -> i64 calls 1: sys_mmap |
| 476 | func sys_getcwd(buf: *u8, cap: i64) -> i64 calls 1: sys_mmap |
| 495 | func sys_unlinkat(path: *u8) -> i64 |
| 502 | func sys_fchmodat(path: *u8, mode: i64) -> i64 calls 1: sys_mmap |
| 518 | func sys_exit_group(code: i64) -> i64 |
| 535 | func sys_setpriority(prio: i64) -> i64 |
| 543 | func sys_setpriority_of(pid: i64, prio: i64) -> i64 |
| 685 | func sys_munmap_direct(addr:*u8,len:i64)->i64 |
| 690 | func sys_munmap(addr: *u8, len: i64) -> i64 |
| 697 | func sys_lseek(fd: i64, offset: i64, whence: i64) -> i64 |
| 745 | func sys_statfs(path: *u8, buf: *i64) -> i64 |
| 750 | func sys_fs_avail_bytes(path: *u8) -> i64 |
| 759 | func sys_fs_used_permil(path: *u8) -> i64 |
| 768 | func sys_exit(code: i64) -> i64 called by 1: nxa_die |
| 802 | func nxa_dump_printable(src: i64, n: i64) -> i64 |
| 823 | func nxa_dump_sizes() -> i64 |
| 848 | func nxa_report_overrun(sz: i64, gs: i64) -> i64 |
| 878 | func nxa_die(msg: *u8) -> i64 |
| 888 | func nxa_lock_addr() -> *i64 |
| 896 | func nxa_lock_take() -> i64 |
| 925 | func nxa_lock_give() -> i64 |
| 939 | func sys_mmap_try(size:i64)->*u8 |
| 946 | func sys_mmap(size: i64) -> *u8 |
| 1028 | func sys_arena_mark() -> i64 calls 1: sys_mmap |
| 1042 | func sys_arena_reset() -> i64 |
| 1066 | func sys_mmap_shared(size: i64) -> *u8 |
| 1080 | func sys_madvise(addr: *u8, len: i64, advice: i64) -> i64 |
| 1091 | func sys_openat_rd(path: *u8) -> i64 |
| 1098 | func sys_openat_rdwr(path: *u8, mode: i64) -> i64 |
| 1137 | func sys_openat_wr(path: *u8, mode: i64) -> i64 |
| 1144 | func sys_openat_exclusive(path: *u8, mode: i64) -> i64 |
| 1150 | func sys_openat_directory(path: *u8) -> i64 |
| 1157 | func sys_openat_append(path: *u8, mode: i64) -> i64 |
| 1167 | func sys_openat_lock(path: *u8) -> i64 |
| 1175 | func sys_symlinkat(target: *u8, linkpath: *u8) -> i64 |
| 1187 | func sys_readlinkat(path: *u8, buf: *u8, cap: i64) -> i64 |
| 1204 | func sys_renameat(oldpath: *u8, newpath: *u8) -> i64 |
| 1217 | func sys_fsync(fd: i64) -> i64 |
| 1235 | func sys_flock(fd: i64, op: i64) -> i64 |
| 1243 | func sys_fstatat(path: *u8, statbuf: *u8) -> i64 |
| 1250 | func sys_utimensat(path: *u8, times: *i64) -> i64 |
| 1269 | func nx_kill(pid: i64, sig: i64) -> i64 { return __syscall(129, pid, sig, 0, 0, 0, 0) } |
| 1284 | func sys_setpgid(pid: i64, pgid: i64) -> i64 { return __syscall(SYS_SETPGID, pid, pgid, 0, 0, 0, 0) } |
| 1298 | func nx_prlimit(pid: i64, resource: i64, new_limit: *u8, old_limit: *u8) -> i64 |
| 1310 | func sys_mkdir(path: *u8, mode: i64) -> i64 { return __syscall(34, AT_FDCWD, path, mode, 0, 0, 0) } |
| 1313 | func nx_chmod(path: *u8, mode: i64) -> i64 { return __syscall(53, AT_FDCWD, path, mode, 0, 0, 0) } |
| 1317 | func nx_setsid() -> i64 { return __syscall(112, 0, 0, 0, 0, 0, 0) } |
| 1321 | func sys_clock_gettime_mono(ts: *i64) -> i64 |
| 1329 | func sys_clock_gettime_real(ts: *i64) -> i64 |
| 1334 | func sys_now_realtime_sec() -> i64 |
| 1341 | func sys_now_realtime_ms() -> i64 |
| 1353 | func sys_now_realtime_us() -> i64 |
| 1362 | func sys_now_ms() -> i64 |
| 1373 | func sys_now_us() -> i64 |
| 1384 | func sys_clock_now_us() -> i64 calls 1: sys_now_us |
| 1434 | func sys_unshare(flags: i64) -> i64 |
| 1437 | func sys_mount(source: *u8, target: *u8, fs_type: *u8, mountflags: i64, data: *u8) -> i64 |
| 1440 | func sys_chroot(path: *u8) -> i64 |
| 1443 | func sys_getuid() -> i64 |
| 1446 | func sys_getgid() -> i64 |
| 1450 | func sys_fork() -> i64 |
| 1474 | func sys_prctl(option: i64, arg: i64) -> i64 called by 1: sys_bind_parent_lifetime |
| 1477 | func sys_bind_parent_lifetime(expected_parent: i64, signal: i64) -> i64 calls 1: sys_prctl |
| 1493 | func sys_waitid(idtype: i64, id: i64, info: *u8, options: i64) -> i64 |
| 1502 | func sys_close_inherited_proc(first: i64) -> i64 called by 1: sys_close_inherited calls 6: sys_openat_rdsys_mmapsys_getdents64dirent_reclensys_closesys_munmap |
| 1543 | func sys_close_inherited(first: i64) -> i64 |
| 1549 | func sys_execve_clean(path: *u8, argv: *i64, envp: *i64) -> i64 |
| 1555 | func sys_execve(path: *u8, argv: *i64, envp: *i64) -> i64 called by 1: sys_execve_clean |
| 1564 | func sys_wait4(pid: i64, status: *i64, options: i64) -> i64 |
| 1570 | func wait_exit_code(status: i64) -> i64 called by 1: wait_status_rc |
| 1578 | func wait_term_signal(status: i64) -> i64 called by 1: wait_status_rc |
| 1603 | func wait_status_rc(status: i64) -> i64 |
| 1626 | func sys_default_signal(sig: i64) -> i64 calls 1: sys_mmap |
| 1635 | func sys_ignore_sigpipe() -> i64 calls 1: sys_mmap |
| 1650 | func sys_pipe2(fds: *i64, flags: i64) -> i64 |
| 1656 | func sys_dup3(oldfd: i64, newfd: i64, flags: i64) -> i64 |
| 1690 | func sys_getdents64(fd: i64, buf: *u8, buf_len: i64) -> i64 called by 1: sys_close_inherited_proc |
| 1696 | func dirent_reclen(rec: *u8) -> i64 called by 1: sys_close_inherited_proc |
| 1703 | func dirent_type(rec: *u8) -> i64 |
| 1708 | func dirent_name(rec: *u8) -> *u8 |
| 1715 | func sys_read_file(path: *u8, out_len: *i64) -> *u8 |
| 1797 | func sys_free_file(buf: *u8, len: i64) -> i64 calls 1: sys_munmap |
| 1808 | func sys_map_file(path: *u8, out_len: *i64) -> *u8 |
| 1826 | func sys_sleep_ms(ms: i64) -> i64 |
| 1910 | func sys_setsockopt(fd: i64, level: i64, optname: i64, called by 1: sys_set_socket_timeout |
| 1920 | func sys_set_socket_timeout(fd: i64, secs: i64) -> i64 |
| 1934 | func sys_alarm(secs: i64) -> i64 { return __syscall(SYS_ALARM, secs, 0, 0, 0, 0, 0) } |
| 1940 | func sys_socket(domain: i64, sock_type: i64, protocol: i64) -> i64 |
| 1952 | func sockaddr_in_init(addr: *u8, port: i64) -> i64 |
| 1975 | func sys_bind(fd: i64, addr: *u8, addr_len: i64) -> i64 called by 1: sys_unix_listen |
| 1978 | func sys_listen(fd: i64, backlog: i64) -> i64 called by 1: sys_unix_listen |
| 1985 | func sys_accept(fd: i64) -> i64 |
| 1988 | func sys_accept_with_addr(fd: i64, addr: *u8, addr_len: *i64) -> i64 |
| 1992 | func sys_shutdown(fd: i64, how: i64) -> i64 |
| 1995 | func sys_connect(fd: i64, addr: *u8, addr_len: i64) -> i64 called by 1: sys_unix_connect_fd |
| 1998 | func sys_sendto(fd: i64, buf: *u8, n: i64, flags: i64, |
| 2002 | func sys_recvfrom(fd: i64, buf: *u8, n: i64, flags: i64, |
| 2081 | func scm_zero(base: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { base[i] = 0; i = i + 1 } return 0 } |
| 2082 | func scm_put_i64(base: *u8, off: i64, v: i64) -> i64 |
| 2087 | func scm_get_i64(base: *u8, off: i64) -> i64 called by 1: sys_recv_fd |
| 2094 | func scm_put_u32(base: *u8, off: i64, v: i64) -> i64 called by 1: sys_send_fd |
| 2104 | func scm_get_u32(base: *u8, off: i64) -> i64 called by 1: sys_recv_fd |
| 2116 | func sys_sendmsg(fd: i64, msg: *u8, flags: i64) -> i64 called by 1: sys_send_fd |
| 2119 | func sys_recvmsg(fd: i64, msg: *u8, flags: i64) -> i64 called by 1: sys_recv_fd |
| 2143 | func sys_socketpair(domain: i64, sock_type: i64, protocol: i64, sv: *u8) -> i64 |
| 2154 | func sys_unix_listen(path: *u8, backlog: i64) -> i64 |
| 2182 | func sys_unix_connect_fd(path: *u8) -> i64 |
| 2206 | func sys_send_fd(sock: i64, fd: i64) -> i64 |
| 2240 | func sys_recv_fd(sock: i64, flags: i64) -> i64 |
| 2280 | func sys_fchmod_fd(fd:i64,mode:i64)->i64 |
| 2293 | func sys_fstat_fd(fd:i64,stat:*u8)->i64 |
| 2297 | func sys_stat_permissions(stat:*u8)->i64 |
| 2501 | func sir_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 2503 | func sir_new() -> *i64 calls 1: sys_mmap |
| 2520 | func sir_get(m: *i64, id: i64, k: i64) -> i64 |
| 2525 | func sir_set(m: *i64, id: i64, k: i64, v: i64) -> i64 |
| 2533 | func sir_str(m: *i64, s: *u8) -> i64 |
| 2547 | func sir_cstr(m: *i64, off: i64) -> *u8 |
| 2551 | func sir_node(m: *i64, kind: i64, ty: i64, a: i64, b: i64, c: i64, nameoff: i64) -> i64 |
| 2567 | func sir_chain(m: *i64, hw: i64, tw: i64, id: i64) -> i64 |
| 2577 | func sir_uniform(m: *i64, name: *u8, ty: i64, arraylen: i64) -> i64 |
| 2583 | func sir_private(m: *i64, name: *u8, ty: i64, arraylen: i64) -> i64 |
| 2588 | func sir_attrib(m: *i64, name: *u8, ty: i64, location: i64) -> i64 |
| 2593 | func sir_vary(m: *i64, name: *u8, ty: i64, location: i64, flat: i64) -> i64 |
| 2600 | func sir_storage(m: *i64, name: *u8, elemty: i64, binding: i64, readwrite: i64, atomic: i64) -> i64 |
| 2606 | func sir_texture(m: *i64, name: *u8, ty: i64) -> i64 |
| 2613 | func sir_fragout(m: *i64, name: *u8, ty: i64, location: i64) -> i64 |
| 2623 | func sir_struct(m: *i64, name: *u8) -> i64 |
| 2627 | func sir_member(m: *i64, st: i64, name: *u8, ty: i64) -> i64 { return sir_param(m, st, name, ty) } |
| 2628 | func sir_struct_ty(st: i64) -> i64 { return SIR_MAXNODE + st } |
| 2630 | func sir_struct_of(m: *i64, ty: i64) -> i64 calls 1: sir_get |
| 2637 | func sir_member_of(m: *i64, base: i64, name: *u8, ty: i64) -> i64 { return sir_swz(m, base, name, ty) } |
| 2640 | 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 |
| 2653 | 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 |
| 2662 | func sir_param_position(m: *i64, fn: i64, name: *u8) -> i64 |
| 2669 | func sir_stmt(m: *i64, fn: i64, st: i64) -> i64 |
| 2678 | func sir_return(m: *i64, e: i64) -> i64 { return sir_node(m, S_RETURN, T_VOID, e, 0, 0, 0) } |
| 2681 | func sir_return_depth(m: *i64, color: i64, depth: i64) -> i64 calls 1: sir_node |
| 2685 | func sir_assign(m: *i64, lhs: i64, rhs: i64) -> i64 { return sir_node(m, S_ASSIGN, T_VOID, lhs, rhs, 0, 0) } |
| 2686 | 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)) } |
| 2687 | func sir_if(m: *i64, cond: i64, thenh: i64, elseh: i64) -> i64 { return sir_node(m, S_IF, T_VOID, cond, thenh, elseh, 0) } |
| 2688 | func sir_discard(m: *i64) -> i64 { return sir_node(m, S_DISCARD, T_VOID, 0, 0, 0, 0) } calls 1: sir_node |
| 2692 | func sir_loop(m: *i64, body: i64) -> i64 { return sir_node(m, S_LOOP, T_VOID, body, 0, 0, 0) } |
| 2693 | func sir_break(m: *i64) -> i64 { return sir_node(m, S_BREAK, T_VOID, 0, 0, 0, 0) } |
| 2695 | func sir_expr(m: *i64, e: i64) -> i64 { return sir_node(m, S_EXPR, T_VOID, e, 0, 0, 0) } |
| 2704 | 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 |
| 2713 | func sir_seq(m: *i64, a: i64, b: i64) -> i64 |
| 2722 | func sir_lit(m: *i64, text: *u8, ty: i64) -> i64 { return sir_node(m, E_LIT, ty, 0, 0, 0, sir_str(m, text)) } |
| 2726 | func sir_lit_u(m: *i64, text: *u8) -> i64 |
| 2734 | func sir_const(m: *i64, name: *u8, ty: i64, init: i64) -> i64 |
| 2739 | func sir_ident(m: *i64, name: *u8, ty: i64) -> i64 { return sir_node(m, E_IDENT, ty, 0, 0, 0, sir_str(m, name)) } |
| 2740 | 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)) } |
| 2741 | 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)) } |
| 2742 | func sir_index(m: *i64, base: i64, idx: i64, ty: i64) -> i64 { return sir_node(m, E_INDEX, ty, base, idx, 0, 0) } |
| 2746 | func sir_texload(m: *i64, tex: i64, coord: i64, lod: i64) -> i64 |
| 2751 | 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 |
| 2754 | func sir_call(m: *i64, name: *u8, ty: i64) -> i64 { return sir_node(m, E_CALL, ty, 0, 0, 0, sir_str(m, name)) } |
| 2755 | func sir_ctor(m: *i64, ty: i64) -> i64 { return sir_node(m, E_CTOR, ty, 0, 0, 0, 0) } |
| 2756 | func sir_cast(m: *i64, e: i64, ty: i64) -> i64 { return sir_node(m, E_CAST, ty, e, 0, 0, 0) } |
| 2757 | func sir_builtin(m: *i64, which: *u8, ty: i64) -> i64 |
| 2763 | 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)) } |
| 2765 | 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) } |
| 2767 | func sir_neg(m: *i64, e: i64, ty: i64) -> i64 { return sir_node(m, E_NEG, ty, e, 0, 0, 0) } |
| 2769 | func sir_not(m: *i64, e: i64) -> i64 { return sir_node(m, E_NOT, T_BOOL, e, 0, 0, 0) } |
| 2773 | func sir_let(m: *i64, name: *u8, ty: i64, init: i64) -> i64 |
| 2779 | func sir_arg(m: *i64, callid: i64, e: i64) -> i64 |
| 2796 | func sir_refuse(m: *i64, what: *u8) -> i64 calls 1: sir_str |
| 2800 | func sir_refused(m: *i64) -> i64 { return m[M_REFUSE] } |
| 2803 | func eb_put(out: *u8, pos: i64, cap: i64, s: *u8) -> i64 |
| 2811 | func eb_num(out: *u8, pos: i64, cap: i64, v: i64) -> i64 |
| 2828 | func tr_add(trace: *i64, tcap: i64, tn: *i64, id: i64) -> i64 |
| 2835 | func ws_f(m: *i64, s: *u8) -> i64 { return sir_lit(m, s, T_F32) } |
| 2836 | func ws_i(m: *i64, s: *u8) -> i64 { return sir_lit(m, s, T_I32) } |
| 2838 | func ws_u(m: *i64, s: *u8) -> i64 { return sir_cast(m, sir_lit(m, s, T_I32), T_U32) } |
| 2839 | func ws_id(m: *i64, n: *u8, ty: i64) -> i64 { return sir_ident(m, n, ty) } |
| 2840 | func ws_bin(m: *i64, op: *u8, a: i64, b: i64, ty: i64) -> i64 { return sir_bin(m, op, a, b, ty) } |
| 2841 | func ws_cmp(m: *i64, op: *u8, a: i64, b: i64) -> i64 { return sir_bin(m, op, a, b, T_BOOL) } |
| 2842 | func ws_and(m: *i64, a: i64, b: i64) -> i64 { return sir_bin(m, "&&" as *u8, a, b, T_BOOL) } |
| 2843 | func ws_or(m: *i64, a: i64, b: i64) -> i64 { return sir_bin(m, "||" as *u8, a, b, T_BOOL) } |
| 2844 | func ws_sw(m: *i64, a: i64, sel: *u8, ty: i64) -> i64 { return sir_swz(m, a, sel, ty) } |
| 2846 | 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) } |
| 2847 | func ws_mem(m: *i64, a: i64, name: *u8, ty: i64) -> i64 { return sir_member_of(m, a, name, ty) } |
| 2848 | 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 } |
| 2849 | 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 } |
| 2850 | 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 } |
| 2851 | 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 } |
| 2852 | 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 } |
| 2853 | 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 } |
| 2854 | func ws_v1(m: *i64, ty: i64, a: i64) -> i64 { let c: i64 = sir_ctor(m, ty); sir_arg(m, c, a); return c } |
| 2855 | 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 } |
| 2856 | 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 } |
| 2857 | func ws_v2(m: *i64, a: i64, b: i64) -> i64 { return ws_vt2(m, T_V2F, a, b) } |
| 2858 | func ws_v3(m: *i64, a: i64, b: i64, c3: i64) -> i64 { return ws_vt3(m, T_V3F, a, b, c3) } |
| 2859 | func ws_v3i(m: *i64, a: i64, b: i64, c3: i64) -> i64 { return ws_vt3(m, T_V3I, a, b, c3) } |
| 2860 | 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 } |
| 2862 | func ws_v2f(m: *i64, a: *u8, b: *u8) -> i64 { return ws_v2(m, ws_f(m, a), ws_f(m, b)) } |
| 2863 | 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)) } |
| 2864 | func ws_q2(m: *i64, a: i64, b: i64) -> i64 { return sir_seq(m, a, b) } |
| 2865 | func ws_q3(m: *i64, a: i64, b: i64, c: i64) -> i64 { return sir_seq(m, sir_seq(m, a, b), c) } |
| 2866 | 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) } |
| 2867 | 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) } |
| 2868 | func ws_set(m: *i64, lhs: i64, rhs: i64) -> i64 { return sir_assign(m, lhs, rhs) } |
| 2870 | 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 12: ws_fn_csunws_fn_cld3ws_fn_smarchws_fn_marchws_liws_ao+6 calls 3: sir_assignsir_identsir_bin |
| 2872 | 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)) } |
| 2873 | func ws_if(m: *i64, c: i64, t: i64, e: i64) -> i64 { return sir_if(m, c, t, e) } |
| 2874 | func ws_ret(m: *i64, e: i64) -> i64 { return sir_return(m, e) } |
| 2875 | func ws_st(m: *i64, f: i64, s: i64) -> i64 { return sir_stmt(m, f, s) } |
| 2879 | func ws_world_uniforms(m: *i64) -> i64 calls 1: sir_uniform |
| 2909 | func ws_ru(m: *i64, n: *u8, ty: i64) -> i64 { return sir_uniform(m, n, ty, 0) } |
| 2910 | func ws_world_uniforms_raw(m: *i64) -> i64 calls 1: ws_ru |
| 2926 | func ws_world_privates(m: *i64) -> i64 calls 1: sir_private |
| 2936 | func ws_fi(m: *i64, n: *u8) -> i64 { return sir_cast(m, sir_ident(m, n, T_I32), T_F32) } |
| 2938 | func ws_fn_rgb9(m: *i64) -> i64 |
| 2948 | func ws_pal(m: *i64, f: i64, arr: *u8, k: *u8, rn: *u8) -> i64 |
| 2956 | func ws_fn_upk(m: *i64) -> i64 |
| 2994 | func ws_fn_vx(m: *i64) -> i64 |
| 3012 | func ws_fn_h21(m: *i64) -> i64 |
| 3021 | func ws_fn_h31(m: *i64) -> i64 |
| 3030 | func ws_fn_pal9(m: *i64) -> i64 |
| 3044 | func ws_noise2(m: *i64, iname: *u8, fname: *u8) -> i64 |
| 3093 | func ws_h31o(m: *i64, a: *u8, b: *u8, c: *u8) -> i64 |
| 3096 | func ws_fx(m: *i64, sel: *u8) -> i64 { return ws_sx(m, "f" as *u8, T_V3F, sel, T_F32) } |
| 3097 | func ws_py(m: *i64) -> i64 { return ws_sx(m, "p" as *u8, T_V3F, "y" as *u8, T_F32) } calls 1: ws_sx |
| 3099 | func ws_fn_vn3(m: *i64) -> i64 |
| 3119 | func ws_fn_cvol(m: *i64) -> i64 |
| 3135 | func ws_fn_csun(m: *i64) -> i64 |
| 3148 | func ws_fn_cld3(m: *i64) -> i64 |
| 3180 | func ws_fn_sky(m: *i64) -> i64 |
| 3200 | func ws_struct_hit(m: *i64) -> i64 |
| 3210 | func ws_dda_step(m: *i64, ax: *u8, fneg: *u8, fpos: *u8) -> i64 |
| 3221 | func ws_fn_hq(m: *i64) -> i64 |
| 3237 | func ws_fn_surf(m: *i64) -> i64 |
| 3259 | func ws_fn_terrain(m: *i64) -> i64 |
| 3271 | func ws_fn_smarch(m: *i64) -> i64 |
| 3308 | func ws_fn_gnd(m: *i64) -> i64 |
| 3332 | func ws_fn_march(m: *i64, hty: i64) -> i64 |
| 3389 | func ws_face(m: *i64, sw: *u8, ax: *u8, op: *u8, nx: *u8, ny: *u8, nz: *u8) -> i64 |
| 3396 | func ws_li(m: *i64, k: *u8) -> i64 { return ws_op(m, "li" as *u8, T_F32, "*" as *u8, ws_f(m, k)) } |
| 3398 | 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)) } |
| 3400 | 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)) } |
| 3402 | func ws_ao(m: *i64, fa: *u8, cmp: *u8, edge: *u8, nudge: i64, gain: i64) -> i64 |
| 3409 | 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)) } |
| 3411 | func ws_topbot(m: *i64) -> i64 { return ws_or(m, ws_fce(m, "3" as *u8), ws_fce(m, "4" as *u8)) } |
| 3416 | func ws_smooth(m: *i64) -> i64 |
| 3421 | func ws_cont_water(m: *i64) -> i64 |
| 3424 | func ws_cont_surface(m: *i64) -> i64 { return ws_or(m, ws_smooth(m), ws_cont_water(m)) } |
| 3426 | func ws_step_down(m: *i64) -> i64 |
| 3470 | func ws_sd_pxz(m: *i64) -> i64 { return ws_sx(m, "hp" as *u8, T_V3F, "xz" as *u8, T_V2F) } |
| 3471 | func ws_sd_f(m: *i64, n: *u8) -> i64 { return ws_id(m, n, T_F32) } |
| 3472 | func ws_sd_v3(m: *i64, n: *u8) -> i64 { return ws_id(m, n, T_V3F) } |
| 3474 | 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) } |
| 3476 | 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) } |
| 3477 | 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)) } |
| 3478 | 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) } |
| 3480 | 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)) } |
| 3482 | 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) } |
| 3484 | 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) } |
| 3486 | 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) } |
| 3488 | func ws_sd_tilt(m: *i64, s: *u8, g: *u8, rdk: *u8) -> i64 |
| 3495 | 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)) } |
| 3496 | func ws_sandy(m: *i64) -> i64 { return ws_and(m, ws_smooth(m), ws_sandcls(m)) } |
| 3498 | 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))) } |
| 3499 | func ws_fn_sand(m: *i64) -> i64 |
| 3567 | func ws_fn_shade(m: *i64, hty: i64) -> i64 |
| 3665 | func ws_bt(m: *i64, k: *u8, v: *u8, els: i64) -> i64 |
| 3669 | 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)) } |
| 3675 | func ws_fn_water_hit(m: *i64, hty: i64) -> i64 |
| 3700 | func ws_fn_scene_hit(m: *i64, hty: i64) -> i64 |
| 3732 | func ws_fn_fs(m: *i64, hty: i64) -> i64 |