Project

General

Profile

Bug #534

Intel - Game corruption when display not in fullscreen

Added by adamjer almost 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
06/22/2021
API:
Vulkan
Cemu Version:
1.23.0
GPU Vendor/Model:
Intel all GPUs

Description

We were able to confirm this problem with Breath of the Wild and Mario Kart 8.

The test renders immediately after layout transition from VK_IMAGE_LAYOUT_UNDEFINED what gives undefined results according to Vulkan specification:

VK_IMAGE_LAYOUT_UNDEFINED specifies that the layout is unknown. Image memory cannot be
transitioned into this layout. This layout can be used as the initialLayout member of
VkImageCreateInfo. This layout can be used in place of the current image layout in a layout
transition, but doing so will cause the contents of the image’s memory to be undefined

DEBUG ANALYSIS:
The affected image is a swapchain image at index 1. Operations performed on the image are as follows:

FRAME 0:
vkCmdPipelineBarrier(VK_IMAGE_LAYOUT_UNDEFINED --> VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL)
vkCmdCopyBufferToImage()
vkCmdPipelineBarrier(VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL --> VK_IMAGE_LAYOUT_PRESENT_SRC_KHR

FRAME 1:
vkCmdPipelineBarrier(VK_IMAGE_LAYOUT_UNDEFINED --> VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL)
vkCmdClearColorImage()
vkCmdPipelineBarrier(VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL --> VK_IMAGE_LAYOUT_GENERAL)
vkCmdBeginRenderPass(initialLayout = VK_IMAGE_LAYOUT_UNDEFINED) // Transition from VK_IMAGE_LAYOUT_UNDEFINED which corrupts the image
vkCmdDrawIndexed() // Rendering on top of corruptions.
vkCmdEndRenderPass(finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR)
vkCmdPipelineBarrier(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL --> VK_IMAGE_LAYOUT_PRESENT_SRC_KHR)
vkCmdBeginRenderPass(initialLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR)
vkCmdEndRenderPass(finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR)
vkCmdPipelineBarrier(VK_IMAGE_LAYOUT_PRESENT_SRC_KHR --> VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL)
vkCmdCopyImageToBuffer()
vkCmdPipelineBarrier(VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL --> VK_IMAGE_LAYOUT_PRESENT_SRC_KHR)

To reproduce this issue Graphics Packs is needed.
Set graphics to 720p, desktop resolution to 800x600.
Corruptions:
https://drive.google.com/file/d/1BIlj-v--SAbClKk1EXO6vb6qXYsnW6uF/view?usp=sharing

Also available in: Atom PDF