summaryrefslogtreecommitdiffstats
path: root/src/texture.rs
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-05-21 07:58:47 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-05-21 07:58:47 -0400
commit14ca7b5fc15eb2618b46bde0cac85e37ebc9ebd9 (patch)
tree6c4864880bc54778122f1c0e4fa195c16cc064db /src/texture.rs
parenta0a3b3974cab754c10a1517d82762b99482970ce (diff)
downloadsystemic4x-14ca7b5fc15eb2618b46bde0cac85e37ebc9ebd9.tar.gz
systemic4x-14ca7b5fc15eb2618b46bde0cac85e37ebc9ebd9.tar.bz2
systemic4x-14ca7b5fc15eb2618b46bde0cac85e37ebc9ebd9.zip
tacmap back as canvas. begin work on fleet scheduling
Diffstat (limited to 'src/texture.rs')
-rw-r--r--src/texture.rs57
1 files changed, 32 insertions, 25 deletions
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 }