mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
softgpu: Avoid splitting rectangles for fog.
If the fog factor would result in the same amount of fog, we're just adding more work for no reason.
This commit is contained in:
parent
21064edfca
commit
a66056217f
1 changed files with 9 additions and 1 deletions
|
@ -203,7 +203,15 @@ void ProcessRect(const ClipVertexData &v0, const ClipVertexData &v1, BinManager
|
|||
else if (outsidePos >= 2 || outsideNeg >= 2)
|
||||
return;
|
||||
|
||||
if (v0.v.fogdepth != v1.v.fogdepth) {
|
||||
bool splitFog = v0.v.fogdepth != v1.v.fogdepth;
|
||||
if (splitFog) {
|
||||
// If they match the same 1/255, we can consider the fog flat. Seen in Resistance.
|
||||
// More efficient if we can avoid splitting.
|
||||
static constexpr float foghalfstep = 0.5f / 255.0f;
|
||||
if (v1.v.fogdepth - foghalfstep <= v0.v.fogdepth && v1.v.fogdepth + foghalfstep >= v0.v.fogdepth)
|
||||
splitFog = false;
|
||||
}
|
||||
if (splitFog) {
|
||||
// Rectangles seem to always use nearest along X for fog depth, but reversed.
|
||||
// TODO: Check exactness of middle.
|
||||
VertexData vhalf0 = v1.v;
|
||||
|
|
Loading…
Add table
Reference in a new issue