Assert caused by flushAndSubmit() when using Vulkan

41 views
Skip to first unread message

Luboš Luňák

unread,
May 27, 2021, 11:38:27 AM5/27/21
to skia-d...@googlegroups.com

Hello,

I reliably get an assert in check_sampled_texture() when using Skia+Vulkan.
Unfortunately I can't find a simple testcase and due to build system used
it'd be also very tedious to bisect the problem, so I do not have the
information to create a bugreport and do not know how to find out more.

The backtrace is attached. The assert is "SkASSERT(vkTex->currentLayout() ==
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);", but
printing "vkTex->currentLayout()" says
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL. The specific piece of code
triggering this is below, but as I said, this alone does not seem to be all
of it. It's the second flushAndSubmit() call that leads to the assert. The
surface and image are GPU/Vulkan. Converting the SkImage using
makeNonTextureImage() works around the problem. It is fine with chrome/m90,
the problem started after updating to chrome/m91, and it still exists with
chrome/m92.

sk_sp<SkImage> im = surface->makeImageSnapshot();
surface->flushAndSubmit();
canvas->drawImage(im,0,0);
surface->flushAndSubmit();

Is this enough to point to the actual problem, or how can I find out more?

--
Luboš Luňák
l.l...@collabora.com
bt.txt

Greg Daniel

unread,
May 27, 2021, 11:53:13 AM5/27/21
to skia-discuss
Hmm this isn't good and seems like a fairly simple pattern that should be covered in our tests, so right off the bat nothing stands out as wrong on your side or that would be wrong in Skia.

To start, how are you making the SkSurface?

Thanks
Greg

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/202105271738.21214.l.lunak%40collabora.com.

Greg Daniel

unread,
May 27, 2021, 11:59:26 AM5/27/21
to skia-discuss
Also are you using MSAA at all?

Luboš Luňák

unread,
May 27, 2021, 2:42:50 PM5/27/21
to skia-d...@googlegroups.com
On Thursday 27 of May 2021, 'Greg Daniel' via skia-discuss wrote:
> Hmm this isn't good and seems like a fairly simple pattern that should be
> covered in our tests, so right off the bat nothing stands out as wrong on
> your side or that would be wrong in Skia.
>
> To start, how are you making the SkSurface?

sk_app::window_context_factory::MakeVulkanForXlib() from tools/sk_app. I
patched that code to reuse one context for all surfaces, could that cause the
problem? It worked for chrome/m77-chrome/m90 though, and without sharing one
context I cannot copy between surfaces.

> Also are you using MSAA at all?

I don't know, I don't do anything explicit about it.

--
Luboš Luňák
l.l...@collabora.com
Reply all
Reply to author
Forward
0 new messages