add Capabilities::EARLY_DEPTH_TEST

This commit is contained in:
teoxoy authored and Connor Fitzgerald committed 2023-02-16 18:16:49 -05:00
1 parent df567a94eb
commit 964d9204bc
2 files changed
+14 -2

No files matched your search

+12 -2
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")]
+2
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;
}
}