Commit Graph

7 Commits

Author SHA1 Message Date
Dentomologist 83f307ec7e D3D12: Only use framebuffer integer descriptor if allocated
Verify that DXFramebuffer's integer RTV descriptor's cpu_handle has been
allocated before using it, and if it hasn't use the non-integer RTV
descriptor instead. This fixes a Dolphin crash in Twilight Princess, and
possibly other games (Issue 13312).

As an optimization to save space in the descriptor heap, DXFramebuffer's
integer descriptor is only initialized if the given abstract texture
format has different integer and non-integer RTV formats. This
previously wasn't accounted for by GetIntRTVDescriptorArray, which could
cause DX12::Gfx::BindFramebuffer to call OMSetRenderTargets with an
invalid descriptor which would lead to a crash.

Triggering the bug was fortunately rare because integer formats are only
used when blending is disabled and logic ops are enabled. Furthermore,
the standard integer abstract format is RGBA8 which has different
integer and non-integer RTV formats, causing the integer descriptor to
be initialized and avoiding the bug.

The crash started appearing in a2702c6 because it changed the
swapchain's abstract texture format from RGBA8 to RGB10_A2. Unlike
RGBA8, RGB10_A2 has the same integer and non-integer RTV formats and so
the bug can be triggered if the other requirements are met.
2023-08-04 13:17:33 -07:00
iwubcode 834f8f7b5c VideoBackends: add support to allow rendering to multiple output textures 2023-06-03 14:52:31 -05:00
iwubcode 7bea39b39e VideoBackends: add a way to load data into a specific level AND layer, default to layer 0 2023-01-27 18:46:53 -06:00
iwubcode 0e1ffe009a VideoBackends: fix d3d12 subresource calculation 2022-10-28 19:07:08 -05:00
iwubcode 1f2f505373 VideoBackends / VideoCommon: allow the ability to set debug names for shaders / textures. These names are visible in applications like RenderDoc 2021-08-30 13:47:48 -05:00
Pierre Bourdon e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
Shawn Hoffman 527b5a9761 normalize common filenames in VideoBackends/D3D12 2021-01-27 14:29:48 -08:00