[valid] add Capabilities::CUBE_ARRAY_TEXTURES

This commit is contained in:
teoxoy
2023-10-02 21:08:02 +02:00
committed by Jim Blandy
parent de9913f476
commit 5a0fb630da
2 changed files with 13 additions and 3 deletions

View File

@@ -113,14 +113,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
}
}

View File

@@ -559,9 +559,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)