Skip to content

Commit

Permalink
Revert determination of seperate stencil usage
Browse files Browse the repository at this point in the history
Fix crash on Vivante GPU (vulkano-rs#2192)
  • Loading branch information
Fighter19 committed Apr 24, 2023
1 parent c6a6a7f commit fa93c59
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions vulkano/src/device/physical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,25 +1033,8 @@ impl PhysicalDevice {
#[inline]
pub unsafe fn image_format_properties_unchecked(
&self,
mut image_format_info: ImageFormatInfo,
image_format_info: ImageFormatInfo,
) -> Result<Option<ImageFormatProperties>, VulkanError> {
{
let ImageFormatInfo {
format,
usage,
stencil_usage,
..
} = &mut image_format_info;

let aspects = format.unwrap().aspects();

if stencil_usage.is_empty()
|| !aspects.contains(ImageAspects::DEPTH | ImageAspects::STENCIL)
{
*stencil_usage = *usage;
}
}

self.image_format_properties
.get_or_try_insert(image_format_info, |image_format_info| {
/* Input */
Expand All @@ -1061,13 +1044,22 @@ impl PhysicalDevice {
image_type,
tiling,
usage,
stencil_usage,
mut stencil_usage,
external_memory_handle_type,
image_view_type,
_ne: _,
} = image_format_info;

let has_separate_stencil_usage = stencil_usage == usage;

let aspects = format.unwrap().aspects();

let has_separate_stencil_usage =
if stencil_usage.is_empty() || !aspects.contains(ImageAspects::DEPTH | ImageAspects::STENCIL) {
stencil_usage = usage;
false
} else {
stencil_usage == usage
};

let mut info2_vk = ash::vk::PhysicalDeviceImageFormatInfo2 {
format: format.unwrap().into(),
Expand Down

0 comments on commit fa93c59

Please # to comment.