Files
wgpu-renderer/Source/Render/Pipeline/DepthBiasState.rs
2021-11-23 20:09:05 -03:00

21 lines
544 B
Rust

use serde::{Deserialize, Serialize};
#[derive(Copy, Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct DepthBiasState {
/// Constant depth biasing factor, in basic units of the depth format.
pub constant: i32,
/// Slope depth biasing factor.
pub slope_scale: f32,
/// Depth bias clamp value (absolute).
pub clamp: f32,
}
impl DepthBiasState {
/// Returns true if the depth biasing is enabled.
pub fn IsEnabled(&self) -> bool {
self.constant != 0 || self.slope_scale != 0.0
}
}