From a23b9d22b1a9e75c7970b17e7be4084fc284e73f Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Mon, 2 Oct 2023 21:08:02 +0200 Subject: [PATCH] [valid] add `Capabilities::CUBE_ARRAY_TEXTURES` --- src/valid/mod.rs | 6 ++++-- src/valid/type.rs | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/valid/mod.rs b/src/valid/mod.rs index f99a2055ce..15c78717ae 100644 --- a/src/valid/mod.rs +++ b/src/valid/mod.rs @@ -112,14 +112,16 @@ bitflags::bitflags! { const MULTISAMPLED_SHADING = 0x800; /// Support for ray queries and acceleration structures. const RAY_QUERY = 0x1000; - /// Support for generating two sources for blending from fragement shaders + /// Support for generating two sources for blending from fragement shaders. const DUAL_SOURCE_BLENDING = 0x2000; + /// Support for arrayed cube textures. + const CUBE_ARRAY_TEXTURES = 0x4000; } } impl Default for Capabilities { fn default() -> Self { - Self::MULTISAMPLED_SHADING + Self::MULTISAMPLED_SHADING | Self::CUBE_ARRAY_TEXTURES } } diff --git a/src/valid/type.rs b/src/valid/type.rs index f8ceb463c6..65ed4a425b 100644 --- a/src/valid/type.rs +++ b/src/valid/type.rs @@ -557,9 +557,17 @@ impl super::Validator { ti } - Ti::Image { .. } | Ti::Sampler { .. } => { + Ti::Image { + dim, + arrayed, + class: _, + } => { + if arrayed && matches!(dim, crate::ImageDimension::Cube) { + self.require_type_capability(Capabilities::CUBE_ARRAY_TEXTURES)?; + } TypeInfo::new(TypeFlags::ARGUMENT, Alignment::ONE) } + Ti::Sampler { .. } => TypeInfo::new(TypeFlags::ARGUMENT, Alignment::ONE), Ti::AccelerationStructure => { self.require_type_capability(Capabilities::RAY_QUERY)?; TypeInfo::new(TypeFlags::ARGUMENT, Alignment::ONE)