diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-22 00:27:38 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-22 00:27:38 +0100 |
commit | c682a1315adfa4e90d661d25e55df6e99a884d40 (patch) | |
tree | 96c2b1bb075ae7cea43f0588373af1af00936706 /client/src/scene_render.rs | |
parent | 0612ce58890741428f10c73a63bcb417dcd43a9f (diff) | |
download | weareserver-c682a1315adfa4e90d661d25e55df6e99a884d40.tar weareserver-c682a1315adfa4e90d661d25e55df6e99a884d40.tar.bz2 weareserver-c682a1315adfa4e90d661d25e55df6e99a884d40.tar.zst |
move scene bgl to scene_prepare
Diffstat (limited to 'client/src/scene_render.rs')
-rw-r--r-- | client/src/scene_render.rs | 66 |
1 files changed, 2 insertions, 64 deletions
diff --git a/client/src/scene_render.rs b/client/src/scene_render.rs index d621ba6..2720e33 100644 --- a/client/src/scene_render.rs +++ b/client/src/scene_render.rs @@ -19,74 +19,12 @@ use glam::{EulerRot, Mat3, Mat4}; use std::sync::Arc; use weareshared::{packets::Resource, resources::Prefab, tree::SceneTree}; use wgpu::{ - BindGroupLayout, BindGroupLayoutDescriptor, BindGroupLayoutEntry, BindingType, - BufferBindingType, Color, CommandEncoder, Device, IndexFormat, LoadOp, Operations, - RenderPassColorAttachment, RenderPassDepthStencilAttachment, RenderPassDescriptor, - SamplerBindingType, ShaderStages, StoreOp, TextureSampleType, TextureView, - TextureViewDimension, + Color, CommandEncoder, IndexFormat, LoadOp, Operations, RenderPassColorAttachment, + RenderPassDepthStencilAttachment, RenderPassDescriptor, ShaderStages, StoreOp, TextureView, }; pub struct ScenePipeline; -pub struct SceneBgLayouts { - pub texture: BindGroupLayout, - pub material: BindGroupLayout, - pub joints: BindGroupLayout, -} -impl SceneBgLayouts { - pub fn load(device: &Device) -> Self { - Self { - texture: device.create_bind_group_layout(&BindGroupLayoutDescriptor { - entries: &[ - BindGroupLayoutEntry { - binding: 0, - count: None, - visibility: ShaderStages::FRAGMENT, - ty: BindingType::Texture { - sample_type: TextureSampleType::Float { filterable: true }, - view_dimension: TextureViewDimension::D2, - multisampled: false, - }, - }, - BindGroupLayoutEntry { - binding: 1, - count: None, - visibility: ShaderStages::FRAGMENT, - ty: BindingType::Sampler(SamplerBindingType::Filtering), - }, - ], - label: None, - }), - material: device.create_bind_group_layout(&BindGroupLayoutDescriptor { - entries: &[BindGroupLayoutEntry { - binding: 0, - count: None, - visibility: ShaderStages::FRAGMENT, - ty: BindingType::Buffer { - ty: BufferBindingType::Uniform, - has_dynamic_offset: false, - min_binding_size: None, - }, - }], - label: None, - }), - joints: device.create_bind_group_layout(&BindGroupLayoutDescriptor { - entries: &[BindGroupLayoutEntry { - binding: 0, - count: None, - visibility: ShaderStages::VERTEX, - ty: BindingType::Buffer { - ty: BufferBindingType::Uniform, - has_dynamic_offset: false, - min_binding_size: None, - }, - }], - label: None, - }), - } - } -} - impl ScenePipeline { pub fn draw( &mut self, |