Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On device destroy clean up presentation and submission images. #1690

Merged
merged 1 commit into from
Mar 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion gapis/api/vulkan/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,17 @@ func (st *State) getPresentAttachmentInfo(attachment api.FramebufferAttachment)
return returnError("Swapchain does not contain image %v", attachment)
}
color_img := st.LastPresentInfo.PresentImages.Get(image_idx)
return color_img.Info.Extent.Width, color_img.Info.Extent.Height, color_img.Info.Format, image_idx, nil
if color_img != nil {
return color_img.Info.Extent.Width, color_img.Info.Extent.Height, color_img.Info.Format, image_idx, nil
}
case api.FramebufferAttachment_Depth:
fallthrough
case api.FramebufferAttachment_Stencil:
fallthrough
default:
return returnError("Swapchain attachment %v does not exist", attachment)
}
return returnError("Swapchain attachment %v does not exist", attachment)
}

func (st *State) getFramebufferAttachmentInfo(attachment api.FramebufferAttachment) (uint32, uint32, VkFormat, uint32, error) {
Expand Down
11 changes: 10 additions & 1 deletion gapis/api/vulkan/vulkan.api
Original file line number Diff line number Diff line change
Expand Up @@ -2992,6 +2992,11 @@ cmd void vkDestroyDevice(
if LastBoundQueue == v {
LastBoundQueue = null
}
for i in (0 .. LastPresentInfo.PresentImageCount) {
if (LastPresentInfo.PresentImages[i].Device == device) {
delete(LastPresentInfo.PresentImages, i)
}
}
delete(Queues, v.VulkanHandle)
}
}
Expand Down Expand Up @@ -4185,8 +4190,12 @@ cmd void vkDestroyImage(
v.Image = null
}
}
for i in (0 .. LastPresentInfo.PresentImageCount) {
if (LastPresentInfo.PresentImages[i].VulkanHandle == image) {
delete(LastPresentInfo.PresentImages, i)
}
}
}

}

@indirect("VkDevice")
Expand Down