From ae88c642c6b73de30f9746a8a505396c5522788c Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Wed, 23 Mar 2022 10:27:29 +0100 Subject: [PATCH] LibSoftGPU: Test for `1.f` equality in determining the scale factor We are still not doing the right thing here, but using `<=` instead of `<` at least gets rid of artifacts in Grim Fandango. --- Userland/Libraries/LibSoftGPU/Sampler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibSoftGPU/Sampler.cpp b/Userland/Libraries/LibSoftGPU/Sampler.cpp index b9b34641a7..e7e1db1ebd 100644 --- a/Userland/Libraries/LibSoftGPU/Sampler.cpp +++ b/Userland/Libraries/LibSoftGPU/Sampler.cpp @@ -129,7 +129,7 @@ Vector4 Sampler::sample_2d(Vector2 const& uv) // parallelisation as we could also end up with different filter modes per pixel. // Note: scale_factor approximates texels per pixel. This means a scale factor less than 1 indicates texture magnification. - if (scale_factor[0] < 1) + if (scale_factor[0] <= 1.f) return sample_2d_lod(uv, expand4(base_level), m_config.texture_mag_filter); if (m_config.mipmap_filter == MipMapFilter::None)