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

vkCmdCopyImage validation issue if srcImage == dstImage #330

Closed
nythrix opened this issue Sep 13, 2018 · 2 comments
Closed

vkCmdCopyImage validation issue if srcImage == dstImage #330

nythrix opened this issue Sep 13, 2018 · 2 comments
Milestone

Comments

@nythrix
Copy link

nythrix commented Sep 13, 2018

I think I have hit a validation issue in vkCmdCopyImage. My understanding is that copying pixels from a part of an image to a different part of the same image requires VK_IMAGE_LAYOUT_GENERAL. If I do that the validation layer gives me a performance warning and tells me to use the *_TRANSFER_SRC_OPTIMAL and *_TRANSFER_DST_OPTIMAL for the srcImage and dstImage parameters respectively. Obviously this is not possible since it's the same image. It seems like the validation layer is missing an "if" somewhere.
I looked around but I was unable to find the relevant code and check for myself. Can anyone confirm this issue or at least point me into the right direction?

I am using the validation layers from LunarG (v. 1.0.68).

From the specs:

Source image subresources must be in either the VK_IMAGE_LAYOUT_GENERAL or VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL layout. Destination image subresources must be in the VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_GENERAL or VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL layout. As a consequence, if an image subresource is used as both source and destination of a copy, it must be in the VK_IMAGE_LAYOUT_GENERAL layout.

@shannon-lunarg shannon-lunarg self-assigned this Sep 17, 2018
@shannon-lunarg shannon-lunarg removed their assignment Dec 12, 2018
@mark-lunarg
Copy link
Contributor

Tested this situation using VkLayerTest.CopyImageAspectMismatch, and no longer see these invalid messages. Thanks for the report!

@shannon-lunarg shannon-lunarg added this to the sdk-1.1.114.0 milestone Jul 24, 2019
@nythrix
Copy link
Author

nythrix commented Aug 29, 2019

I don't think this is resolved yet. I downloaded VulkanSDK v 1.1.114.0 and tested the scenario. I am still getting the performance warning. This time, I took a look around the code and found that the message is generated in CoreChecks::VerifyImageLayout:

// LAYOUT_GENERAL is allowed, but may not be performance optimal, flag as perf warning.

I also checked the validation test mentioned by Mark. If I'm reading the code correctly, VkLayerTest.CopyImageAspectMismatch does indeed test the scenario I'm interested in, but it does not check for performance warning messages, only error ones, i.e.: SetDesiredFailureMsg is always invoked with VK_DEBUG_REPORT_ERROR_BIT_EXT, and there's no VerifyNotFound call in the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants