From 42884e76004d2493fb85c7588315fdb0aebd8664 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 31 Jul 2015 13:44:39 +0000 Subject: [PATCH] From Jannik Heller, "Here is a patch for the S3TC capability check. On a Intel HD graphics Linux system with Mesa 10.1.3, I found that osg's Extensions::isTextureCompressionS3TCSupported() returned false, even though S3TC compressed textures *are* in fact working. I tested this by loading and rendering various DXT1, DXT3 and DXT5 compressed textures in the OSG. "glxinfo | grep s3tc" gives: GL_S3_s3tc Note, if I install the package "libtxc-dxtn-s2tc0", I get in addition: glxinfo | grep s3tc GL_EXT_texture_compression_s3tc GL_S3_s3tc However, S3TC compressed textures worked correctly within the OSG even without libtxc-dxtn-s2tc0 installed. I'm not sure what the differences between these extensions are, but based on the description at https://www.opengl.org/registry/specs/S3/s3tc.txt I would assume that both will work for OSG's purposes. The attached patch changes isTextureCompressionS3TCSupported() to accept either extension." git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15035 16af8721-9629-0410-8352-f15c8da7e697 --- src/osg/GLExtensions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osg/GLExtensions.cpp b/src/osg/GLExtensions.cpp index 82939aef7..24e49917b 100644 --- a/src/osg/GLExtensions.cpp +++ b/src/osg/GLExtensions.cpp @@ -807,7 +807,7 @@ GLExtensions::GLExtensions(unsigned int contextID) isTextureFilterAnisotropicSupported = isGLExtensionSupported(contextID,"GL_EXT_texture_filter_anisotropic"); isTextureSwizzleSupported = isGLExtensionSupported(contextID,"GL_ARB_texture_swizzle"); isTextureCompressionARBSupported = builtInSupport || isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_compression", 1.3f); - isTextureCompressionS3TCSupported = isGLExtensionSupported(contextID,"GL_EXT_texture_compression_s3tc"); + isTextureCompressionS3TCSupported = isGLExtensionSupported(contextID,"GL_EXT_texture_compression_s3tc") || isGLExtensionSupported(contextID, "GL_S3_s3tc"); isTextureCompressionPVRTC2BPPSupported = isGLExtensionSupported(contextID,"GL_IMG_texture_compression_pvrtc"); isTextureCompressionPVRTC4BPPSupported = isTextureCompressionPVRTC2BPPSupported;//covered by same extension isTextureCompressionETCSupported = isGLExtensionSupported(contextID,"GL_OES_compressed_ETC1_RGB8_texture");