Texture.GetData fails on a depth-stencil texture on Direct3D 12 and Vulkan
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- csharp
- Área
- backend, computer-graphics
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 8k
- Forks
- 1.2k
- Merge medio
- 2 d 7 h
- PR fusionados (30 d)
- 316
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de stride3d/stride
-
`.gitignore` isn't created for sample projectsPosiblemente ocupada @ferafiks la tomó hace 1 día. Abiertoarea-Asset area-GameStudio area-Samples bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
area-Build bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
area-Samples enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
stride3d/stride#3386 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
area-Physics bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
stride3d/stride#3384 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area-Samples bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
stride3d/stride#3066 · 6 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de stride3d/stride
Issues similares
-
Unit converter reads out of bounds when the saved UnitConverterPreferences setting is malformedAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/calculator#2532 ·
-
Scaffold marks an association as required when its composite foreign key has a nullable columnAbiertoarea: scaffold status: needs-tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
provider:flagd type:fix
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
open-feature/dotnet-sdk-contrib#789 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
NimblePros/Metronome#23 ·
-
ci(runners): le workflow Mirror state advisory rougit a tort quand jq manque sur le slot (exit 127), alors que l'organe conclut "etat non lisible"Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
jsboige/CoursIA#28504 · 3 comentarios ·
Los mantenedores suelen responder en 1 día