code wiki / (root) / nx_ir_world_capacity_t206.nx

nx_ir_world_capacity_t206.nx source

↩ module page · 10 lines · 1274 B

1import "nx_wgsl_world_depth_t195.nx" 2import "nx_fs_create_lib.nx" 3func iq_measure(m:*i64,stage:i64,label:*u8)->i64{ 4 fsx_puts("RESOURCE label=");fsx_puts(label);fsx_puts(" nodes=");fsx_putn(m[M_NCOUNT]);fsx_puts(" node_capacity=");fsx_putn(SIR_MAXNODE);fsx_puts(" pool_bytes=");fsx_putn(m[M_POOLUSED]);fsx_puts(" pool_capacity=");fsx_putn(SIR_POOLCAP);fsx_puts(" refused=");fsx_putn(m[M_REFUSE]);fsx_puts(" overflow=");fsx_putn(m[M_OVER]);fsx_puts("\n") 5 let a:*u8=sys_mmap(WG_EMIT_CAP);let trace:*i64=sys_mmap(WG_TRACE_CAP*8) as *i64;let count:*i64=sys_mmap(8) as *i64;count[0]=0 6 let g:i64=glsl_emit_module(m,stage,a,WG_EMIT_CAP,trace,WG_TRACE_CAP,count);fsx_puts("GLSL bytes=");fsx_putn(g);fsx_puts(" trace=");fsx_putn(count[0]);fsx_puts("\n") 7 count[0]=0;let w:i64=wgsl_emit_module(m,stage,a,WG_EMIT_CAP,trace,WG_TRACE_CAP,count);fsx_puts("WGSL bytes=");fsx_putn(w);fsx_puts(" trace=");fsx_putn(count[0]);fsx_puts(" post_nodes=");fsx_putn(m[M_NCOUNT]);fsx_puts(" refused=");fsx_putn(m[M_REFUSE]);fsx_puts(" overflow=");fsx_putn(m[M_OVER]);fsx_puts("\n") 8 if g<=0||w<=0||m[M_REFUSE]!=0||m[M_OVER]!=0{return 1};return 0 9} 10func main()->i64{let m:*i64=sir_new();shsrc_world_depth(m,ws_f(m,"0.08"),ws_f(m,"300.0"));return iq_measure(m,STAGE_FRAGMENT,"depth-world-fragment")}