aboutsummaryrefslogtreecommitdiff
path: root/stockton-render/src
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:24 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:24 +0100
commit1d0dbcd1750cb1dd0060fc8dfa3ba8a64b7f8afe (patch)
treea4bc4fe9f3b4113dc523473af14db89653168991 /stockton-render/src
parent5360fe6a337145b2640ec1e5727c97fd9bbeacd9 (diff)
fix(skeleton): add used_layout to renderpass
fixes validation errors
Diffstat (limited to 'stockton-render/src')
-rw-r--r--stockton-render/src/level.rs44
-rw-r--r--stockton-render/src/ui.rs20
2 files changed, 39 insertions, 25 deletions
diff --git a/stockton-render/src/level.rs b/stockton-render/src/level.rs
index fc5111e..0c88a0b 100644
--- a/stockton-render/src/level.rs
+++ b/stockton-render/src/level.rs
@@ -10,8 +10,8 @@ use stockton_skeleton::{
image::{BoundImageView, ImageSpec, DEPTH_RESOURCES},
},
builders::{
- CompletePipeline, PipelineSpecBuilder, RenderpassSpec, ShaderDesc, VertexBufferSpec,
- VertexPrimitiveAssemblerSpec,
+ AttachmentSpec, CompletePipeline, PipelineSpecBuilder, RenderpassSpec, ShaderDesc,
+ VertexBufferSpec, VertexPrimitiveAssemblerSpec,
},
context::RenderingContext,
draw_passes::{util::TargetSpecificResources, DrawPass, IntoDrawPass, PassPosition},
@@ -354,22 +354,32 @@ where
})
.push_constants(vec![(ShaderStageFlags::VERTEX, 0..64)])
.renderpass(RenderpassSpec {
- colors: vec![Attachment {
- format: Some(context.target_chain().properties().format),
- samples: 1,
- ops: P::attachment_ops(),
- stencil_ops: P::attachment_ops(),
- layouts: P::layout_as_range(),
+ colors: vec![AttachmentSpec {
+ attachment: Attachment {
+ format: Some(context.target_chain().properties().format),
+ samples: 1,
+ ops: P::attachment_ops(),
+ stencil_ops: P::attachment_ops(),
+ layouts: P::layout_as_range(),
+ },
+
+ used_layout: Layout::ColorAttachmentOptimal,
}],
- depth: Some(Attachment {
- format: Some(context.target_chain().properties().depth_format),
- samples: 1,
- ops: AttachmentOps::new(AttachmentLoadOp::Clear, AttachmentStoreOp::DontCare),
- stencil_ops: AttachmentOps::new(
- AttachmentLoadOp::DontCare,
- AttachmentStoreOp::DontCare,
- ),
- layouts: Layout::Undefined..Layout::DepthStencilAttachmentOptimal,
+ depth: Some(AttachmentSpec {
+ attachment: Attachment {
+ format: Some(context.target_chain().properties().depth_format),
+ samples: 1,
+ ops: AttachmentOps::new(
+ AttachmentLoadOp::Clear,
+ AttachmentStoreOp::DontCare,
+ ),
+ stencil_ops: AttachmentOps::new(
+ AttachmentLoadOp::DontCare,
+ AttachmentStoreOp::DontCare,
+ ),
+ layouts: Layout::Undefined..Layout::DepthStencilAttachmentOptimal,
+ },
+ used_layout: Layout::DepthStencilAttachmentOptimal,
}),
inputs: vec![],
resolves: vec![],
diff --git a/stockton-render/src/ui.rs b/stockton-render/src/ui.rs
index ad53d80..0d53c4f 100644
--- a/stockton-render/src/ui.rs
+++ b/stockton-render/src/ui.rs
@@ -4,8 +4,8 @@ use crate::window::UiState;
use stockton_skeleton::{
buffers::draw::DrawBuffers,
builders::{
- CompletePipeline, PipelineSpecBuilder, RenderpassSpec, ShaderDesc, VertexBufferSpec,
- VertexPrimitiveAssemblerSpec,
+ AttachmentSpec, CompletePipeline, PipelineSpecBuilder, RenderpassSpec, ShaderDesc,
+ VertexBufferSpec, VertexPrimitiveAssemblerSpec,
},
context::RenderingContext,
draw_passes::{util::TargetSpecificResources, DrawPass, IntoDrawPass, PassPosition},
@@ -33,6 +33,7 @@ use hal::{
buffer::SubRange,
command::{ClearColor, ClearValue, RenderAttachmentInfo, SubpassContents},
format::Format,
+ image::Layout,
pass::Attachment,
pso::{
BlendDesc, BlendOp, BlendState, ColorBlendDesc, ColorMask, DepthStencilDesc, Face, Factor,
@@ -261,12 +262,15 @@ impl<'a, P: PassPosition> IntoDrawPass<UiDrawPass<'a>, P> for () {
})
.push_constants(vec![(ShaderStageFlags::VERTEX, 0..8)])
.renderpass(RenderpassSpec {
- colors: vec![Attachment {
- format: Some(context.target_chain().properties().format),
- samples: 1,
- ops: P::attachment_ops(),
- stencil_ops: P::attachment_ops(),
- layouts: P::layout_as_range(),
+ colors: vec![AttachmentSpec {
+ attachment: Attachment {
+ format: Some(context.target_chain().properties().format),
+ samples: 1,
+ ops: P::attachment_ops(),
+ stencil_ops: P::attachment_ops(),
+ layouts: P::layout_as_range(),
+ },
+ used_layout: Layout::ColorAttachmentOptimal,
}],
depth: None,
inputs: vec![],