pub struct GlDepthState {
pub enabled: bool,
pub compare: CompareFunction,
/* private fields */
}Expand description
The depth-test state of one draw.
WebGL splits “test” from “write” into two independent calls
(DEPTH_TEST plus depthFunc, and depthMask), whereas WebGPU’s
DepthStencilState derives both from depth_write_enabled plus the
presence of an attachment. Keeping the two axes separate here is what
lets a transparent overlay bind a depth buffer it must read but must
not write.
Fields§
§enabled: boolWhether DEPTH_TEST is enabled.
compare: CompareFunctionThe comparison between the fragment’s depth and the stored depth.
Implementations§
Source§impl GlDepthState
impl GlDepthState
pub fn get_enabled(&self) -> bool
pub fn get_compare(&self) -> &CompareFunction
Source§impl GlDepthState
impl GlDepthState
pub fn new(enabled: bool, compare: CompareFunction, write_enabled: bool) -> Self
Trait Implementations§
Source§impl Clone for GlDepthState
impl Clone for GlDepthState
impl Copy for GlDepthState
Source§impl Debug for GlDepthState
impl Debug for GlDepthState
Source§impl PartialEq for GlDepthState
impl PartialEq for GlDepthState
impl StructuralPartialEq for GlDepthState
Auto Trait Implementations§
impl Freeze for GlDepthState
impl RefUnwindSafe for GlDepthState
impl Send for GlDepthState
impl Sync for GlDepthState
impl Unpin for GlDepthState
impl UnsafeUnpin for GlDepthState
impl UnwindSafe for GlDepthState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more