nx_game_shader_roundtrip_t35.nx source
↩ module page · 19 lines · 1055 B
1import "nx_game_shader_backend_t35.nx"
2const SG_SHA: *u8 = "6a63a26f84a4ba353da798e121a1690a89bf4cac3e59f1dd9e7babe948f33139"
3const SG_BYTES: i64 = 1250264
4func main() -> i64 {
5 let b: *u8=sys_mmap(4096)
6 var n: i64=0
7 if gsb_select(SG_SHA,SG_BYTES) != 1 { return 2 }
8 if gsb_capture("compute" as *u8,b,4096,&n,8000) != 0 || n <= 0 { return 3 }
9 if gsb_select("bad" as *u8,SG_BYTES) != 0 { return 4 }
10 if gsb_capture("compute" as *u8,b,4096,&n,8000) == 0 || n != 0 || gsb_failed != 1 { return 5 }
11 if gsb_select(SG_SHA,SG_BYTES) != 1 { return 6 }
12 if gsb_capture("compute" as *u8,b,1,&n,8000) == 0 || n != 0 || gsb_failed != 1 { return 7 }
13 if gsb_select(SG_SHA,SG_BYTES+1) != 0 { return 8 }
14 if gsb_capture("compute" as *u8,b,4096,&n,8000) == 0 || n != 0 || gsb_failed != 1 { return 9 }
15 if gsb_select(SG_SHA,SG_BYTES) != 1 { return 10 }
16 if gsb_capture("compute" as *u8,b,4096,&n,8000) != 0 || n <= 0 { return 11 }
17 fsx_puts("PASS real shader capture; rejected reselection; truncated output; wrong extent; explicit valid recovery\n" as *u8)
18 return 0
19}