Skip to content
This repository has been archived by the owner on Jul 19, 2018. It is now read-only.

Need validation test to catch cube.c's invalid use of swapchain images #412

Open
courtney-g opened this issue Apr 25, 2016 · 8 comments
Open
Assignees
Milestone

Comments

@courtney-g
Copy link
Contributor

Issue #76 from Vulkan-Docs repo. (LunarG/VulkanSamples#76 (comment))

Need validation test for this spec language:
Use of a presentable image must occur only after the image is returned by vkAcquireNextImageKHR, and before it is presented by vkQueuePresentKHR. This includes transitioning the image layout and rendering commands

@karl-lunarg
Copy link
Contributor

@ianelliottus , is this still an active issue? If so, can you suggest next steps?

@chrisforbes
Copy link
Collaborator

Being able to validate this properly is one of the things that will fall out of my swapchain -> core_validation merge.

@ianelliottus
Copy link
Contributor

@karl-lunarg, yes, this is still an active issue. This is a pretty-difficult thing to check for. The work that @chrisforbes is doing of migrating the swapchain validation layer into core_validation should make it possible to do this. It makes sense to assign this to somebody besides me, as the checks will be outside of the WSI commands (e.g. if you're rendering to an image, and if it's a swapchain image, was it acquired, but not presented?).

@ratchetfreak
Copy link

I think you can leverage the existing read/write hazard checking.

Swapchain image start out being read by the presentation engine, after acquire call the sync point is the semaphore/fence until they are available. Then it needs a sync when passing for present.

The only real trickyness is that vkDeviceWaitIdle doesn't affect the being read by presentation engine state

@karl-lunarg
Copy link
Contributor

OK, thanks @chrisforbes for taking this on.

@mark-lunarg
Copy link
Collaborator

@chrisforbes, is this one baked?

@chrisforbes
Copy link
Collaborator

Not fully. The swapchain -> CV merge was completed some time ago, and we track the acquired bit now on images, but we don't complain about misuse.

karl-lunarg added a commit that referenced this issue Jan 7, 2018
Fixes #412

Issue validation error message at QueueSubmit time when swapchain
images referenced in a command buffer are not acquired or
associated with an acquire semaphore.
karl-lunarg added a commit that referenced this issue Jan 7, 2018
Fixes #412

Issue validation error message at QueueSubmit time when swapchain
images referenced in a command buffer are not acquired or
associated with an acquire semaphore.
@karl-lunarg
Copy link
Contributor

@chrisforbes I took a crack at this - can you please take a look and let me know if this is the right direction and if I'm missing anything?

I still need to write a test.

The cube app has changed a lot since this was opened. The layout transitions now are requested in the render pass. But I was still able to exercise this check by hacking cube to do a layout transition in the "prepare buffers" step, which submits the barrier commands without acquiring the images.

karl-lunarg added a commit that referenced this issue Jan 11, 2018
Fixes #412

Issue validation error message at QueueSubmit time when swapchain
images referenced in a command buffer are not acquired or
associated with an acquire semaphore.

Change-Id: Idb206fa34bc76419da7f9b7225fa8c67d28d6169
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants