| ... | ... | @@ -5,6 +5,7 @@ use bytemuck::{Pod, Zeroable}; |
| 5 | 5 | use std::collections::HashMap; |
| 6 | 6 | use std::collections::hash_map::DefaultHasher; |
| 7 | 7 | use std::hash::{Hash, Hasher}; |
| 8 | use std::num::NonZeroU64; |
| 8 | 9 | |
| 9 | 10 | /// Uniform payload uploaded per `CustomTool` compute dispatch (4224 bytes, 16-byte aligned). |
| 10 | 11 | #[repr(C)] |
| ... | ... | @@ -899,18 +900,83 @@ fn custom_tool_op(@builtin(global_invocation_id) gid: vec3<u32>) {{ |
| 899 | 900 | // Pipeline Cache & GPU Dispatch |
| 900 | 901 | // ============================================================================ |
| 901 | 902 | |
| 903 | const CUSTOM_UNIFORM_SLOTS: u32 = 256; |
| 904 | const CUSTOM_BIND_GROUP_CACHE_CAPACITY: usize = 128; |
| 905 | |
| 902 | 906 | struct FormatLayouts { |
| 903 | 907 | bgl: wgpu::BindGroupLayout, |
| 904 | 908 | pl: wgpu::PipelineLayout, |
| 905 | 909 | } |
| 906 | 910 | |
| 911 | struct CustomBindGroupKey { |
| 912 | format: wgpu::TextureFormat, |
| 913 | src_1: wgpu::TextureView, |
| 914 | src_2: wgpu::TextureView, |
| 915 | src_3: wgpu::TextureView, |
| 916 | mask: wgpu::TextureView, |
| 917 | dst_view: wgpu::TextureView, |
| 918 | } |
| 919 | |
| 920 | impl CustomBindGroupKey { |
| 921 | fn matches( |
| 922 | &self, |
| 923 | format: wgpu::TextureFormat, |
| 924 | src_1: &wgpu::TextureView, |
| 925 | src_2: &wgpu::TextureView, |
| 926 | src_3: &wgpu::TextureView, |
| 927 | mask: &wgpu::TextureView, |
| 928 | dst_view: &wgpu::TextureView, |
| 929 | ) -> bool { |
| 930 | self.format == format |
| 931 | && &self.src_1 == src_1 |
| 932 | && &self.src_2 == src_2 |
| 933 | && &self.src_3 == src_3 |
| 934 | && &self.mask == mask |
| 935 | && &self.dst_view == dst_view |
| 936 | } |
| 937 | } |
| 938 | |
| 939 | struct CustomBindGroupEntry { |
| 940 | key: CustomBindGroupKey, |
| 941 | bg: wgpu::BindGroup, |
| 942 | last_used: u64, |
| 943 | } |
| 944 | |
| 945 | fn hash_custom_bind_group_key( |
| 946 | format: wgpu::TextureFormat, |
| 947 | src_1: &wgpu::TextureView, |
| 948 | src_2: &wgpu::TextureView, |
| 949 | src_3: &wgpu::TextureView, |
| 950 | mask: &wgpu::TextureView, |
| 951 | dst_view: &wgpu::TextureView, |
| 952 | ) -> u64 { |
| 953 | let mut h = DefaultHasher::new(); |
| 954 | format.hash(&mut h); |
| 955 | src_1.hash(&mut h); |
| 956 | src_2.hash(&mut h); |
| 957 | src_3.hash(&mut h); |
| 958 | mask.hash(&mut h); |
| 959 | dst_view.hash(&mut h); |
| 960 | h.finish() |
| 961 | } |
| 962 | |
| 907 | 963 | /// Caches dynamically compiled `CustomTool` compute pipelines keyed by |
| 908 | | /// `(dst_texture_format, hash_of_normalized_program)`. |
| 964 | /// `(dst_texture_format, hash_of_normalized_program)`, plus a persistent dynamic-offset |
| 965 | /// uniform ring buffer and LRU-cached `BindGroup`s so repeated dispatches avoid per-frame |
| 966 | /// GPU buffer/bind-group allocations. |
| 909 | 967 | #[derive(Default)] |
| 910 | 968 | pub struct CustomShaderCache { |
| 911 | 969 | layouts: HashMap<wgpu::TextureFormat, FormatLayouts>, |
| 912 | 970 | sampler: Option<wgpu::Sampler>, |
| 913 | 971 | pipelines: HashMap<(wgpu::TextureFormat, u64), Option<wgpu::ComputePipeline>>, |
| 972 | uniform_buf: Option<wgpu::Buffer>, |
| 973 | uniform_stride: u32, |
| 974 | uniform_cursor: u32, |
| 975 | bg_cache: HashMap<u64, Vec<CustomBindGroupEntry>>, |
| 976 | bg_count: usize, |
| 977 | bg_tick: u64, |
| 978 | bg_hits: u64, |
| 979 | bg_misses: u64, |
| 914 | 980 | } |
| 915 | 981 | |
| 916 | 982 | impl CustomShaderCache { |
| ... | ... | @@ -922,6 +988,18 @@ impl CustomShaderCache { |
| 922 | 988 | self.pipelines.len() |
| 923 | 989 | } |
| 924 | 990 | |
| 991 | pub fn cached_bind_group_count(&self) -> usize { |
| 992 | self.bg_count |
| 993 | } |
| 994 | |
| 995 | pub fn bind_group_hits(&self) -> u64 { |
| 996 | self.bg_hits |
| 997 | } |
| 998 | |
| 999 | pub fn bind_group_misses(&self) -> u64 { |
| 1000 | self.bg_misses |
| 1001 | } |
| 1002 | |
| 925 | 1003 | fn ensure_format_layouts(&mut self, device: &wgpu::Device, format: wgpu::TextureFormat) { |
| 926 | 1004 | self.layouts.entry(format).or_insert_with(|| { |
| 927 | 1005 | let tex_entry = |binding| wgpu::BindGroupLayoutEntry { |
| ... | ... | @@ -962,8 +1040,8 @@ impl CustomShaderCache { |
| 962 | 1040 | visibility: wgpu::ShaderStages::COMPUTE, |
| 963 | 1041 | ty: wgpu::BindingType::Buffer { |
| 964 | 1042 | ty: wgpu::BufferBindingType::Uniform, |
| 965 | | has_dynamic_offset: false, |
| 966 | | min_binding_size: None, |
| 1043 | has_dynamic_offset: true, |
| 1044 | min_binding_size: NonZeroU64::new(std::mem::size_of::<CustomParams>() as u64), |
| 967 | 1045 | }, |
| 968 | 1046 | count: None, |
| 969 | 1047 | }, |
| ... | ... | @@ -989,6 +1067,134 @@ impl CustomShaderCache { |
| 989 | 1067 | } |
| 990 | 1068 | } |
| 991 | 1069 | |
| 1070 | fn ensure_uniform_buffer(&mut self, device: &wgpu::Device) { |
| 1071 | if self.uniform_buf.is_some() { |
| 1072 | return; |
| 1073 | } |
| 1074 | let uniform_size = std::mem::size_of::<CustomParams>() as u32; |
| 1075 | let min_align = device.limits().min_uniform_buffer_offset_alignment.max(1); |
| 1076 | let stride = uniform_size.div_ceil(min_align) * min_align; |
| 1077 | let buf = device.create_buffer(&wgpu::BufferDescriptor { |
| 1078 | label: Some("custom-tool-params-ring"), |
| 1079 | size: u64::from(CUSTOM_UNIFORM_SLOTS) * u64::from(stride), |
| 1080 | usage: wgpu::BufferUsages::UNIFORM | wgpu::BufferUsages::COPY_DST, |
| 1081 | mapped_at_creation: false, |
| 1082 | }); |
| 1083 | self.uniform_stride = stride; |
| 1084 | self.uniform_buf = Some(buf); |
| 1085 | } |
| 1086 | |
| 1087 | fn alloc_uniform_slot( |
| 1088 | &mut self, |
| 1089 | device: &wgpu::Device, |
| 1090 | queue: &wgpu::Queue, |
| 1091 | params: &CustomParams, |
| 1092 | ) -> u32 { |
| 1093 | self.ensure_uniform_buffer(device); |
| 1094 | let slot = self.uniform_cursor; |
| 1095 | let offset = slot * self.uniform_stride; |
| 1096 | let ubuf = self.uniform_buf.as_ref().expect("uniform buffer initialized"); |
| 1097 | queue.write_buffer(ubuf, u64::from(offset), bytemuck::bytes_of(params)); |
| 1098 | self.uniform_cursor = (slot + 1) % CUSTOM_UNIFORM_SLOTS; |
| 1099 | offset |
| 1100 | } |
| 1101 | |
| 1102 | #[allow(clippy::too_many_arguments)] |
| 1103 | fn ensure_bind_group( |
| 1104 | &mut self, |
| 1105 | device: &wgpu::Device, |
| 1106 | format: wgpu::TextureFormat, |
| 1107 | src_1: &wgpu::TextureView, |
| 1108 | src_2: &wgpu::TextureView, |
| 1109 | src_3: &wgpu::TextureView, |
| 1110 | mask: &wgpu::TextureView, |
| 1111 | dst_view: &wgpu::TextureView, |
| 1112 | ) -> (u64, usize) { |
| 1113 | let hash = hash_custom_bind_group_key(format, src_1, src_2, src_3, mask, dst_view); |
| 1114 | self.bg_tick = self.bg_tick.wrapping_add(1); |
| 1115 | let tick = self.bg_tick; |
| 1116 | |
| 1117 | if let Some(bucket) = self.bg_cache.get_mut(&hash) |
| 1118 | && let Some((idx, entry)) = bucket |
| 1119 | .iter_mut() |
| 1120 | .enumerate() |
| 1121 | .find(|(_, e)| e.key.matches(format, src_1, src_2, src_3, mask, dst_view)) |
| 1122 | { |
| 1123 | entry.last_used = tick; |
| 1124 | self.bg_hits += 1; |
| 1125 | return (hash, idx); |
| 1126 | } |
| 1127 | |
| 1128 | self.bg_misses += 1; |
| 1129 | if self.bg_count >= CUSTOM_BIND_GROUP_CACHE_CAPACITY { |
| 1130 | let mut oldest_hash = None; |
| 1131 | let mut oldest_idx = 0usize; |
| 1132 | let mut oldest_tick = u64::MAX; |
| 1133 | for (&h, bucket) in &self.bg_cache { |
| 1134 | for (idx, entry) in bucket.iter().enumerate() { |
| 1135 | if entry.last_used < oldest_tick { |
| 1136 | oldest_tick = entry.last_used; |
| 1137 | oldest_hash = Some(h); |
| 1138 | oldest_idx = idx; |
| 1139 | } |
| 1140 | } |
| 1141 | } |
| 1142 | if let Some(h) = oldest_hash { |
| 1143 | let empty = if let Some(bucket) = self.bg_cache.get_mut(&h) { |
| 1144 | bucket.swap_remove(oldest_idx); |
| 1145 | self.bg_count -= 1; |
| 1146 | bucket.is_empty() |
| 1147 | } else { |
| 1148 | false |
| 1149 | }; |
| 1150 | if empty { |
| 1151 | self.bg_cache.remove(&h); |
| 1152 | } |
| 1153 | } |
| 1154 | } |
| 1155 | |
| 1156 | let layout = &self.layouts[&format].bgl; |
| 1157 | let sampler = self.sampler.as_ref().expect("sampler initialized"); |
| 1158 | let ubuf = self.uniform_buf.as_ref().expect("uniform buffer initialized"); |
| 1159 | let bg = device.create_bind_group(&wgpu::BindGroupDescriptor { |
| 1160 | label: Some("custom-tool-bg"), |
| 1161 | layout, |
| 1162 | entries: &[ |
| 1163 | wgpu::BindGroupEntry { binding: 0, resource: wgpu::BindingResource::TextureView(src_1) }, |
| 1164 | wgpu::BindGroupEntry { binding: 1, resource: wgpu::BindingResource::TextureView(src_2) }, |
| 1165 | wgpu::BindGroupEntry { binding: 2, resource: wgpu::BindingResource::TextureView(src_3) }, |
| 1166 | wgpu::BindGroupEntry { binding: 3, resource: wgpu::BindingResource::TextureView(mask) }, |
| 1167 | wgpu::BindGroupEntry { binding: 4, resource: wgpu::BindingResource::Sampler(sampler) }, |
| 1168 | wgpu::BindGroupEntry { binding: 5, resource: wgpu::BindingResource::TextureView(dst_view) }, |
| 1169 | wgpu::BindGroupEntry { |
| 1170 | binding: 6, |
| 1171 | resource: wgpu::BindingResource::Buffer(wgpu::BufferBinding { |
| 1172 | buffer: ubuf, |
| 1173 | offset: 0, |
| 1174 | size: NonZeroU64::new(std::mem::size_of::<CustomParams>() as u64), |
| 1175 | }), |
| 1176 | }, |
| 1177 | ], |
| 1178 | }); |
| 1179 | |
| 1180 | let bucket = self.bg_cache.entry(hash).or_default(); |
| 1181 | let idx = bucket.len(); |
| 1182 | bucket.push(CustomBindGroupEntry { |
| 1183 | key: CustomBindGroupKey { |
| 1184 | format, |
| 1185 | src_1: src_1.clone(), |
| 1186 | src_2: src_2.clone(), |
| 1187 | src_3: src_3.clone(), |
| 1188 | mask: mask.clone(), |
| 1189 | dst_view: dst_view.clone(), |
| 1190 | }, |
| 1191 | bg, |
| 1192 | last_used: tick, |
| 1193 | }); |
| 1194 | self.bg_count += 1; |
| 1195 | (hash, idx) |
| 1196 | } |
| 1197 | |
| 992 | 1198 | fn compile_wgsl_pipeline( |
| 993 | 1199 | &mut self, |
| 994 | 1200 | device: &wgpu::Device, |
| ... | ... | @@ -1061,40 +1267,21 @@ impl CustomShaderCache { |
| 1061 | 1267 | if !self.ensure_compiled(device, &norm, format) { |
| 1062 | 1268 | return false; |
| 1063 | 1269 | } |
| 1064 | | let Some(Some(pipeline)) = self.pipelines.get(&key) else { |
| 1270 | if !matches!(self.pipelines.get(&key), Some(Some(_))) { |
| 1065 | 1271 | return false; |
| 1066 | | }; |
| 1067 | | let layout = &self.layouts[&format].bgl; |
| 1068 | | let sampler = self.sampler.as_ref().expect("sampler initialized"); |
| 1069 | | |
| 1070 | | let ubuf = device.create_buffer(&wgpu::BufferDescriptor { |
| 1071 | | label: Some("custom-tool-params"), |
| 1072 | | size: std::mem::size_of::<CustomParams>() as u64, |
| 1073 | | usage: wgpu::BufferUsages::UNIFORM | wgpu::BufferUsages::COPY_DST, |
| 1074 | | mapped_at_creation: false, |
| 1075 | | }); |
| 1076 | | queue.write_buffer(&ubuf, 0, bytemuck::bytes_of(params)); |
| 1272 | } |
| 1077 | 1273 | |
| 1078 | | let bg = device.create_bind_group(&wgpu::BindGroupDescriptor { |
| 1079 | | label: Some("custom-tool-bg"), |
| 1080 | | layout, |
| 1081 | | entries: &[ |
| 1082 | | wgpu::BindGroupEntry { binding: 0, resource: wgpu::BindingResource::TextureView(src_1) }, |
| 1083 | | wgpu::BindGroupEntry { binding: 1, resource: wgpu::BindingResource::TextureView(src_2) }, |
| 1084 | | wgpu::BindGroupEntry { binding: 2, resource: wgpu::BindingResource::TextureView(src_3) }, |
| 1085 | | wgpu::BindGroupEntry { binding: 3, resource: wgpu::BindingResource::TextureView(mask) }, |
| 1086 | | wgpu::BindGroupEntry { binding: 4, resource: wgpu::BindingResource::Sampler(sampler) }, |
| 1087 | | wgpu::BindGroupEntry { binding: 5, resource: wgpu::BindingResource::TextureView(dst_view) }, |
| 1088 | | wgpu::BindGroupEntry { binding: 6, resource: ubuf.as_entire_binding() }, |
| 1089 | | ], |
| 1090 | | }); |
| 1274 | let offset = self.alloc_uniform_slot(device, queue, params); |
| 1275 | let (bg_hash, bg_idx) = self.ensure_bind_group(device, format, src_1, src_2, src_3, mask, dst_view); |
| 1276 | let pipeline = self.pipelines[&key].as_ref().expect("pipeline checked above"); |
| 1277 | let bg = &self.bg_cache[&bg_hash][bg_idx].bg; |
| 1091 | 1278 | |
| 1092 | 1279 | let mut pass = enc.begin_compute_pass(&wgpu::ComputePassDescriptor { |
| 1093 | 1280 | label: Some("custom-tool-pass"), |
| 1094 | 1281 | timestamp_writes: None, |
| 1095 | 1282 | }); |
| 1096 | 1283 | pass.set_pipeline(pipeline); |
| 1097 | | pass.set_bind_group(0, &bg, &[]); |
| 1284 | pass.set_bind_group(0, bg, &[offset]); |
| 1098 | 1285 | pass.dispatch_workgroups(dst_size[0].div_ceil(8), dst_size[1].div_ceil(8), 1); |
| 1099 | 1286 | true |
| 1100 | 1287 | } |
| ... | ... | @@ -1363,4 +1550,150 @@ mod tests { |
| 1363 | 1550 | assert!(!cache.ensure_compiled(eng.device(), &bad_prog, wgpu::TextureFormat::Rgba8Unorm)); |
| 1364 | 1551 | assert!(!cache.ensure_compiled(eng.device(), &bad_prog, wgpu::TextureFormat::Rgba8Unorm)); |
| 1365 | 1552 | } |
| 1553 | |
| 1554 | #[test] |
| 1555 | fn custom_shader_cache_reuses_uniform_buffer_and_bind_groups() { |
| 1556 | let eng = Engine::new_headless().expect("gpu"); |
| 1557 | let mut cache = CustomShaderCache::new(); |
| 1558 | let prog = CustomProgram { |
| 1559 | red: "n1".to_owned(), |
| 1560 | green: "0".to_owned(), |
| 1561 | blue: "0".to_owned(), |
| 1562 | alpha: "1".to_owned(), |
| 1563 | ..Default::default() |
| 1564 | }; |
| 1565 | let dummy = create_texture(eng.device(), [1, 1], 0); |
| 1566 | let dst = create_texture(eng.device(), [8, 8], 1); |
| 1567 | |
| 1568 | for i in 0..10u32 { |
| 1569 | let v = (i as f32 + 1.0) / 10.0; |
| 1570 | let params = CustomParams { |
| 1571 | n0: [v, 0.0, 0.0, 0.0], |
| 1572 | img_dims1: [8.0, 8.0, 8.0, 8.0], |
| 1573 | ..Default::default() |
| 1574 | }; |
| 1575 | let mut enc = eng.device().create_command_encoder(&Default::default()); |
| 1576 | assert!(cache.dispatch( |
| 1577 | eng.device(), |
| 1578 | eng.queue(), |
| 1579 | &mut enc, |
| 1580 | &prog, |
| 1581 | wgpu::TextureFormat::Rgba8Unorm, |
| 1582 | &dummy.view, |
| 1583 | &dummy.view, |
| 1584 | &dummy.view, |
| 1585 | &dummy.view, |
| 1586 | &dst.view, |
| 1587 | [8, 8], |
| 1588 | &params, |
| 1589 | )); |
| 1590 | eng.queue().submit(Some(enc.finish())); |
| 1591 | let rgba = eng.readback_rgba(&dst).expect("readback"); |
| 1592 | let expected = (v * 255.0).round() as i32; |
| 1593 | assert!((rgba[0] as i32 - expected).abs() <= 1, "iter {i}: got {} expected {expected}", rgba[0]); |
| 1594 | } |
| 1595 | |
| 1596 | assert_eq!(cache.cached_pipeline_count(), 1); |
| 1597 | assert_eq!(cache.cached_bind_group_count(), 1); |
| 1598 | assert_eq!(cache.bind_group_misses(), 1); |
| 1599 | assert_eq!(cache.bind_group_hits(), 9); |
| 1600 | } |
| 1601 | |
| 1602 | #[test] |
| 1603 | fn custom_shader_cache_isolates_multiple_dispatches_in_single_encoder() { |
| 1604 | let eng = Engine::new_headless().expect("gpu"); |
| 1605 | let mut cache = CustomShaderCache::new(); |
| 1606 | let prog = CustomProgram { |
| 1607 | red: "n1".to_owned(), |
| 1608 | green: "n2".to_owned(), |
| 1609 | blue: "0".to_owned(), |
| 1610 | alpha: "1".to_owned(), |
| 1611 | ..Default::default() |
| 1612 | }; |
| 1613 | let dummy = create_texture(eng.device(), [1, 1], 0); |
| 1614 | let dst_a = create_texture(eng.device(), [8, 8], 1); |
| 1615 | let dst_b = create_texture(eng.device(), [8, 8], 2); |
| 1616 | |
| 1617 | let params_a = CustomParams { |
| 1618 | n0: [0.2, 0.4, 0.0, 0.0], |
| 1619 | img_dims1: [8.0, 8.0, 8.0, 8.0], |
| 1620 | ..Default::default() |
| 1621 | }; |
| 1622 | let params_b = CustomParams { |
| 1623 | n0: [0.8, 0.6, 0.0, 0.0], |
| 1624 | img_dims1: [8.0, 8.0, 8.0, 8.0], |
| 1625 | ..Default::default() |
| 1626 | }; |
| 1627 | |
| 1628 | let mut enc = eng.device().create_command_encoder(&Default::default()); |
| 1629 | assert!(cache.dispatch( |
| 1630 | eng.device(), |
| 1631 | eng.queue(), |
| 1632 | &mut enc, |
| 1633 | &prog, |
| 1634 | wgpu::TextureFormat::Rgba8Unorm, |
| 1635 | &dummy.view, |
| 1636 | &dummy.view, |
| 1637 | &dummy.view, |
| 1638 | &dummy.view, |
| 1639 | &dst_a.view, |
| 1640 | [8, 8], |
| 1641 | &params_a, |
| 1642 | )); |
| 1643 | assert!(cache.dispatch( |
| 1644 | eng.device(), |
| 1645 | eng.queue(), |
| 1646 | &mut enc, |
| 1647 | &prog, |
| 1648 | wgpu::TextureFormat::Rgba8Unorm, |
| 1649 | &dummy.view, |
| 1650 | &dummy.view, |
| 1651 | &dummy.view, |
| 1652 | &dummy.view, |
| 1653 | &dst_b.view, |
| 1654 | [8, 8], |
| 1655 | &params_b, |
| 1656 | )); |
| 1657 | eng.queue().submit(Some(enc.finish())); |
| 1658 | |
| 1659 | let rgba_a = eng.readback_rgba(&dst_a).expect("readback a"); |
| 1660 | let rgba_b = eng.readback_rgba(&dst_b).expect("readback b"); |
| 1661 | assert!((rgba_a[0] as i32 - 51).abs() <= 1, "a.r={}", rgba_a[0]); |
| 1662 | assert!((rgba_a[1] as i32 - 102).abs() <= 1, "a.g={}", rgba_a[1]); |
| 1663 | assert!((rgba_b[0] as i32 - 204).abs() <= 1, "b.r={}", rgba_b[0]); |
| 1664 | assert!((rgba_b[1] as i32 - 153).abs() <= 1, "b.g={}", rgba_b[1]); |
| 1665 | } |
| 1666 | |
| 1667 | #[test] |
| 1668 | fn custom_shader_cache_evicts_lru_bind_groups_at_capacity() { |
| 1669 | let eng = Engine::new_headless().expect("gpu"); |
| 1670 | let mut cache = CustomShaderCache::new(); |
| 1671 | let prog = CustomProgram::default(); |
| 1672 | let dummy = create_texture(eng.device(), [1, 1], 0); |
| 1673 | let params = CustomParams { |
| 1674 | img_dims1: [4.0, 4.0, 4.0, 4.0], |
| 1675 | ..Default::default() |
| 1676 | }; |
| 1677 | |
| 1678 | let mut enc = eng.device().create_command_encoder(&Default::default()); |
| 1679 | for i in 0..(CUSTOM_BIND_GROUP_CACHE_CAPACITY + 8) { |
| 1680 | let dst = create_texture(eng.device(), [4, 4], i as u64 + 1); |
| 1681 | assert!(cache.dispatch( |
| 1682 | eng.device(), |
| 1683 | eng.queue(), |
| 1684 | &mut enc, |
| 1685 | &prog, |
| 1686 | wgpu::TextureFormat::Rgba8Unorm, |
| 1687 | &dummy.view, |
| 1688 | &dummy.view, |
| 1689 | &dummy.view, |
| 1690 | &dummy.view, |
| 1691 | &dst.view, |
| 1692 | [4, 4], |
| 1693 | &params, |
| 1694 | )); |
| 1695 | } |
| 1696 | eng.queue().submit(Some(enc.finish())); |
| 1697 | assert_eq!(cache.cached_bind_group_count(), CUSTOM_BIND_GROUP_CACHE_CAPACITY); |
| 1698 | } |
| 1366 | 1699 | } |