diff --git a/lyra-game/src/render/graph/passes/light_cull_compute.rs b/lyra-game/src/render/graph/passes/light_cull_compute.rs index e477d41..edfd0d0 100644 --- a/lyra-game/src/render/graph/passes/light_cull_compute.rs +++ b/lyra-game/src/render/graph/passes/light_cull_compute.rs @@ -1,15 +1,14 @@ use std::{mem, rc::Rc}; +use glam::Vec2Swizzles; use lyra_ecs::World; use lyra_game_derive::RenderGraphLabel; use wgpu::util::DeviceExt; use crate::render::{ graph::{ - RenderGraphContext, Node, NodeDesc, NodeType, SlotAttribute, - SlotValue, - }, - resource::{ComputePipelineDescriptor, PipelineDescriptor, Shader}, + Node, NodeDesc, NodeType, RenderGraphContext, SlotAttribute, SlotValue + }, renderer::ScreenSize, resource::{ComputePipelineDescriptor, PipelineDescriptor, Shader} }; use super::{BasePassSlots, LightBasePassSlots}; @@ -216,8 +215,14 @@ impl Node for LightCullComputePass { desc } - fn prepare(&mut self, _world: &mut World, context: &mut RenderGraphContext) { + fn prepare(&mut self, world: &mut World, context: &mut RenderGraphContext) { context.queue_buffer_write_with(LightCullComputePassSlots::IndexCounterBuffer, 0, 0); + + let screen_size = world.get_resource::(); + if screen_size.xy() != self.workgroup_size { + self.workgroup_size = screen_size.xy(); + todo!("Resize buffers and other resources"); + } } fn execute(