code wiki / (root) / nx_cast_scene_light_gate_t364.nx

nx_cast_scene_light_gate_t364.nx source

↩ module page · 21 lines · 1168 B

1import "nx_cast_scene_light_candidate_t364.nx" 2import "nx_character_prepared_scene_light_candidate_t364.nx" 3import "nx_atomic_rewrite.nx" 4import "nx_gate_verdict.nx" 5func main(argc:i64,argv:*i64)->i64{ 6 if argc!=3{return 2} 7 let ctr:*i64=gv_ctr();let w:*i64=sys_mmap(32) as *i64 8 w[0]=0;w[1]=0;w[2]=0;w[3]=0 9 gv_check("scene recipe checked count",cs_scene_light_recipe_write(w)==0&&w[2]>0,ctr) 10 let n:i64=w[2];let b:*u8=sys_mmap(n+1) 11 if (b as i64)<=0{return 3} 12 w[0]=b as i64;w[1]=n;w[2]=0;w[3]=0 13 gv_check("scene recipe exact second pass",cs_scene_light_recipe_write(w)==0&&w[2]==n,ctr) 14 b[n]=0 as u8 15 gv_check("exclusive candidate recipe checked write",atomic_rewrite_checked(argv[1] as *u8,b,n)==0,ctr) 16 let runtime:*u8=nx_character_prepared_runtime_js() 17 gv_check("exclusive candidate runtime checked write",atomic_rewrite_checked(argv[2] as *u8,runtime,ar_len(runtime))==0,ctr) 18 w[0]=b as i64;w[1]=n-1;w[2]=0;w[3]=0 19 gv_check("scene recipe short buffer refuses",cs_scene_light_recipe_write(w)!=0,ctr) 20 return gv_verdict("SCENE-LIGHT-RECIPE",ctr,"Source-owned artistic diffuse coefficients; no calibrated radiance, visibility parity or rendered quality claim") 21}