Skip to content

Commit

Permalink
Fix SEGV when using invalid image views.
Browse files Browse the repository at this point in the history
  • Loading branch information
AWoloszyn committed Mar 8, 2019
1 parent 60f12ee commit b33134f
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions gapis/api/vulkan/api/image.api
Original file line number Diff line number Diff line change
Expand Up @@ -783,18 +783,20 @@ sub void transitionImageViewLayout(
ref!ImageViewObject view,
VkImageLayout oldLayout,
VkImageLayout newLayout) {
if is2DView3DImage(view) {
rng := VkImageSubresourceRange(
aspectMask: view.SubresourceRange.aspectMask,
baseMipLevel: view.SubresourceRange.baseMipLevel,
levelCount: view.SubresourceRange.levelCount,
baseArrayLayer: 0,
layerCount: 1)
transitionImageLayout(
view.Image, rng, oldLayout, newLayout)
} else {
transitionImageLayout(
view.Image, view.SubresourceRange, oldLayout, newLayout)
if view != null {
if is2DView3DImage(view) {
rng := VkImageSubresourceRange(
aspectMask: view.SubresourceRange.aspectMask,
baseMipLevel: view.SubresourceRange.baseMipLevel,
levelCount: view.SubresourceRange.levelCount,
baseArrayLayer: 0,
layerCount: 1)
transitionImageLayout(
view.Image, rng, oldLayout, newLayout)
} else {
transitionImageLayout(
view.Image, view.SubresourceRange, oldLayout, newLayout)
}
}
}

Expand Down

0 comments on commit b33134f

Please sign in to comment.