Przeglądaj źródła

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.
Stephan Unverwerth 3 lat temu
rodzic
commit
869393c7a0
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      Userland/Libraries/LibGL/SoftwareGLContext.cpp

+ 4 - 4
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;