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

Upload stencil/color on FBO create, clear depth/stencil to 0, fix software transform #6362

Merged
merged 6 commits into from
Jun 18, 2014

Conversation

unknownbrackets
Copy link
Collaborator

Forcing a to 1.0 in DrawPixels() was a problem with blending a long time ago. It's better to upload the actual alpha, e.g. for block transfers. Would actually like to upload stencil but I have a feeling performance will be horrible in some games.

Also fixes normal handling in software transform to match hardware transform better.

Then I went ahead and cleared the stencil and depth to 0, except on FBO creation where it uploads. I'm hoping this doesn't cause any glitches... it may theoretically help "read framebuffers to memory" since it will destroy texture data a tiny bit less often.

Hexyz Force (#4719) still works already, no replacements needed, so something may already be catching it or the upload on create is.

-[Unknown]

Doesn't update stencil, but at least it updates alpha.

This was fixed to 1.0 before because we had blending enabled by accident
during DrawPixels().
Fixes pausing or loading a savestate in Star Ocean (previously your
character became invisible until the screen panned.)
Memory is generally initially zeros.
Memory is generally initially zeros, after all.  Fixes hrydgard#5205 (or at least
improves it?) and fixes hrydgard#6226.
@hrydgard
Copy link
Owner

Good stuff. Seems right, let's try it.

hrydgard added a commit that referenced this pull request Jun 18, 2014
Upload stencil/color on FBO create, clear depth/stencil to 0, fix software transform
@hrydgard hrydgard merged commit 413704f into hrydgard:master Jun 18, 2014
@unknownbrackets unknownbrackets deleted the gpu-minor branch June 18, 2014 07:41
@solarmystic
Copy link
Contributor

@unknownbrackets @hrydgard I'm not so sure whether to report this or not, but is it possible for this pull request to introduce hangs/complete system lock ups in games followed by "EmuThread:Time Out" situations when Simulate Block Transfer is enabled?

Why I ask is because ever since this pull request was merged to master, I've been getting those afore mentioned situations at random with Final Fantasy Type 0 and other games when Simulate Block Transfer is enabled.

Disabling Simulate Block Transfer helps with the situation.

I'm struggling to narrow down the exact responsible commit from this pull request via a bisect, because everytime it happens, my usually rock solid stable system completely locks up for about 30 seconds, and after hammering the Ctrl-Alt-Del keys to bring up the Task manager, it takes a while for it to come out and to terminate the offending ppsspp process which has consumed 100% CPU time even though Multithreaded is disabled.

This has not ever happened to my system and PPSSPP before in the previous git build of v0.9.8-1263-gd8c392e and all other revisions prior to this one.

I don't think @xsacha's recent QT commits have anything to do with Windows, so I'm definitely certain that pull request is responsible.

@unknownbrackets
Copy link
Collaborator Author

That's pretty weird. You can try commenting out these two lines:
unknownbrackets@a9da361#diff-29313f9f6ed28d0e24e6dac4e0db8933R990

And it happens in multiple games, right? Is it right away, or a bit into the game?

-[Unknown]

@solarmystic
Copy link
Contributor

@unknownbrackets
It happens right before a sceen transition usually. But at random times, once it happened right after loading a save file, and another when I was deep in a mission. And yes, it happens it multiple games.

Which two lines are you referring to in that commit? I tried clicking on that link but it just pointed to this:-

capture

@unknownbrackets
Copy link
Collaborator Author

The first two lines in that screenshot (my link directly linked to line 990.)

You can also try putting a ClearBuffer(); right before those two lines.

-[Unknown]

@solarmystic
Copy link
Contributor

@unknownbrackets
Commenting out lines 990 and 991 seems to have resolved it in Type 0 (with buffered rendering and simulate block transfers enabled), but I just tested it out for about 15 minutes so far.

@unknownbrackets
Copy link
Collaborator Author

Does putting a ClearBuffer() before also make it work? I don't see why that ought to crash or burn the cpu. Does it happen even at 1x?

-[Unknown]

@solarmystic
Copy link
Contributor

@unknownbrackets
Testing a build with an added ClearBuffer(); line prior to those two lines now. Will report back later.

EDIT:- As for your latter question, it happens at any rendering resolution/window size. In windowed mode, the whole desktop also freezes, same as with fullscreen mode with auto rendering resolution. The mouse cursor becomes unresponsive, it's a total lockup.

@solarmystic
Copy link
Contributor

@unknownbrackets
Okay so after nearly 30 minutes of testing, the build with an added ClearBuffer(); line prior to those two lines does not hang/lock up my system either. Nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants