aboutsummaryrefslogtreecommitdiff
path: root/stockton-render/src/ui.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
commite1cc0e9a9d191bcd3a634be46fd3555d430b07a8 (patch)
tree7f984fbb55c935797217d105e93f3f415f35d226 /stockton-render/src/ui.rs
parent0353181306702c40ad0fe482b5c2b159b46794a4 (diff)
feat(skeleton): draw pass aware of position
Diffstat (limited to 'stockton-render/src/ui.rs')
-rw-r--r--stockton-render/src/ui.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/stockton-render/src/ui.rs b/stockton-render/src/ui.rs
index d1689be..77ff805 100644
--- a/stockton-render/src/ui.rs
+++ b/stockton-render/src/ui.rs
@@ -8,7 +8,7 @@ use stockton_skeleton::{
VertexPrimitiveAssemblerSpec,
},
context::RenderingContext,
- draw_passes::{util::TargetSpecificResources, DrawPass, IntoDrawPass},
+ draw_passes::{util::TargetSpecificResources, DrawPass, IntoDrawPass, PassPosition},
error::{EnvironmentError, LockPoisoned},
queue_negotiator::QueueNegotiator,
texture::{
@@ -32,8 +32,7 @@ use hal::{
buffer::SubRange,
command::{ClearColor, ClearValue, RenderAttachmentInfo, SubpassContents},
format::Format,
- image::Layout,
- pass::{Attachment, AttachmentLoadOp, AttachmentOps, AttachmentStoreOp},
+ pass::Attachment,
pso::{
BlendDesc, BlendOp, BlendState, ColorBlendDesc, ColorMask, DepthStencilDesc, Face, Factor,
FrontFace, InputAssemblerDesc, LogicOp, PolygonMode, Primitive, Rasterizer, Rect,
@@ -54,7 +53,7 @@ pub struct UiDrawPass<'a> {
framebuffers: TargetSpecificResources<FramebufferT>,
}
-impl<'a> DrawPass for UiDrawPass<'a> {
+impl<'a, P: PassPosition> DrawPass<P> for UiDrawPass<'a> {
fn queue_draw(
&mut self,
session: &Session,
@@ -208,7 +207,7 @@ impl<'a> DrawPass for UiDrawPass<'a> {
}
}
-impl<'a> IntoDrawPass<UiDrawPass<'a>> for () {
+impl<'a, P: PassPosition> IntoDrawPass<UiDrawPass<'a>, P> for () {
fn init(self, session: &mut Session, context: &mut RenderingContext) -> Result<UiDrawPass<'a>> {
let spec = PipelineSpecBuilder::default()
.rasterizer(Rasterizer {
@@ -263,12 +262,9 @@ impl<'a> IntoDrawPass<UiDrawPass<'a>> for () {
colors: vec![Attachment {
format: Some(context.target_chain().properties().format),
samples: 1,
- ops: AttachmentOps::new(AttachmentLoadOp::Load, AttachmentStoreOp::Store),
- stencil_ops: AttachmentOps::new(
- AttachmentLoadOp::DontCare,
- AttachmentStoreOp::DontCare,
- ),
- layouts: Layout::ColorAttachmentOptimal..Layout::ColorAttachmentOptimal,
+ ops: P::attachment_ops(),
+ stencil_ops: P::attachment_ops(),
+ layouts: P::layout_as_range(),
}],
depth: None,
inputs: vec![],