Texture.GetData fails on a depth-stencil texture on Direct3D 12 and Vulkan
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
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- csharp
- Ambito
- backend, computer-graphics
Direzione di ricerca
Start with CopyTextureToStagingTexture in CommandList.Direct3D12.cs around line 1613 and the corresponding copy in CommandList.Vulkan.cs around line 1539. Compare the depth-stencil copy requirements with the Direct3D 11 behavior and look for existing readback tests, including the test mentioned in #3252. Done means GetData returns depth and stencil data on Direct3D 12 and Vulkan, or throws a clear exception before recording an unsupported copy.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Release Type: Built from source
Version: master
Platform(s): Windows, Direct3D 12 and Vulkan. Direct3D 11 works.
Describe the bug
GetData on a texture with a depth-stencil format, for example D24_UNorm_S8_UInt, copies the depth and the stencil to the staging resource in one copy. Direct3D 12 and Vulkan copy only one plane (D3D12) or one aspect (Vulkan) at a time.
- Direct3D 12:
CopyTextureToStagingTexture(CommandList.Direct3D12.cs, around line 1613) gives the depth-stencil format to the footprint. The debug layer says:CopyTextureRegion: D3D12_SUBRESOURCE_FOOTPRINT::Format may not be a ...R24G8_TYPELESS family format. These formats are planar. ThenCommandList.Close()throws aCOMException. - Vulkan: the copy (
CommandList.Vulkan.cs, around line 1539) usesNativeImageAspect, which is depth and stencil together. The validation layer says:vkCmdCopyImageToBuffer(): imageSubresource.aspectMask is DEPTH|STENCIL (only one bit allowed)(VUID-VkBufferImageCopy-aspectMask-09103). Then the test host crashes.
To Reproduce
- Make a game with
GraphicsDeviceManager.PreferredDepthStencilFormat = PixelFormat.D24_UNorm_S8_UInt. - After a frame, call
GraphicsDevice.Presenter.DepthStencilBuffer.GetData<uint>(commandList). - Run it on Direct3D 12 or Vulkan.
Expected behavior
GetData returns the depth (and stencil) data, as on Direct3D 11. Or, if Stride does not support this readback, it throws a clear exception before it records the copy.
Log and callstacks
Direct3D 12:
System.Runtime.InteropServices.COMException : Unexpected HRESULT has been returned from a call to a COM component.
at Stride.Graphics.CommandList.Close() in ...\Direct3D12\CommandList.Direct3D12.cs:line 233
at Stride.Graphics.CommandList.Flush() in ...\Direct3D12\CommandList.Direct3D12.cs:line 211
at Stride.Games.GameBase.EndDraw(Boolean present)
Additional context
Found while writing a test for #3252. That test now reads the depth through a shader.
- Lingua principale
- C#
- Stelle
- 8k
- Fork
- 1.2k
- Merge medio
- 2g 7h
- PR unite (30g)
- 316
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di stride3d/stride
-
`.gitignore` isn't created for sample projectsForse già presa @ferafiks l’ha presa 1 giorno fa. Apertaarea-Asset area-GameStudio area-Samples bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
area-Build bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
area-Samples enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stride3d/stride#3386 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
area-Physics bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
stride3d/stride#3384 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area-Samples bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
stride3d/stride#3066 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di stride3d/stride
Issue simili
-
area-Tools-ILLink untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
dotnet/runtime#138255 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 2 giorni
-
area-fundamentals bug untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
dotnet/extensions#7979 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
QuantConnect/Lean#10236 ·
I maintainer di solito rispondono entro 1 giorno
-
priority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100