Skip to content

Commit

Permalink
Backport renderpass resolve attachments fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Jun 22, 2019
1 parent 946dbd4 commit 2c71e2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/backend/vulkan/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gfx-backend-vulkan"
version = "0.2.2"
version = "0.2.3"
description = "Vulkan API backend for gfx-rs"
homepage = "https://github.com/gfx-rs/gfx"
repository = "https://github.com/gfx-rs/gfx"
Expand Down
13 changes: 7 additions & 6 deletions src/backend/vulkan/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ impl d::Device<B> for Device {
format: attachment
.format
.map_or(vk::Format::UNDEFINED, conv::map_format),
samples: vk::SampleCountFlags::from_raw(
(attachment.samples as u32) & vk::SampleCountFlags::all().as_raw(),
),
samples: vk::SampleCountFlags::from_raw(
(attachment.samples as u32) & vk::SampleCountFlags::all().as_raw(),
),
load_op: conv::map_attachment_load_op(attachment.ops.load),
store_op: conv::map_attachment_store_op(attachment.ops.store),
stencil_load_op: conv::map_attachment_load_op(attachment.stencil_ops.load),
Expand Down Expand Up @@ -160,22 +160,23 @@ impl d::Device<B> for Device {
.iter()
.map(|&id| id as u32)
.collect::<Box<[_]>>();
let resolves = subpass.resolves.iter().map(make_ref).collect::<Box<[_]>>();

(colors, depth_stencil, inputs, preserves)
(colors, depth_stencil, inputs, preserves, resolves)
})
.collect::<Box<[_]>>();

let subpasses = attachment_refs
.iter()
.map(|(colors, depth_stencil, inputs, preserves)| {
.map(|(colors, depth_stencil, inputs, preserves, resolves)| {
vk::SubpassDescription {
flags: vk::SubpassDescriptionFlags::empty(),
pipeline_bind_point: vk::PipelineBindPoint::GRAPHICS,
input_attachment_count: inputs.len() as u32,
p_input_attachments: inputs.as_ptr(),
color_attachment_count: colors.len() as u32,
p_color_attachments: colors.as_ptr(),
p_resolve_attachments: ptr::null(), // TODO
p_resolve_attachments: if resolves.is_empty() { ptr::null() } else { resolves.as_ptr() },
p_depth_stencil_attachment: match depth_stencil {
Some(ref aref) => aref as *const _,
None => ptr::null(),
Expand Down

0 comments on commit 2c71e2e

Please sign in to comment.