diff options
| author | HampusM <hampus@hampusmat.com> | 2026-08-26 17:39:17 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-08-26 17:39:17 +0200 |
| commit | 7abe3894137f55aaa7aa0e0c491795342b6124bc (patch) | |
| tree | 578cd3bce6cdeeacf0ae82f6c6d727612a1b17d0 /engine/src/rendering.rs | |
| parent | 07171b85b9365bb52b84fd865066d01d885fcbb3 (diff) | |
feat(engine): add cube map support to UpdateTexture rendering commmand
Diffstat (limited to 'engine/src/rendering.rs')
| -rw-r--r-- | engine/src/rendering.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/engine/src/rendering.rs b/engine/src/rendering.rs index 2a73625..572f045 100644 --- a/engine/src/rendering.rs +++ b/engine/src/rendering.rs @@ -25,7 +25,7 @@ use crate::rendering::blending::Config as BlendingConfig; use crate::rendering::object::{Id as ObjectId, Store as ObjectStore}; use crate::rendering::shader::cursor::Binding as ShaderBinding; use crate::rendering::shader::Program as ShaderProgram; -use crate::texture::Texture; +use crate::texture::{CubeMapFace, Texture}; use crate::vector::Vec2; use crate::windowing::dpi::PhysicalSize; use crate::windowing::window::Window; @@ -216,11 +216,14 @@ pub enum Command ActivateShader(ObjectId), SetShaderBinding(ShaderBinding), CreateTexture(ObjectId, AssetOrValue<Texture>), - // TODO: Make UpdateTexture command able to handle textures other than 2D textures UpdateTexture { obj_id: ObjectId, image: Image, + update: TextureUpdate, + + /// Specifies texel index offsets in the x and y directions within the texture + /// pixels. offset: Vec2<u32>, }, RemoveTexture(ObjectId), @@ -399,6 +402,17 @@ bitflags! { } } +#[derive(Debug, Clone)] +#[non_exhaustive] +pub enum TextureUpdate +{ + Texture2D, + CubeMap + { + face: CubeMapFace, + }, +} + /// Rendering command FIFO queue. #[derive(Debug, Sole)] pub struct CommandQueue |
