-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
GS-hw, TC: improve tex in rt. #3895
GS-hw, TC: improve tex in rt. #3895
Conversation
Test Drive Unlimited didn't favor it a lot. Only HW rendering is affected (SW Renderer is safe for now) Update: It's fixed from later build updates. |
Hello imine, good work. #563 improved and the sky issue is now fixed for Burnout Revenge. Black is still experiencing sky issues. I fear that it will be hard to debug however given the nature of it using the Burnout engine. I need a rather large dump starting at loading the level and ending when the sky is first visible. Perhaps @refractionpcsx2 can provide me with that so I can get you more details. That being said, the reflections on the cars are still flickering. On master without tex in rt I was unable to reproduce the flickering. However, on master with tex in rt enabled the flickering is observed and worse. So I suspect there is some tuning in tex in rt for this game that is needed but this is an improvement over master's tex in rt implementation for sure. Additionally, #3694 has seen improvement with this PR. However, it still exhibits some problems. I can get you a dump if this game if you need. This is more straightforward to debug than the Burnout games. |
I will try to do some debugging today and provide some information about Burnout/Black. |
Thanks kojin, I agree the Burnout engine is not easy to debug unfortunately. I saw previously on discord that Burnout Dominator was working though, but now it seems not, maybe due to the recent PR update. Maybe having also a gsdump for #3694 can be of help. |
Yeah I suspect that will be easier and will give you something to look at in the meantime You're looking for the draw where depth/color gets downsized. They're going to copy them into a temp buffer and color is going to be right under depth but using the same address, then sampled back later (after EE processing) from a different address. |
The replay of Driving Emotion S you gave me looks fine here. Here the first draw call that uses tex in rt:
|
Alright, it might have been fixed since you added new commits. Let me give it a shot. |
The new commits were:
|
Looks like there's an issue with it over time: |
Okay, testers are obviously confused so let me explain. The Burnout engine is a special case for this. The game renders the sky to a texture. It then samples that texture back with a different offset. This means that the part of the texture it wants for the sky will be at a different memory address than where it was rendered. This is the problem tex in rt solves. However, unlike other examples (jak eyes, driving emotion s) where the texture is rendered to every frame, Burnout only renders the texture when the level is loading. Additionally, sw rendering doesn't experience this problem because it's a different cache implementation. So when you load the level in software, it renders the texture to GS memory and then is able to invalidate it correctly and so when it gets sampled back, it is found. If you switch to HW renderer after this, the HW renderer will read the texture out of GS memory as it would any other texture transferred in from the EE. This is why that workaround works. This has additional complications due to the fact that the HW renderer will not invalidate rt back into GS memory. This is a problem that is outside the scope of this PR but has some side effects when switching from HW to SW when the level is loaded in HW or opening the config for example. |
I see, it does seem to have improved the sky, just was surprised the black sky problem was also happening in SW mode (first in HW mode and then switching to SW) but was fine after 2 restarts of the race. Sorry :o |
9ddc75c
to
ef462ec
Compare
I gave up on Driving Emotion S in this PR. |
I don't agrea with the jak only fix, this should be a general fix as it improves burnout, gateway and probably many others. |
I better specified in the PR description what is the Jak only change: it is a small bonus part of the PR, that uses the same logic of the tex in rt, but applied to framebuffer invalidation. |
Ok, thanks for the explaination. |
Ignore me, I was informed I missed a previous conversation regarding these issues. |
Skybox is still not being loaded up correctly on HW on latest commit. It's blue but missing clouds and has bad banding. Sky turns black after toggling to Software and is broken until you start again from menus. |
- this avoids the currently used target to become the MRU in its cache and correctly keeps the target used by the previous draw as the MRU during the lookup source call.
Also move any target BW update from InvalidateVideoMem to LookupTarget. Fixes Indiana Jones map rendering in cutscenes.
Improves Beyond Good & Evil shadow.
531d267
to
6970ebb
Compare
6970ebb
to
045775a
Compare
Ref made this for easily seeing if the function gets triggered if anyone is interested, enable HW hacks and tex in rt and check the program log/ console: |
I downloaded that. That launcher just made the game really slow. I didn't notice any text in the Program Log that said Tex in RT had been activated. So maybe it's not activating. |
Regarding xenosaga 3, I have a gs dump from the "crystallized section" that works correctly now on master. Can you try forcing the tex in rt option active from the hw hacks section? Maybe the CRC of your game version is not registered for auto enabling the tex in rt logic. |
Maybe that's the issue. I have a save from the Zarathustra Dungeon that I used on my AMD laptop and my Desktop that has an RTX 3060 graphics card. The graphical problem still occurs on both. I enabled the option in the HW hacks section, and I looked to see if it was enabled in the ini file. (I'm not a computer programmer, although I'd like to contribute with code, I don't have the knowledge, so don't ask anything too advanced, lol). Here's what the program log said, I assume this was the relevant section: Patches: No CRC found, using 00000000 instead. So first it mentions not having a CRC code to apply a patch, but then it says midway through that it has a CRC code. |
hmm that CRC is in there... can you try it on #5433 ? |
|
if you go to the checks at the bottom of #5433, then click on the "details" next to one of the windows builds, then go to "summary", there are builds in there. |
I did that, I downloaded the AVX 64bit build. Same glitch still popping up. Perfectly willing to do more testing for you guys after some more work was done on it. |
@rtj503 can you provide a GSDump of Xenosaga, please? might make testing easier. |
What's a GSDump and how do I do that? Sorry for asking the beginner questions. I'm perfectly fine helping out, but I need guidance doing since I don't know anything about the software other than what's on PCSX2 website. I couldn't find that in the PCSX2 documentation. I do have a memory card file. I've found Memory Cards work well finally in the newer builds. |
Here's an explanation how to make one https://forums.pcsx2.net/Thread-How-to-create-a-proper-GS-dump |
Okay, I followed the directions, and posted the GS Dump in the forums. Link here: https://forums.pcsx2.net/Thread-GSdx?pid=624888#pid624888 |
I improved the tex in rt code which logic is now encapsulated in the
GSTextureCache::ComputeSurfaceOffset
method.The method considers two surfaces A and B, and computes the offset from B to A in terms of B coordinates.
In the tex in rt case, A is the Source object and B is the Target object.
We want to know the offset from B to A in order to associate to A the correct portion of data from B.
The improved logic is able to fix/improve:
Burnout 3 black sky (clouds still missing, sky texture not invalidated to GS local memory so black sky reappears if TC is cleared, better solution in GS-hw: fix Burnout games black sky. #4094 )The logic can be enabled via .ini file (
UserHacks_TextureInsideRt = 1
) for non Jak games, or from the GS HW hacks settings GUI.Due to the nature of GS-hw TC, the logic cannot be always enabled without causing regressions.
The
GSTextureCache::ComputeSurfaceOffset
method is intended as future proof, potentially useful for detecting overlaps between EE writes and cached Targets, or between cached Targets alone.Bonus 1:
The order in which Target and Source are searched in the cache is inverted, now:
Previously, the lookup source call saw the current target as MRU framebuffer, but this was not correct as that framebuffer was not written yet in the current draw.
This fixed in a decent way the misbehaviour of Test Drive Unlimited with tex in rt.
Bonus 2:
Targets are now readback from LRU to MRU (older data is overwritten with newer data).
Did not fix any particular issue, but it is more correct behaviour nevertheless.
Bonus 3:
TheGSTextureCache::ComputeSurfaceOffset
is reused to detect draws that invalidate partially a framebuffer with increased precision in Jak 2/3/X to fix striped and shimmering textures and wheels rendering in Jak X.Unfortunately some games do not digest this change really well, so this improved logic is executed only for the games cited previously.POSTPONED to future PR.
Bonus 4:
Partially dirty targets are now searched for valid data.