code wiki / (root) / nx_scene_light_shader_gate_t364.nx

nx_scene_light_shader_gate_t364.nx source

↩ module page · 14 lines · 982 B

1import "nx_tool_run.nx" 2import "nx_gate_verdict.nx" 3func main(argc:i64,argv:*i64)->i64{ 4 if argc!=5{return 2} 5 let c:*i64=gv_ctr();let a:*i64=sys_mmap(16) as *i64;a[1]=0 6 a[0]=argv[1];gv_check("baseline complete shader process",tr_run_redirect(argv[1] as *u8,a,argv[3] as *u8,0 as *u8)==0,c) 7 a[0]=argv[2];gv_check("candidate complete shader process",tr_run_redirect(argv[2] as *u8,a,argv[4] as *u8,0 as *u8)==0,c) 8 let sz:*i64=sys_mmap(8) as *i64;let x:*u8=sys_read_file(argv[3] as *u8,sz);let n:i64=sz[0];let y:*u8=sys_read_file(argv[4] as *u8,sz) 9 if (x as i64)<=0||(y as i64)<=0{return 3} 10 gv_check("complete output lengths identical",n==sz[0]&&n>0,c) 11 var same:i64=1;if n!=sz[0]{same=0}else{var i:i64=0;while i<n{if x[i]!=y[i]{same=0};i=i+1}} 12 gv_check("whole dual-backend shader output byte identical",same,c) 13 return gv_verdict("SCENE-LIGHT-SHADER-PRESERVATION",c,"Exact old and extracted-coefficient producer bytes, complete redirected output; no renderer quality claim") 14}