upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/crates/victory-shader/src/emit/diff_tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/victory-shader/src/emit/diff_tests.rs')
-rw-r--r--crates/victory-shader/src/emit/diff_tests.rs39
1 files changed, 35 insertions, 4 deletions
diff --git a/crates/victory-shader/src/emit/diff_tests.rs b/crates/victory-shader/src/emit/diff_tests.rs
index 21b4d03..68115d7 100644
--- a/crates/victory-shader/src/emit/diff_tests.rs
+++ b/crates/victory-shader/src/emit/diff_tests.rs
@@ -1228,12 +1228,43 @@ fn translated_compute_matches_pc() {
1228 let mut root_views: Vec<(u8, bool)> = cs_c.root_cbvs.iter().map(|&s| (s, false)).collect(); 1228 let mut root_views: Vec<(u8, bool)> = cs_c.root_cbvs.iter().map(|&s| (s, false)).collect();
1229 root_views.extend(cs_c.root_srvs.iter().map(|&s| (s, true))); 1229 root_views.extend(cs_c.root_srvs.iter().map(|&s| (s, true)));
1230 root_views.sort_unstable(); 1230 root_views.sort_unstable();
1231 let view_strides: Vec<u32> = views
1232 .iter()
1233 .map(|v| match *v {
1234 View::RawUav(_) => 1,
1235 View::HalfUav(_) => 8,
1236 View::Buffer { stride, .. } => match stride {
1237 Stride::Raw => 1,
1238 Stride::Typed => 16,
1239 Stride::Structured(s) => s,
1240 Stride::Format(f, bytes) => {
1241 let kind = match f.0 as u32 {
1242 3 | 7 | 12 | 17 | 25 | 30 | 36 | 42 | 50 | 57 | 62 => {
1243 super::VIEW_INTEGER
1244 }
1245 4 | 8 | 14 | 18 | 32 | 38 | 43 | 52 | 59 | 64 => {
1246 super::VIEW_INTEGER | super::VIEW_SIGNED
1247 }
1248 _ => 0,
1249 };
1250 bytes | kind
1251 }
1252 },
1253 _ => 0,
1254 })
1255 .collect();
1231 for (n, (slot, srv)) in root_views.into_iter().enumerate() { 1256 for (n, (slot, srv)) in root_views.into_iter().enumerate() {
1232 assert_eq!(slot, 4 + u8::from(srv), "{name}: root view"); 1257 let data = if srv
1233 let data = if srv { 1258 && (slot == super::SLOT_STRIDES || slot == super::SLOT_TABLE_STRIDES)
1234 root_srv.clone() 1259 {
1260 view_strides.clone()
1235 } else { 1261 } else {
1236 root_cbv.clone() 1262 assert_eq!(slot, 4 + u8::from(srv), "{name}: root view");
1263 if srv {
1264 root_srv.clone()
1265 } else {
1266 root_cbv.clone()
1267 }
1237 }; 1268 };
1238 roots.push((1 + n as u32, Root::View { srv, data })); 1269 roots.push((1 + n as u32, Root::View { srv, data }));
1239 } 1270 }