Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoBackends:D3D12: Fix hang in Twilight Princess #11226

Merged
merged 3 commits into from
Oct 29, 2022

Conversation

K0bin
Copy link
Contributor

@K0bin K0bin commented Oct 29, 2022

Fixes issue 13087

The last commit is the interesting one. I explain the bug in the commit message.

@K0bin K0bin changed the title D3D12 fixes VideoBackends:D3D12: Fix hang in Twilight Princess Oct 29, 2022
@K0bin K0bin force-pushed the d3d12-fix branch 2 times, most recently from af8358b to a17ed5e Compare October 29, 2022 08:22
@K0bin
Copy link
Contributor Author

K0bin commented Oct 29, 2022

I adjusted the fifo diff for visibility:
image

I didn't change anything in the OpenGL backend, so that's gotta be unrelated to the PR.

@JMC47
Copy link
Contributor

JMC47 commented Oct 29, 2022

Sometimes there is noise in the fifoci bots, wouldn't worry about it. Ghost in the machine type thing.

… visible heap

Fixes the following error in the D3D12 debug layer:

D3D12 ERROR: ID3D12DescriptorHeap::GetGPUDescriptorHandleForHeapStart:
GetGPUDescriptorHandleForHeapStart is invalid to call on a descriptor
heap that does not have DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE set.
If the heap is not supposed to be shader visible, then
GetCPUDescriptorHandleForHeapStart would be the appropriate method
to call. That call is valid both for shader visible and non shader
visible descriptor heaps.
[ STATE_GETTING ERROR dolphin-emu#1315: DESCRIPTOR_HEAP_NOT_SHADER_VISIBLE]
Fixes the following error in the D3D12 debug layer:

D3D12 WARNING: ID3D12Device::CreateCommittedResource:
Ignoring InitialState D3D12_RESOURCE_STATE_UNORDERED_ACCESS.
Buffers are effectively created in state D3D12_RESOURCE_STATE_COMMON.
[ STATE_CREATION WARNING dolphin-emu#1328: CREATERESOURCE_STATE_IGNORED]
…uffer

BindFramebuffer depends on the pipeline which might not be set yet.
That's why the framebuffer dirty flag exists in the first place.
I assume BindFramebuffer was called directly here, in order to handle
the texture state transitions necessary for DiscardResource.
The state is tracked anyway, so we can just issue those transitions there
too and defer binding the actual framebuffer.

Fixes an issue in Zelda Twilight Princess with EFB depth peeks.
Dolphin would bind a frame buffer which doesn't have an integer format
descriptor for the color target before binding the new pipeline.
So it would accidentally use the 0 descriptor.

Debug layer error:
D3D12 ERROR: ID3D12CommandList::OMSetRenderTargets:
Specified CPU descriptor handle ptr=0x0000000000000000 does not refer to
a location in a descriptor heap. pRenderTargetDescriptors[0] is the issue.
[ EXECUTION ERROR dolphin-emu#646: INVALID_DESCRIPTOR_HANDLE]
@dolphin-emu-bot
Copy link
Contributor

FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:

  • mp2-scanner on uberogl-lin-radeon: diff
  • zww-water on uberogl-lin-radeon: diff

automated-fifoci-reporter

Copy link
Contributor

@iwubcode iwubcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. I did not see any issues when I tested a handful of games (including the game impacted in the issue report).

@AdmiralCurtiss AdmiralCurtiss merged commit 0628794 into dolphin-emu:master Oct 29, 2022
@K0bin K0bin deleted the d3d12-fix branch October 29, 2022 23:11
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants