Changeset 167520 in webkit
- Timestamp:
- Apr 18, 2014 5:29:45 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167518 r167520 1 2014-04-18 Dean Jackson <dino@apple.com> 2 3 [WebGL] Limit maximum texture sizes on older Intel hardware 4 https://bugs.webkit.org/show_bug.cgi?id=131867 5 6 Reviewed by Geoffrey Garen. 7 8 Both Chrome and Firefox limit the MAX_TEXTURE_SIZE on 9 older Intel hardware to be at most 4096. This does the 10 same for WebKit. 11 12 * platform/graphics/Extensions3D.h: Add requiresRestrictedMaximumTextureSize() accessor. 13 * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: 14 (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon): Record the value of GL_RENDERER 15 and test for "Intel HD Graphics 3000", which is the problematic hardware. 16 * platform/graphics/opengl/Extensions3DOpenGLCommon.h: 17 (WebCore::Extensions3DOpenGLCommon::requiresRestrictedMaximumTextureSize): Getter. 18 * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: 19 (WebCore::GraphicsContext3D::getIntegerv): If you're asking for MAX_TEXTURE_SIZE or 20 MAX_CUBE_MAP_TEXTURE_SIZE, and you're on problematic hardware, return a clamped value 21 (4096 and 1024 respectively). 22 1 23 2014-04-18 Hans Muller <hmuller@adobe.com> 2 24 -
trunk/Source/WebCore/platform/graphics/Extensions3D.h
r166563 r167520 254 254 255 255 // Some configurations have bugs regarding built-in functions in their OpenGL drivers 256 // that must be avoided. Ports should implement th is flagsuch configurations.256 // that must be avoided. Ports should implement these flags on such configurations. 257 257 virtual bool requiresBuiltInFunctionEmulation() = 0; 258 virtual bool requiresRestrictedMaximumTextureSize() = 0; 259 258 260 }; 259 261 -
trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
r166563 r167520 61 61 , m_maySupportMultisampling(true) 62 62 , m_requiresBuiltInFunctionEmulation(false) 63 , m_requiresRestrictedMaximumTextureSize(false) 63 64 { 64 65 m_vendor = String(reinterpret_cast<const char*>(::glGetString(GL_VENDOR))); 66 m_renderer = String(reinterpret_cast<const char*>(::glGetString(GL_RENDERER))); 65 67 66 68 Vector<String> vendorComponents; … … 97 99 if (m_isAMD && !systemSupportsMultisampling) 98 100 m_maySupportMultisampling = false; 101 102 // Intel HD 3000 devices have problems with large textures. <rdar://problem/16649140> 103 if (m_isIntel) 104 m_requiresRestrictedMaximumTextureSize = m_renderer.startsWith("Intel HD Graphics 3000"); 99 105 #endif 100 106 } -
trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h
r166563 r167520 68 68 virtual bool maySupportMultisampling() { return m_maySupportMultisampling; } 69 69 virtual bool requiresBuiltInFunctionEmulation() { return m_requiresBuiltInFunctionEmulation; } 70 virtual bool requiresRestrictedMaximumTextureSize() { return m_requiresRestrictedMaximumTextureSize; } 70 71 71 72 protected: … … 89 90 bool m_maySupportMultisampling; 90 91 bool m_requiresBuiltInFunctionEmulation; 92 bool m_requiresRestrictedMaximumTextureSize; 91 93 92 94 String m_vendor; 95 String m_renderer; 93 96 }; 94 97 -
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
r165676 r167520 241 241 break; 242 242 #endif 243 case MAX_TEXTURE_SIZE: 244 ::glGetIntegerv(MAX_TEXTURE_SIZE, value); 245 if (getExtensions()->requiresRestrictedMaximumTextureSize()) 246 *value = std::min(4096, *value); 247 break; 248 case MAX_CUBE_MAP_TEXTURE_SIZE: 249 ::glGetIntegerv(MAX_CUBE_MAP_TEXTURE_SIZE, value); 250 if (getExtensions()->requiresRestrictedMaximumTextureSize()) 251 *value = std::min(1024, *value); 252 break; 243 253 default: 244 254 ::glGetIntegerv(pname, value);
Note: See TracChangeset
for help on using the changeset viewer.