Index: gpu/command_buffer/client/gles2_implementation.cc |
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc |
index 1c8045d75bd8269809b1690837a016d494ee94e7..34bdec9ae9cf19fbb7f3b38412b5e1757e146126 100644 |
--- a/gpu/command_buffer/client/gles2_implementation.cc |
+++ b/gpu/command_buffer/client/gles2_implementation.cc |
@@ -5198,8 +5198,18 @@ void GLES2Implementation::RetireSyncPointCHROMIUM(GLuint sync_point) { |
namespace { |
-bool ValidImageFormat(GLenum internalformat) { |
+bool ValidImageFormat(GLenum internalformat, |
+ const Capabilities& capabilities) { |
switch (internalformat) { |
+ case GL_ATC_RGB_AMD: |
+ case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: |
+ return capabilities.texture_format_atc; |
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: |
+ return capabilities.texture_format_dxt1; |
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: |
+ return capabilities.texture_format_dxt5; |
+ case GL_ETC1_RGB8_OES: |
+ return capabilities.texture_format_etc1; |
case GL_R8: |
case GL_RGB: |
case GL_RGBA: |
@@ -5236,7 +5246,7 @@ GLuint GLES2Implementation::CreateImageCHROMIUMHelper(ClientBuffer buffer, |
return 0; |
} |
- if (!ValidImageFormat(internalformat)) { |
+ if (!ValidImageFormat(internalformat, capabilities_)) { |
SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "invalid format"); |
return 0; |
} |
@@ -5298,7 +5308,7 @@ GLuint GLES2Implementation::CreateGpuMemoryBufferImageCHROMIUMHelper( |
return 0; |
} |
- if (!ValidImageFormat(internalformat)) { |
+ if (!ValidImageFormat(internalformat, capabilities_)) { |
SetGLError(GL_INVALID_VALUE, |
"glCreateGpuMemoryBufferImageCHROMIUM", |
"invalid format"); |