Skip to content

Commit

Permalink
[valid] add Capabilities::CUBE_ARRAY_TEXTURES
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy authored and jimblandy committed Oct 18, 2023
1 parent de9913f commit 5a0fb63
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/valid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
10 changes: 9 additions & 1 deletion src/valid/type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5a0fb63

Please sign in to comment.