Vulkan swap chain images lack MUTABLE_FORMAT_BIT, validation error on UNORM view of sRGB image

Aperta
#3,695 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
54/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend, game-dev

Direzione di ricerca

Start with SwapChainGraphicsPresenter.Vulkan.cs and trace how VkSwapchainCreateInfoKHR is populated and how swap chain formats are selected. Check support for VK_KHR_swapchain_mutable_format and VK_KHR_image_format_list, then compare the created image format with the UNORM view Skia requests. Done when the swap chain supports the compatible sRGB and UNORM formats and validation no longer reports VUID-VkImageViewCreateInfo-image-12397.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area-Graphics bug

Release Type: GitHub (4.4.1 NuGet packages)

Version: 4.4.1

Platform(s): Windows, Vulkan. Only tried NVIDIA and lavapipe (Mesa software Vulkan).

Describe the bug
I maintain SkiaGameRendering, a library that draws into Stride's back buffer with Skia. In Linear color space the back buffer is an sRGB swap chain image (B8G8R8A8_UNorm_SRgb), and Skia creates a UNORM view of it so it can write the colors unconverted. With validation on, the Khronos layer says: VUID-VkImageViewCreateInfo-image-12397, because the image was not created with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT. The pixels come out right on NVIDIA and lavapipe, so this is a spec violation and not something you can see, but other drivers are allowed to break on it.

As far as I can tell from SwapChainGraphicsPresenter.Vulkan.cs, VkSwapchainCreateInfoKHR is filled in with no flags and no pNext chain, and a search of the repo finds no use of VK_KHR_swapchain_mutable_format or VK_KHR_image_format_list. I have not checked every code path and I have not run this on AMD, Intel or Android.

Expected behavior
When VK_KHR_swapchain_mutable_format (and VK_KHR_image_format_list) are available, create the swap chain with VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR and a format list containing the sRGB format and its UNORM twin. If there is a better supported way to draw into the back buffer from outside the engine, tell me and I will use that instead. I can send a PR for the swap chain change if you want one.

Lingua principale
C#
Stelle
8k
Fork
1.2k
Merge medio
2g 7h
PR unite (30g)
316

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di stride3d/stride

Tutte le issue di stride3d/stride

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.