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: Replaced shader-based depth range remap with viewport #1392
Conversation
|
Do you need to erase shader cache to test? While it seems better than before in the games affected i am getting texture errors everywhere. |
|
Shader cache should automatically wipe as soon as you switch to a dolphin version that says a different git hash. |
|
@Linktothepast what kind of texture errors? |
|
Then i am just getting texture issues everywhere it seems :-( ... |
|
Is per-pixel lighting enabled? |
|
Oh, per pixel lighting seems to be the cause and it is broken, my bad. |
|
Yes, looks like PPL is broken in current master :( |
| @@ -402,7 +402,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ | |||
| //if not early z culling will improve speed | |||
| if (api_type == API_D3D) | |||
| { | |||
| out.Write("o.pos.z = " I_DEPTHPARAMS".x * o.pos.w + o.pos.z * " I_DEPTHPARAMS".y;\n"); | |||
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Anyway, back on topic, this pr seems to fix https://code.google.com/p/dolphin-emu/issues/detail?id=7785. That was plaguing dolphin for years with no fix so congrats! |
|
I have found an issue with Mario Sports Mix pal http://prntscr.com/4zkhsv. The bottom of the screen is cut with d3d while opengl is fine. |
|
@Linktothepast I will investigate. Thanks! |
|
Here is an opengl pic http://prntscr.com/4zkiqm. If you need any fifo log just say it. |
|
/offtopic: Edit: Sent |
|
@ZephyrSurfer you can just email me. |
27be087
to
975eb8e
Compare
|
@Linktothepast I've tested Mario Sports Mix and it renders the menu correctly. Though this was Amarican version, not PAL. |
|
It's probably pal issue then, do you want a fifo log? |
|
@Linktothepast I think you should link him one. |
|
Yeah, fifo would be good. |
|
A one frame fifo log. |
|
Everything seems good here, even though I only have one of the games afflicted by the bug. |
|
Any update on this? It makes OpenGL and D3D nearly identical in behavior. |
|
The supplied log doesn't render anything on both OGL and D3D in master and in this branch :( But I believe FIFO playback is just generally broken right now, not just this log. |
|
That fifo works here on master. ?? Edit: Ok only on OpenGL Edit 2: Scratch that I reset my settings. I works here on D3D as well... Edit 3: :D yeah, we must have changed some settings :p |
|
What did you reset exactly? Update: ah, deleted gfx_dx11.ini and now I can run FIFOs again! |
|
The good news is that I can now definitely reproduce the problem :) |
|
Found the culprit. Viewport min/max depth must be in range [0..1], as per http://msdn.microsoft.com/en-us/library/windows/desktop/ff476260(v=vs.85).aspx. The FIFO has viewport min/max depth as -1000 and 1000. D3D simply ignores the RSSetViewports call in this case. It is caught correctly by the D3D debug validation layer. D3D debug layer also specifies that min depth must be <= max depth, so things might still be broken in some cases. Are there games that actually do this? |
|
I tried various pal games and everything seems ok here, didn't notice any problems somewhere. It LGTM. |
|
Maybe a 2D game could do something like that? |
|
Bump, any people to review this pr for merge? Testing it seems fine. |
|
I've had no problems with it either; it's way better than the current situation in Master as well. |
|
Can confirm that this fixes my issue as well, definitely fixes Custom Robo's UI. Haven't noticed any other problems with it. |
|
I'm the one who commited the code that is now in master, the reazon for the "Misterius" comment was that some games use inverted min and max values and some of them, alien hominid for example make use of values outside the valid range for dx. |
|
Merge? |
|
Needs a rebase |
This fixes UI rendering in some games mentioned in https://code.google.com/p/dolphin-emu/issues/detail?id=7785
It would be good to know which games exactly exhibited the issue.
This shader constant was previously used for depth remapping in D3D and for pixel center correction. Now it only serves one purpose and the new name makes it clear.
d7a208a
to
36b886c
Compare
|
Sounds like Alien Hominid is the 2D game that needs a test with this PR. Perhaps it's broken here though with Kayru comment that there may still be an issue. |
|
Testing wise ZephyrSurfer there is no known issue with this, it also fixes current issues in master, it's up to the devs. |
D3D: Replaced shader-based depth range remap with viewport
|
Damn, found one game with issues, original report in the forums: https://forums.dolphin-emu.org/Thread-wii-dragon-ball-z-budokai-tenkaichi-3. It breaks ingame graphics http://prntscr.com/5eihkx , results remind me a bit of what happened with projection epsilon original merge. |
|
Can you test the second last commit @Linktothepast |
|
Nope, can't build anything here for a while now, i have local building issues. |
|
@Linktothepast |
|
@Linktothepast It's commit 3 here. I compiled myself. |
|
@Linktothepast do you have a FIFO? |
|
@ZephyrSurfer tried the build but no dice, the result is the same. |
This fixes UI rendering in some games mentioned in https://code.google.com/p/dolphin-emu/issues/detail?id=7785
It's not clear why the vertex shader depth remap was introduced in the first place. It's not present in OGL back-end.