aboutsummaryrefslogtreecommitdiff
path: root/stockton-render/src/draw/builders/pipeline.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:23 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:23 +0100
commit6fd563b20772ad0ad279f6461179978766a77948 (patch)
tree12e8e77ca6ae594de509e24f2598c0369bb0f766 /stockton-render/src/draw/builders/pipeline.rs
parent5851b43ca65d979b2d290eb94bd0187f9b9e5736 (diff)
fix(render): ui draw pass validation errors
Diffstat (limited to 'stockton-render/src/draw/builders/pipeline.rs')
-rw-r--r--stockton-render/src/draw/builders/pipeline.rs21
1 files changed, 16 insertions, 5 deletions
diff --git a/stockton-render/src/draw/builders/pipeline.rs b/stockton-render/src/draw/builders/pipeline.rs
index 329fa7f..0c06774 100644
--- a/stockton-render/src/draw/builders/pipeline.rs
+++ b/stockton-render/src/draw/builders/pipeline.rs
@@ -107,6 +107,11 @@ pub struct PipelineSpec {
push_constants: Vec<(ShaderStageFlags, Range<u32>)>,
+ #[builder(default = "false")]
+ dynamic_viewport: bool,
+ #[builder(default = "false")]
+ dynamic_scissor: bool,
+
renderpass: RenderpassSpec,
}
@@ -176,11 +181,17 @@ impl PipelineSpec {
// Baked states
let baked_states = BakedStates {
- viewport: Some(Viewport {
- rect: extent.rect(),
- depth: (0.0..1.0),
- }),
- scissor: Some(extent.rect()),
+ viewport: match self.dynamic_viewport {
+ true => None,
+ false => Some(Viewport {
+ rect: extent.rect(),
+ depth: (0.0..1.0),
+ }),
+ },
+ scissor: match self.dynamic_scissor {
+ true => None,
+ false => Some(extent.rect()),
+ },
blend_constants: None,
depth_bounds: None,
};