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

D3D: Fixed D3D validation error during EFB to texture copy #1689

Merged
merged 2 commits into from Dec 18, 2014

Conversation

kayru
Copy link
Contributor

@kayru kayru commented Dec 12, 2014

Texture was being bound as a render target while still being set as a shader resource.
D3D automatically unbinds the SRV in this case and generates a validation error.
The fix is to manually unbind SRV, render into it and then re-bind to old slots.

This was responsible for https://code.google.com/p/dolphin-emu/issues/detail?id=7929 and quite likely https://forums.dolphin-emu.org/Thread-4-0-4583-d3d-regression?pid=348967

Texture was being bound as a render target while still being set as a shader resource.
D3D automatically unbinds the SRV in this case and generates a validation error.
The fix is to manually unbind SRV, render into it and then re-bind to old slots.
@JMC47
Copy link
Contributor

JMC47 commented Dec 13, 2014

LGTM in fixing the bugs.

@Fuzzik
Copy link

Fuzzik commented Dec 13, 2014

Fixes the bugs reported in Metroid Prime

@PatrickFerry
Copy link
Contributor

Fixes some textures being black instead in Rune Factory: Frontier.
I had missed that bug.

@Christian010
Copy link

This PR fixes a lot of issues in several games, including Super Smash Bros Melee, The Legend of Zelda The Wind Waker and Donkey Kong Country Returns. As seen on: https://forums.dolphin-emu.org/Thread-4-0-4583-d3d-regression-donkey-kong-country-returns

@JMC47
Copy link
Contributor

JMC47 commented Dec 17, 2014

I dunno if anything is holding this up except review. Time to be patient :)

@degasus
Copy link
Member

degasus commented Dec 17, 2014

code LGTM

@PatrickFerry
Copy link
Contributor

I tested this a good deal. No issues to report.

_BitScanForward(&index, textureSlotMask);
D3D::stateman->SetTexture(index, texture->GetSRV());
textureSlotMask &= ~(1 << index);
}

This comment was marked as off-topic.

This comment was marked as off-topic.

@kayru
Copy link
Contributor Author

kayru commented Dec 17, 2014

What's up with buildbot pr-deb* configs?

@degasus
Copy link
Member

degasus commented Dec 17, 2014

sorry, that was me.

@dolphin-emu-bot rebuild

@JMC47
Copy link
Contributor

JMC47 commented Dec 18, 2014

Is there anything else to test with the Pull request?

@PatrickFerry
Copy link
Contributor

@JMC47 Unless the last commit has introduced some weird issue I doubt it.

@CrossVR
Copy link
Contributor

CrossVR commented Dec 18, 2014

LGTM, this PR fixes Luigi's Mansion. It basically fixes every game that uses EFB copies.

shuffle2 added a commit that referenced this pull request Dec 18, 2014
D3D: Fixed D3D validation error during EFB to texture copy
@shuffle2 shuffle2 merged commit 717e155 into dolphin-emu:master Dec 18, 2014
@kayru kayru deleted the d3d_efb_copy_fix branch December 19, 2014 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
8 participants