mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
add Capabilities::EARLY_DEPTH_TEST
This commit is contained in:
committed by
Connor Fitzgerald
parent
df567a94eb
commit
964d9204bc
@@ -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")]
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user