From 869393c7a01addf077de5ddbc8da9a20db92bab0 Mon Sep 17 00:00:00 2001 From: Stephan Unverwerth Date: Fri, 18 Feb 2022 23:58:55 +0100 Subject: [PATCH] LibGL: Fix interpretation of mipmap filtering modes GL_LINEAR_MIPMAP_NEAREST means choose nearest mipmap level, interpolate texels linearly. GL_NEAREST_MIPMAP_LINEAR means choose the two closest mipmap levels, sample the texels unfiltered and linearly interpolate based on the fractional value of the mipmap level. Previously we had this backwards. --- Userland/Libraries/LibGL/SoftwareGLContext.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.cpp b/Userland/Libraries/LibGL/SoftwareGLContext.cpp index 475d22e889..d6424d67be 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.cpp +++ b/Userland/Libraries/LibGL/SoftwareGLContext.cpp @@ -2996,13 +2996,13 @@ void SoftwareGLContext::sync_device_sampler_config() config.mipmap_filter = SoftGPU::MipMapFilter::Nearest; break; case GL_LINEAR_MIPMAP_NEAREST: - config.texture_min_filter = SoftGPU::TextureFilter::Nearest; - config.mipmap_filter = SoftGPU::MipMapFilter::Linear; - break; - case GL_NEAREST_MIPMAP_LINEAR: config.texture_min_filter = SoftGPU::TextureFilter::Linear; config.mipmap_filter = SoftGPU::MipMapFilter::Nearest; break; + case GL_NEAREST_MIPMAP_LINEAR: + config.texture_min_filter = SoftGPU::TextureFilter::Nearest; + config.mipmap_filter = SoftGPU::MipMapFilter::Linear; + break; case GL_LINEAR_MIPMAP_LINEAR: config.texture_min_filter = SoftGPU::TextureFilter::Linear; config.mipmap_filter = SoftGPU::MipMapFilter::Linear;