nx_staged_shader_layout_capture_t31.nx source
↩ module page · 29 lines · 1464 B
1// ORIGINAL. Private staged shader/layout capture; no publishing or promotion.
2import "nx_game_shader_backend_lib.nx"
3import "nx_gate_verdict.nx"
4import "nx_estate_path.nx"
5const CT31_CAP: i64 = 65536
6const CT31_TIMEOUT: i64 = 8000
7func main(argc: i64,argv: *i64) -> i64 {
8 if ep_anchor() < 0 { return 3 }
9 let ctr: *i64=gv_ctr()
10 gv_head("STAGED-SHADER-LAYOUT-CAPTURE" as *u8)
11 let selected: i64=gsb_select("6a63a26f84a4ba353da798e121a1690a89bf4cac3e59f1dd9e7babe948f33139" as *u8,1250264)
12 gv_check("exact staged backend selected" as *u8,selected==1,ctr)
13 if selected!=1 { return 3 }
14 let buf: *u8=sys_mmap(CT31_CAP)
15 if (buf as i64)<=0 { return 3 }
16 var n: i64=0
17 let a: i64=gsb_capture("layout" as *u8,buf,CT31_CAP,&n,CT31_TIMEOUT)
18 gv_check("raw layout capture complete" as *u8,a==0&&n>0,ctr)
19 if a!=0||n<=0 { return 3 }
20 let wa: i64=fxc_create("/tmp/ct31-staged-layout.txt" as *u8,buf,n)
21 gv_check("layout exclusively retained" as *u8,wa==n,ctr)
22 let b: i64=gsb_capture("world" as *u8,buf,CT31_CAP,&n,CT31_TIMEOUT)
23 gv_check("world capture complete" as *u8,b==0&&n>0,ctr)
24 if b!=0||n<=0 { return 3 }
25 let wb: i64=fxc_create("/tmp/ct31-staged-world.txt" as *u8,buf,n)
26 gv_check("world exclusively retained" as *u8,wb==n,ctr)
27 gv_check("selected producer still matches after captures" as *u8,gsb_matches()==1&&gsb_failed==0,ctr)
28 return gv_verdict("STAGED-SHADER-LAYOUT" as *u8,ctr,"private capture only; runtime ABI and browser validation separate" as *u8)
29}