add Capabilities::EARLY_DEPTH_TEST

This commit is contained in:
teoxoy
2023-02-16 21:44:06 +01:00
committed by Connor Fitzgerald
parent df567a94eb
commit 964d9204bc
2 changed files with 14 additions and 2 deletions

View File

@@ -509,8 +509,18 @@ impl super::Validator {
mod_info: &ModuleInfo,
) -> Result<FunctionInfo, WithSpan<EntryPointError>> {
#[cfg(feature = "validate")]
if ep.early_depth_test.is_some() && ep.stage != crate::ShaderStage::Fragment {
return Err(EntryPointError::UnexpectedEarlyDepthTest.with_span());
if ep.early_depth_test.is_some() {
let required = Capabilities::EARLY_DEPTH_TEST;
if !self.capabilities.contains(required) {
return Err(
EntryPointError::Result(VaryingError::UnsupportedCapability(required))
.with_span(),
);
}
if ep.stage != crate::ShaderStage::Fragment {
return Err(EntryPointError::UnexpectedEarlyDepthTest.with_span());
}
}
#[cfg(feature = "validate")]

View File

@@ -108,6 +108,8 @@ bitflags::bitflags! {
const STORAGE_TEXTURE_16BIT_NORM_FORMATS = 0x100;
/// Support for [`BuiltIn::ViewIndex`].
const MULTIVIEW = 0x200;
/// Support for `early_depth_test`.
const EARLY_DEPTH_TEST = 0x400;
}
}