mirror of https://github.com/libsdl-org/SDL.git
For a depth buffer in D3D12 that is also going to be used in a texture sampler, the creation (on an Intel HD 5500 igpu) fails. e.g. SDL_GPUTextureCreateInfo type = TEXTURE_2D, format = D32_FLOAT, usage = DEPTH_STENCIL_TARGET | SAMPLER
The error messages are:
D32_FLOAT
D3D12 ERROR: ID3D12Device::CreateShaderResourceView: The Format (0x29, R32_FLOAT) is invalid when creating a View; the
Resource was already created with a fully qualified Format, which is not castable (0x28, D32_FLOAT).
D24_UNORM
D3D12 ERROR: ID3D12Device::CreateShaderResourceView: For the resource format D24_UNORM_S8_UINT, when making a D3D view, the format name for the view can't be R24_UNORM_X8_TYPELESS.
I found this is because the texture format needs to be created as _TYPELESS, then the views (depth stencil view, shader resource view) should then be created as their respective types - e.g. texture = R32_TYPELESS, dsv = D32_FLOAT, srv = R32_FLOAT
Tested and working on:
NVidia RTX 3050 (D3D12 feature set 12_2)
Intel HD 5500 (D3D12 feature set 11_1)
(cherry picked from commit
|
||
|---|---|---|
| .github | ||
| VisualC | ||
| VisualC-GDK | ||
| Xcode | ||
| android-project | ||
| build-scripts | ||
| cmake | ||
| docs | ||
| examples | ||
| include | ||
| src | ||
| test | ||
| wayland-protocols | ||
| .clang-format | ||
| .clang-tidy | ||
| .editorconfig | ||
| .gitignore | ||
| .wikiheaders-options | ||
| Android.mk | ||
| BUGS.txt | ||
| CMakeLists.txt | ||
| CREDITS.md | ||
| INSTALL.md | ||
| LICENSE.txt | ||
| README.md | ||
| WhatsNew.txt | ||
README.md
Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.
You can find the latest release and additional information at: https://www.libsdl.org/
Installation instructions and a quick introduction is available in INSTALL.md
This library is distributed under the terms of the zlib license, available in LICENSE.txt.
Enjoy!
Sam Lantinga (slouken@libsdl.org)