Texture.GetData fails on a depth-stencil texture on Direct3D 12 and Vulkan
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- csharp
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C#
- スター
- 8k
- フォーク
- 1.2k
- 平均マージ
- 2日 7時間
- マージ済み PR(30日)
- 316
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stride3d/stride のほかの issue
-
`.gitignore` isn't created for sample projects対応中かも @ferafiks が 1 日前に担当しました。 オープンarea-Asset area-GameStudio area-Samples bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
area-Build bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
area-Samples enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stride3d/stride#3386 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
area-Physics bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
stride3d/stride#3384 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area-Samples bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
stride3d/stride#3066 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
stride3d/stride の issue をすべて見る
似ている issue
-
Unit converter reads out of bounds when the saved UnitConverterPreferences setting is malformedオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/calculator#2532 ·
-
area: scaffold status: needs-tests
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
provider:flagd type:fix
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
open-feature/dotnet-sdk-contrib#789 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
NimblePros/Metronome#23 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
jsboige/CoursIA#28504 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信