Project

General

Profile

Actions

Emulator Issues #13312

closed

Twilight Princess crashing dolphin on d3d12

Added by binturongx10 over 1 year ago. Updated over 1 year ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:
5.0-19868

Description

Game Name?

The Legend of Zelda Twilight Princess

Game ID? (right click the game in the game list, Properties, Info tab)

RZDE01

MD5 Hash? (right click the game in the game list, Properties, Verify tab, Verify Integrity button)

70946e09da8f0bb218bb3b3542953d63

What's the problem? Describe what went wrong.
Dolphin Crashes to Desktop when playing Twilight Princess using the d3d12 backend

What steps will reproduce the problem?

Set Backend to d3d12

start game and load a save

run around until dolphin crashes, how long it takes seems area dependentbut hyrule feild outside castle town seems to crash in under 30 seconds

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

Yes
5.0-19856

Is the issue present in the latest stable version?
n/a

If the issue isn't present in the latest stable version, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)

5.0-19716

If your issue is a graphical issue, please attach screenshots and record a three frame fifolog of the issue if possible. Screenshots showing what it is supposed to look like from either console or older builds of Dolphin will help too. For more information on how to use the fifoplayer, please check here: https://wiki.dolphin-emu.org/index.php?title=FifoPlayer

[Attach any fifologs if possible, write a description of fifologs and screenshots here to assist people unfamiliar with the game.]

What are your PC specifications? (CPU, GPU, Operating System, more)

i7-4770
gtx 1070ti
16gb ram
windows 10 22H2

Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)

[Anything else here]


Files

Savefile.7z (77.2 KB) Savefile.7z Use top save binturongx10, 07/29/2023 03:24 PM
dolphin.log (348 KB) dolphin.log binturongx10, 07/29/2023 03:25 PM
Actions #1

Updated by Dentomologist over 1 year ago

The relevant part of the stack trace:

D3D12.dll!CGraphicsCommandList::OMSetRenderTargets_VariadicHelper::Variadic_Thk(struct ID3D12GraphicsCommandListNext *,unsigned int,struct D3D12_CPU_DESCRIPTOR_HANDLE const *,int,struct D3D12_CPU_DESCRIPTOR_HANDLE const *) Unknown
DolphinD.exe!DX12::Gfx::BindFramebuffer(DX12::DXFramebuffer * fb) Line 192
DolphinD.exe!DX12::Gfx::SetAndClearFramebuffer(AbstractFramebuffer * framebuffer, const std::array & color_value, float depth_value) Line 225
DolphinD.exe!DX12::Gfx::BindBackbuffer(const std::array & clear_color) Line 372
DolphinD.exe!VideoCommon::Presenter::Present() Line 558
DolphinD.exe!VideoCommon::Presenter::ViSwap(unsigned int xfb_addr, unsigned int fb_width, unsigned int fb_stride, unsigned int fb_height, unsigned __int64 ticks) Line 120

Unhandled exception at 0x00007FF890FAB813 (igd12umd64.dll) in DolphinD.exe: 0xC0000005: Access violation reading location 0x0000000000000020.

In D3D12Gfx.cpp, BindFramebuffer calls OMSetRenderTargets with NumRenderTargetDescriptors == 1 and pRenderTargetDescriptors pointing to a D3D12_CPU_DESCRIPTOR_HANDLE whose ptr member is null. As described at
https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-omsetrendertargets, when NumRenderTargetDescriptors is nonzero the pointer inside the handle must point to a valid descriptor so this call is invalid.

Because m_state.using_integer_rtv is true the value of pRenderTargetDescriptors used here comes from DXFramebuffer::GetIntRTVDescriptorArray, which in turn returns DXFramebuffer::m_int_rtv_descriptor.cpu_handle. m_int_rtv_descriptor is initialized by CreateIRTVDescriptor, but this initialization only happens when GetRTVFormatForAbstractFormat returns different integer and non-integer RTV formats for the abstract format m_color_format. Only RGBA8 and R16 have different RTV formats, and the abstract format in question is RGB10_A2, so m_int_rtv_descriptor never gets initialized.

Actions #2

Updated by Dentomologist over 1 year ago

By the way, if you haven't already could you see if this happens on D3D11?

I've opened a PR (https://github.com/dolphin-emu/dolphin/pull/12087) that should fix it for D3D12; you can download a test build at https://dl.dolphin-emu.org/prs/eb/7a/pr-12087-dolphin-latest-x64.7z.

Actions #3

Updated by binturongx10 over 1 year ago

Pr seems to fix d3d12.

d3d11 never crashed for me. It seems fine in the pr too.

Actions #4

Updated by binturongx10 over 1 year ago

Fixed in 5.0-19868

Actions #5

Updated by JosJuice over 1 year ago

  • Status changed from New to Fixed
  • Fixed in set to 5.0-19868
Actions

Also available in: Atom PDF