From 14ca7b5fc15eb2618b46bde0cac85e37ebc9ebd9 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Thu, 21 May 2026 07:58:47 -0400 Subject: tacmap back as canvas. begin work on fleet scheduling --- src/texture.rs | 57 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 25 deletions(-) (limited to 'src/texture.rs') diff --git a/src/texture.rs b/src/texture.rs index cef96d6..9cc0656 100644 --- a/src/texture.rs +++ b/src/texture.rs @@ -29,31 +29,7 @@ impl Texture } ); - let bind_group_layout = device.create_bind_group_layout( - &wgpu::BindGroupLayoutDescriptor { - label: None, - entries: &[ - wgpu::BindGroupLayoutEntry { - binding: 0, - visibility: wgpu::ShaderStages::FRAGMENT, - ty: wgpu::BindingType::Texture { - sample_type: wgpu::TextureSampleType::Float { - filterable: true - }, - view_dimension: wgpu::TextureViewDimension::D2, - multisampled: false - }, - count: None - }, - wgpu::BindGroupLayoutEntry { - binding: 1, - visibility: wgpu::ShaderStages::FRAGMENT, - ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering), - count: None - } - ] - } - ); + let bind_group_layout = Self::bindgroup_layout(device); let bind_group = device.create_bind_group( &wgpu::BindGroupDescriptor { @@ -81,6 +57,37 @@ impl Texture } } + pub fn bindgroup_layout( + device: &wgpu::Device) + -> wgpu::BindGroupLayout + { + device.create_bind_group_layout( + &wgpu::BindGroupLayoutDescriptor { + label: None, + entries: &[ + wgpu::BindGroupLayoutEntry { + binding: 0, + visibility: wgpu::ShaderStages::FRAGMENT, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { + filterable: true + }, + view_dimension: wgpu::TextureViewDimension::D2, + multisampled: false + }, + count: None + }, + wgpu::BindGroupLayoutEntry { + binding: 1, + visibility: wgpu::ShaderStages::FRAGMENT, + ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering), + count: None + } + ] + } + ) + } + pub fn view(&self) -> &wgpu::TextureView { &self.view } -- cgit v1.2.3