This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Vulkan: Suspected driver issue with barriers (EDIT: Nope, was Z fighting)

EDIT: Turned out to be Z fighting. Still a good question why it only happens on Mali..

Take a look at this video (it takes a few seconds to load):

http://ppsspp.org/unofficial/burnout.mp4

(first minor issue I guess is that when recording, it adds a lot of black space for some reason. I use adb shell screenrecord --bit-rate=12000000 /sdcard/burnout.mp4).

Anyway, as you can see there's a lot of flicker and some triangular artifacts that remind me a lot of failed Z-order texture copies, or maybe it's an artifact of tiling, where large triangles are split into tile-filling ones? I don't know, but it looks weird. Only happens on Mali, works fine on all other GPUs I've tried, mobile and desktop.

As this is a PSP emulator I have to follow along with what the game does, regardless of whether it makes sense on modern hardware (I do some tricks like catching clears and convert them to render pass clears when possible though, although it's not in this case). So here's what the game does:

* It renders the environment to an image.

* It binds the image as a texture, and draws it to another much smaller target to create an environment map

* It then starts rendering to the first image again (using LOAD_OP_LOAD of course) and renders the car using the environment map.

(Then in yet another render pass, we draw the image to the backbuffer and then apply things like the onscreen controls, in a fourth render pass).

So the main image ends up with four layout transitions in a frame:  First from  SHADER_READ (from the last frame it was used) to COLOR_ATTACHMENT, then COLOR_ATTACHMENT to SHADER_READ, then from SHADER_READ to COLOR_ATTACHMENT, then back to SHADER_READ for the final blit. This is hardly ideal but pretty much unavoidable in this case.

I use appropriate image memory barriers for all these transitions everywhere which make the Vulkan validation layers happy and work on all other GPUs.

I can provide RenderDoc dumps from PC or run it again in some other debugger etc.

Any ideas?

Parents
  • RenderDoc dumps would be useful so we can see precisely how you are driving the API. If possible a standalone reproducer would be great too.

    In addition can you let us know which device and driver version you have?

    Cheers, 
    Pete

Reply
  • RenderDoc dumps would be useful so we can see precisely how you are driving the API. If possible a standalone reproducer would be great too.

    In addition can you let us know which device and driver version you have?

    Cheers, 
    Pete

Children
No data