Skip to content

Commit

Permalink
Merge #166
Browse files Browse the repository at this point in the history
166: gfx update for image view capabilities r=grovesNL a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
  • Loading branch information
bors[bot] and kvark committed Sep 12, 2018
2 parents 402c2fb + eb06b8c commit 25918bb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions libportability-gfx/src/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ pub fn map_aspect(aspects: VkImageAspectFlags) -> format::Aspects {
flags
}

pub fn map_image_create_flags(flags: VkImageCreateFlags) -> image::ViewCapabilities {
image::ViewCapabilities::from_bits_truncate(flags as u32)
}

pub fn map_image_kind(
ty: VkImageType,
extent: VkExtent3D,
Expand Down
4 changes: 2 additions & 2 deletions libportability-gfx/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ pub extern "C" fn gfxGetPhysicalDeviceImageFormatProperties(
},
conv::map_tiling(tiling),
conv::map_image_usage(usage),
unsafe { mem::transmute(create_flags) },
conv::map_image_create_flags(create_flags),
);
match properties {
Some(props) => unsafe {
Expand Down Expand Up @@ -1552,7 +1552,7 @@ pub extern "C" fn gfxCreateImage(
.expect(&format!("Unsupported image format: {:?}", info.format)),
conv::map_tiling(info.tiling),
conv::map_image_usage(info.usage),
unsafe { mem::transmute(info.flags) },
conv::map_image_create_flags(info.flags),
)
.expect("Error on creating image");

Expand Down

0 comments on commit 25918bb

Please sign in to comment.