-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
SoftGPU: Implement mipmapping #9673
Conversation
This fixes several obvious issues in Crisis Core, but it's still wrong when texcoords go the other direction. Need to use the deltas.
A tiny bit faster.
These should only be used for CLUT4.
It seems like this is what the PSP does, or maybe this is just correcting for floating point error...
GPU/Software/Rasterizer.cpp
Outdated
float detail; | ||
switch (gstate.getTexLevelMode()) { | ||
case GE_TEXLEVEL_MODE_AUTO: | ||
detail = std::log2f(std::abs(std::max(ds, dt))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optimization idea: instead of using the accurate log2f, pick apart the max(ds, dt) floating point number and use the exponent (biased appropriately) for the detail level and the mantissa as the interpolation factor towards the next one. I believe that's what most hardware implementations actually do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good plan. Wasn't worrying about optimization overly yet. Probably forgot <cmath>
for log2f anyway...
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, as expected this gave a pretty decent improvement to performance - 68 -> 73 FPS in the #6357 animation.
-[Unknown]
Travis looks a bit unhappy, coincidentally it's about the log2f operation. |
This is probably what the hardware does and much faster.
These now affect softgpu, so let's not disable them.
There's a few things left to fix, but this largely implements all the mipmapping outlined in #9621. The animations in #6357 work roughly as expected.
Things that remain:
Crisis Core looks quite a bit better with this rounding. But, this does impact performance negatively overall.
-[Unknown]