diff --git a/Core/MIPS/IR/IRInterpreter.cpp b/Core/MIPS/IR/IRInterpreter.cpp index 4e0d37fa4a..52ea205375 100644 --- a/Core/MIPS/IR/IRInterpreter.cpp +++ b/Core/MIPS/IR/IRInterpreter.cpp @@ -92,8 +92,8 @@ u32 RunValidateAddress(u32 pc, u32 addr, u32 isWrite) { return toss(t); } if constexpr (alignment > 1) - if ((addr & (alignment - 1)) != 0) - return toss(MemoryExceptionType::ALIGNMENT); + if ((addr & (alignment - 1)) != 0) + return toss(MemoryExceptionType::ALIGNMENT); return 0; } diff --git a/GPU/Software/DrawPixel.cpp b/GPU/Software/DrawPixel.cpp index 6d6ba70ed9..35b5d99b8e 100644 --- a/GPU/Software/DrawPixel.cpp +++ b/GPU/Software/DrawPixel.cpp @@ -737,7 +737,7 @@ void SOFTRAST_CALL DrawSinglePixel(int x, int y, int z, int fog, Vec4IntArg colo if (pixelID.dithering) { blended += Vec3::AssignToAll(pixelID.cached.ditherMatrix[(y & 3) * 4 + (x & 3)]); } - + // ToRGB() always automatically clamps. new_color = blended.ToRGB(); new_color |= stencil << 24; diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index 19e50222ac..dbb53dea76 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -1016,33 +1016,33 @@ void DrawTriangleSlice( } if (state.enableTextures) { - if constexpr (!clearMode) { - Vec4 s, t; - if (state.throughMode) { - s = Interpolate(v0.texturecoords.s(), v1.texturecoords.s(), v2.texturecoords.s(), w0, w1, - w2, wsum_recip); - t = Interpolate(v0.texturecoords.t(), v1.texturecoords.t(), v2.texturecoords.t(), w0, w1, - w2, wsum_recip); + if constexpr (!clearMode) { + Vec4 s, t; + if (state.throughMode) { + s = Interpolate(v0.texturecoords.s(), v1.texturecoords.s(), v2.texturecoords.s(), w0, w1, + w2, wsum_recip); + t = Interpolate(v0.texturecoords.t(), v1.texturecoords.t(), v2.texturecoords.t(), w0, w1, + w2, wsum_recip); - // For levels > 0, mipmapping is always based on level 0. Simpler to scale first. - s *= 1.0f / (float) (1 << state.samplerID.width0Shift); - t *= 1.0f / (float) (1 << state.samplerID.height0Shift); - } else if (state.textureProj) { - // Texture coordinate interpolation must definitely be perspective-correct. - GetTextureCoordinatesProj(v0, v1, v2, w0, w1, w2, wsum_recip, s, t); - } else { - // Texture coordinate interpolation must definitely be perspective-correct. - GetTextureCoordinates(v0, v1, v2, w0, w1, w2, wsum_recip, s, t); - } + // For levels > 0, mipmapping is always based on level 0. Simpler to scale first. + s *= 1.0f / (float) (1 << state.samplerID.width0Shift); + t *= 1.0f / (float) (1 << state.samplerID.height0Shift); + } else if (state.textureProj) { + // Texture coordinate interpolation must definitely be perspective-correct. + GetTextureCoordinatesProj(v0, v1, v2, w0, w1, w2, wsum_recip, s, t); + } else { + // Texture coordinate interpolation must definitely be perspective-correct. + GetTextureCoordinates(v0, v1, v2, w0, w1, w2, wsum_recip, s, t); + } - if (state.TexLevelMode() == GE_TEXLEVEL_MODE_SLOPE) { - // Not sure what's right, but we need one value for the slope. - float clipw = (v0.clipw * w0.x + v1.clipw * w1.x + v2.clipw * w2.x) * wsum_recip.x; - ApplyTexturing(state, prim_color, mask, s, t, clipw); - } else { - ApplyTexturing(state, prim_color, mask, s, t, 0.0f); - } - } + if (state.TexLevelMode() == GE_TEXLEVEL_MODE_SLOPE) { + // Not sure what's right, but we need one value for the slope. + float clipw = (v0.clipw * w0.x + v1.clipw * w1.x + v2.clipw * w2.x) * wsum_recip.x; + ApplyTexturing(state, prim_color, mask, s, t, clipw); + } else { + ApplyTexturing(state, prim_color, mask, s, t, 0.0f); + } + } } if constexpr (!clearMode) {