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

false positive of UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout for VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR #7897

Open
cclao opened this issue Apr 24, 2024 · 0 comments
Labels
Bug Something isn't working

Comments

@cclao
Copy link

cclao commented Apr 24, 2024

Environment:

  • OS: Android
  • GPU and driver version:
  • Pixel 6 pro

Describe the Issue
This is reproduced with ANGLE's end2end test

Build ANGLE

autoninja -C out/Default angle_apks

This is what I have for Default

$ more out/Default/args.gn

target_os = "android"
target_cpu = "arm64"
is_component_build = false
is_debug = true
angle_assert_always_on = true   # Recommended for debugging. Turn off for performance.
angle_enable_vulkan_validation_layers = true
arm_control_flow_integrity = "none"
angle_expose_non_conformant_extensions_and_versions = true
build_angle_trace_perf_tests = true
build_angle_deqp_tests = true

Install ANGLE

adb install -r -d --force-queryable out/Default/apks/AngleLibraries.apk

Build end2end tests

autoninja -C out/Default src/tests:angle_end2end_tests

Run the test

out/Default/angle_end2end_tests --gtest_filter=EGLSingleBufferTest.ScissoredDraw/ES3_Vulkan_NoFixture --single-process-tests --use-angle=vulkan --verbose --num-retries 0

You see this VVL error:

I 17:28:15.534    8.525s run_tests_on_device(36081FDJG0007P)  ERR: vk_renderer.cpp:822 (DebugUtilsMessenger): [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x7af12b40d0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x240000000024, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x4dae5635 | vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] command buffer VkCommandBuffer 0x7af12b40d0[] expects VkImage 0x240000000024[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR.
I 17:28:15.534    8.525s run_tests_on_device(36081FDJG0007P)                              <Command Buffer Label Hierarchy:>
I 17:28:15.534    8.525s run_tests_on_device(36081FDJG0007P)                               Render pass closed due to eglSwapBuffers()
I 17:28:15.534    8.526s run_tests_on_device(36081FDJG0007P)                                Object: 0x7af12b40d0 (type = Command Buffer(6))
I 17:28:15.534    8.526s run_tests_on_device(36081FDJG0007P)                                Object: 0x240000000024 (type = Image(10))

What happened is that the test creates a single buffer context. Since it only has one buffer for both render and present, we always immediately put it in VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR. Then when we render to it, we got the above VVL error. According to vulkan spec

6) What should the layout of the shared presentable image be?

RESOLVED: After acquiring the shared presentable image, the application must transition it to the VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR layout prior to it being used. After this initial transition, any image usage that was requested during swapchain creation can be performed on the image without layout transitions being performed.

And we always use these usage flags when creating swapchain images

    VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_SAMPLED_BIT |
    VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;

Which includes VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, which means it should be correct.

I think VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR should be excluded from this check.

@spencer-lunarg spencer-lunarg added the Bug Something isn't working label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants