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

GPU texture scaling issues (slow in Valkyrie Profile, alpha issues) #12463

Closed
bajolzas opened this issue Nov 3, 2019 · 11 comments
Closed

GPU texture scaling issues (slow in Valkyrie Profile, alpha issues) #12463

bajolzas opened this issue Nov 3, 2019 · 11 comments
Labels
GE emulation Backend-independent GPU issues Performance Unexpected slow performance issues
Milestone

Comments

@bajolzas
Copy link

bajolzas commented Nov 3, 2019

What happens?

I was testing the "TexHardwareScaling = true" setting in ppsspp.ini and noticed these problems:

-In Valkyrie profile, some scenes just kill my GPU, with that setting, for no apparent reason (in this case those in Angrim's house)
-FMV scenes in Lunar desappear, only the sond remaining.
-In Lunar as well, some text that was white is now green.
-Havent tested much else, but I've noticed some spikes to 100% GPU usage here and there; hope it can be fixed.

What should happen?

Better performance (I think) and no visual bugs.

What hardware, operating system, and PPSSPP version? On desktop, GPU matters for graphical issues.

GPU: NVIDIA GeForce 940MX
Windows 10
PPSSPPv1.9.3-130-g9a5766bcf

@LunaMoo
Copy link
Collaborator

LunaMoo commented Nov 3, 2019

The algorithm it uses currently doesn't respect alpha, that's a known problem, probably causes both green background and black screen on fmv's.

By "kill gpu" do you just mean performance?
The plan is to support any compute shader filter via external files similary to post process shaders and there might be cheaper algorithms out there more usable on low end hardware. That being said this feature's requirements will always differ a lot depending on what's the game's doing and I don't think it ever should have hardcore limitations just to run well on low end gpu's as in such case you might as well return to using the cpu based scaling which scales things with a delay and skips scaling some textures altogether as that's the only way to get rid of such performance "spikes" where game loads a lot of new textures or constantly modifies existing ones, effectively leading to same thing.

@unknownbrackets
Copy link
Collaborator

Texture scaling on the GPU currently ignores how frequently textures change and how many other textures were scaled on the same screen. It's killing your GPU just because the scaling is too much without these limits.

For CPU based texture scaling, we currently skip scaling textures the game animates in place in certain ways, and scale only a max number of pixels per frame (causing pop-in of detail.) This probably needs to be applied to GPU based scaling, but perhaps with different or auto-detected limits.

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Nov 4, 2019

Yeah, some 2D games reuse the same large texture with small tile changes or palette changes, this is a worst case for texture scaling and even a GPU can't crunch through rescaling the entire texture multiple times per frame fast enough. Possibly the secondary texture cache option can help this though?

@bajolzas
Copy link
Author

bajolzas commented Nov 4, 2019

"By "kill gpu" do you just mean performance?"
Yes, weird that, from what I tested (wich wasn't much) it only really happened in that specific scene, in that specific place.

It'd be nice if we could use some of the performance workarounds of the CPU sclaling in the GPU one.

Also being able set the max number of pixels being scaled per frame would be nice (and/or the emulator be able to autodetect a sensible number).

Also I dont think my GPU is considered low end, sure it is a laptop GPU, but low end is a bit of a stretch.

@LunaMoo
Copy link
Collaborator

LunaMoo commented Nov 5, 2019

With Nvidia naming scheme you have xx70/xx80 as a high end, xx50/xx60 for mediocre budget cards and anything under is a low end typically not much different from integrated graphics performance wise outside of having dedicated memory.

The difference between 940mx which not only being a low end model, but also it's mobile version and something like a desktop rtx 2060 or even still likely the most popular gtx 1060 is soo high, that most of your performance killing problems would not even cause a noticeable frame drop and people have way stronger gpu's than that.

Since hardware texture scaling was a proposed solution for texture scaling popping in with a delay and avoiding scaling some textures alltogether, it should be free of those hardcore limitations and if it really has to get some as there are some extreme situations like some FFT0 effects, especially the tutorial "???" boss, it should not be so awful at punishing people with higher end hardware as with CPU based scaling where no hardware in existence could scale textures in real time, heck it ruins frame time noticeably even with the limitations it has on modern cpu's and should not be compared to GPU's situation which are way better at doing this and top end ones can actually do it in real time.

Imo it at most should have a limitations of texels per frame, but even with that, it should be much higher than what's set for cpu based scaling or at least should be user selectable instead of a constant forcing people with gaming hardware into their own builds. And to be clear I don't advocate about it for myself as I would use my own builds to play anyway.;p

@ghost
Copy link

ghost commented Nov 9, 2021

Valkyrie Profile - Lenneth still slow with upscaling texture shader using vulkan backend.

Rendering resolution 2x
Display resolution native
Texture shader 4xBRZ
Screenshot_2021-11-09-16-25-16-384_org ppsspp ppsspp
recording.ppdmp.zip

@hrydgard
Copy link
Owner

hrydgard commented Nov 9, 2021

At least it should be an improvement from before... is it not?

But we may need to take measures to prevent some textures from being upscaled in this game, and we need to be smarter about alpha.

@hrydgard hrydgard added GE emulation Backend-independent GPU issues Performance Unexpected slow performance issues labels Nov 9, 2021
@hrydgard hrydgard added this to the Future-Prio milestone Nov 9, 2021
@hrydgard hrydgard changed the title GPU texture scaling issues GPU texture scaling issues (slow in Valkyrie Profile, alpha issues) Nov 9, 2021
@ghost
Copy link

ghost commented Nov 9, 2021

At least it should be an improvement from before... is it not?

But we may need to take measures to prevent some textures from being upscaled in this game, and we need to be smarter about alpha.

I can't compare because 4xBRZ is buggy before on my phone RN9 with Mali-G52 GPU :(

@hrydgard
Copy link
Owner

hrydgard commented Nov 9, 2021

Oh, right. Well, at least it works now and didn't before :D

@ghost
Copy link

ghost commented Apr 15, 2022

This issue can be close now performance improvement in vulkan with 4xBRZ texture shader is malupet 😎👍

https://drive.google.com/file/d/1CdxPZ1ruFnkPyemEUerlLWZSEud5v6Ok/view?usp=drivesdk

@hrydgard
Copy link
Owner

Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues Performance Unexpected slow performance issues
Projects
None yet
Development

No branches or pull requests

4 participants