Index: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
index 3d04ecf6f55805db757caba6b23430516db667ad..4df68550156c10c8abbf74d9cf6a3b5617e54707 100644 |
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
@@ -106,10 +106,24 @@ const GLenum kSupportedInternalFormatsStorage[] = { |
GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, |
}; |
+const GLenum kCompressedTextureFormatsETC2EAC[] = { |
+ GL_COMPRESSED_R11_EAC, |
+ GL_COMPRESSED_SIGNED_R11_EAC, |
+ GL_COMPRESSED_RG11_EAC, |
+ GL_COMPRESSED_SIGNED_RG11_EAC, |
+ GL_COMPRESSED_RGB8_ETC2, |
+ GL_COMPRESSED_SRGB8_ETC2, |
+ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, |
+ GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, |
+ GL_COMPRESSED_RGBA8_ETC2_EAC, |
+ GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, |
+}; |
+ |
WebGL2RenderingContextBase::WebGL2RenderingContextBase(HTMLCanvasElement* passedCanvas, PassOwnPtr<WebGraphicsContext3D> context, const WebGLContextAttributes& requestedAttributes) |
: WebGLRenderingContextBase(passedCanvas, context, requestedAttributes) |
{ |
m_supportedInternalFormatsStorage.insert(kSupportedInternalFormatsStorage, kSupportedInternalFormatsStorage + arraysize(kSupportedInternalFormatsStorage)); |
+ m_compressedTextureFormatsETC2EAC.insert(kCompressedTextureFormatsETC2EAC, kCompressedTextureFormatsETC2EAC + arraysize(kCompressedTextureFormatsETC2EAC)); |
} |
WebGL2RenderingContextBase::~WebGL2RenderingContextBase() |
@@ -585,6 +599,11 @@ bool WebGL2RenderingContextBase::validateTexStorage(const char* functionName, GL |
if (!tex) |
return false; |
+ if (functionType == TexStorageType3D && target == GL_TEXTURE_3D && m_compressedTextureFormatsETC2EAC.find(internalformat) != m_compressedTextureFormatsETC2EAC.end()) { |
+ synthesizeGLError(GL_INVALID_OPERATION, functionName, "invalid ETC2/EAC internalformat for TexStorage3D if target is not TEXTURE_2D_ARRAY"); |
+ return false; |
+ } |
bajones
2015/11/19 19:16:21
A couple of really minor nits here: Could you chan
qiankun
2015/11/19 22:54:08
Done.
|
+ |
if (m_supportedInternalFormatsStorage.find(internalformat) == m_supportedInternalFormatsStorage.end()) { |
synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid internalformat"); |
return false; |