From c682a1315adfa4e90d661d25e55df6e99a884d40 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 22 Jan 2025 00:27:38 +0100 Subject: move scene bgl to scene_prepare --- client/src/scene_render.rs | 66 ++-------------------------------------------- 1 file changed, 2 insertions(+), 64 deletions(-) (limited to 'client/src/scene_render.rs') 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, -- cgit v1.2.3-70-g09d2