Browse Source

Prevent linear filtering on RGBA32F images when the system doesn't support it.

--HG--
branch : minor
Alex Szpakowski 9 years ago
parent
commit
d50cf0ac4a
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/modules/graphics/opengl/Image.cpp

+ 8 - 0
src/modules/graphics/opengl/Image.cpp

@@ -501,6 +501,14 @@ void Image::setFilter(const Texture::Filter &f)
 
 	filter = f;
 
+	if (!data.empty() && !hasTextureFilteringSupport(data[0]->getFormat()))
+	{
+		filter.mag = filter.min = FILTER_NEAREST;
+
+		if (filter.mipmap == FILTER_LINEAR)
+			filter.mipmap = FILTER_NEAREST;
+	}
+
 	// We don't want filtering or (attempted) mipmaps on the default texture.
 	if (usingDefaultTexture)
 	{