From 65e31f890d0c02701ea20765eaaf3f863bed29f5 Mon Sep 17 00:00:00 2001 From: Dario Manesku Date: Wed, 23 Mar 2016 00:17:15 +0100 Subject: [PATCH 1/2] Fixing textureFilterMin table. --- src/renderer_gl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 43516be1..395856cd 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -186,9 +186,9 @@ namespace bgfx { namespace gl static const GLenum s_textureFilterMin[][3] = { - { GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, GL_NEAREST_MIPMAP_LINEAR }, - { GL_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_NEAREST }, - { GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, GL_NEAREST_MIPMAP_LINEAR }, + { GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR_MIPMAP_NEAREST }, + { GL_NEAREST, GL_NEAREST_MIPMAP_LINEAR, GL_NEAREST_MIPMAP_NEAREST }, + { GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR_MIPMAP_NEAREST }, }; struct TextureFormatInfo From 956622e3606062a3266e21cfb2922008f72fd2df Mon Sep 17 00:00:00 2001 From: Dario Manesku Date: Wed, 23 Mar 2016 00:20:58 +0100 Subject: [PATCH 2/2] Fixing texture flags when forcing point sampling. --- src/renderer_gl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 395856cd..f89ed216 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -4437,11 +4437,11 @@ namespace bgfx { namespace gl && !s_textureFilter[m_textureFormat]) { // Force point sampling when texture format doesn't support linear sampling. - _flags &= 0 + _flags &= ~(0 | BGFX_TEXTURE_MIN_MASK | BGFX_TEXTURE_MAG_MASK | BGFX_TEXTURE_MIP_MASK - ; + ); _flags |= 0 | BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT