code wiki / (root) / nx_game_shader_backend_gate.nx

nx_game_shader_backend_gate.nx source

↩ module page · 16 lines · 767 B

1import "nx_game_page_emit.nx" 2func main(argc: i64,argv: *i64) -> i64 { 3 if argc != 3 { return 2 } 4 let expected: *u8=argv[1] as *u8 5 let count: i64=gpr_posint(argv[2] as *u8) 6 if gsb_select(expected,count) != 1 { return 3 } 7 let buffer: *u8=sys_mmap(4096) 8 var n: i64=0 9 if gsb_capture("compute" as *u8,buffer,1,&n,8000) == 0 || n != 0 || gsb_failed != 1 { return 4 } 10 if gsb_select(expected,count) != 1 { return 5 } 11 if gsb_capture("compute" as *u8,buffer,4096,&n,8000) != 0 || n <= 1 || gsb_failed != 0 { return 6 } 12 if gsb_select(expected,count+1) != 0 { return 7 } 13 sys_munmap(buffer,4096) 14 fsx_puts("GSB-GATE 3/3 real backend: truncated capture refused; full capture accepted; wrong artifact extent refused\n") 15 return 0 16}