diff options
| author | HampusM <hampus@hampusmat.com> | 2026-08-06 15:57:29 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-08-06 15:57:29 +0200 |
| commit | af2af06f7bc145e0661def88861f56ca92dd3d89 (patch) | |
| tree | 41e3fa71e86f4b455a4f6a5d6fa7aaed9fe8a4d8 /engine/src/rendering/shader/cursor.rs | |
| parent | b7757ab410c99c35550327d896fcf5723aa9a09a (diff) | |
feat(engine): add shader binding texture kind enum
Diffstat (limited to 'engine/src/rendering/shader/cursor.rs')
| -rw-r--r-- | engine/src/rendering/shader/cursor.rs | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/engine/src/rendering/shader/cursor.rs b/engine/src/rendering/shader/cursor.rs index c54ffc9..169ad0b 100644 --- a/engine/src/rendering/shader/cursor.rs +++ b/engine/src/rendering/shader/cursor.rs @@ -201,7 +201,7 @@ pub enum BindingValue FVec3(Vec3<f32>), Color(Color<f32>), FMat4x4(Matrix<f32, 4, 4>), - Texture(RenderingObjectId), + Texture(RenderingObjectId, BindingTextureKind), } impl BindingValue @@ -272,9 +272,15 @@ impl BindingValue _, _, ) if ty.row_cnt() == Some(4) && ty.column_cnt() == Some(4) => Ok(()), - (Self::Texture(_), TypeKind::Resource, _, _, _, Some(res_shape)) - if (res_shape & ResourceShape::BASE) - .contains(ResourceShape::TEXTURE_2D) => + ( + Self::Texture(_, BindingTextureKind::Texture2D), + TypeKind::Resource, + _, + _, + _, + Some(res_shape), + ) if (res_shape & ResourceShape::BASE) + .contains(ResourceShape::TEXTURE_2D) => { Ok(()) } @@ -345,6 +351,13 @@ pub struct Binding pub value: BindingValue, } +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[non_exhaustive] +pub enum BindingTextureKind +{ + Texture2D, +} + #[derive(Debug, thiserror::Error)] #[non_exhaustive] pub enum BindingError |
