mirror of
https://github.com/guilhermewerner/wgpu-renderer
synced 2025-06-16 13:54:21 +00:00
21 lines
544 B
Rust
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
|
|
}
|
|
}
|