Index: gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc |
diff --git a/gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc b/gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc |
index fa3f33e3abfa2a2c018f5b52f53e1ae5ae48086e..b70ab74abe481e9932322abcaca9d112a65dc262 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc |
@@ -15,6 +15,47 @@ |
#define SHADER(Src) #Src |
+namespace { |
+ |
+bool CanUseCopyTextureCHROMIUM(GLenum internal_format) { |
+ switch (internal_format) { |
+ case GL_RGB: |
+ case GL_RGBA: |
+ case GL_RGB8: |
+ case GL_RGBA8: |
+ case GL_BGRA_EXT: |
+ case GL_BGRA8_EXT: |
+ case GL_SRGB_EXT: |
+ case GL_SRGB_ALPHA_EXT: |
+ case GL_R8: |
+ case GL_R8UI: |
+ case GL_RG8: |
+ case GL_RG8UI: |
+ case GL_SRGB8: |
+ case GL_RGB565: |
+ case GL_RGB8UI: |
+ case GL_SRGB8_ALPHA8: |
+ case GL_RGB5_A1: |
+ case GL_RGBA4: |
+ case GL_RGBA8UI: |
+ case GL_RGB9_E5: |
+ case GL_R16F: |
+ case GL_R32F: |
+ case GL_RG16F: |
+ case GL_RG32F: |
+ case GL_RGB16F: |
+ case GL_RGB32F: |
+ case GL_RGBA16F: |
+ case GL_RGBA32F: |
+ case GL_R11F_G11F_B10F: |
+ return true; |
+ default: |
+ return false; |
+ } |
+} |
+ |
+} // namespace |
+ |
namespace gpu { |
namespace gles2 { |
@@ -254,6 +295,12 @@ void ApplyFramebufferAttachmentCMAAINTELResourceManager:: |
// CMAA Effect |
if (do_copy) { |
+ if (!CanUseCopyTextureCHROMIUM(internal_format)) { |
+ DLOG(ERROR) << "Apply CMAA on framebuffer with attachment in " |
qiankun
2017/02/13 08:52:25
I am not sure if the format limitation should be h
Zhenyao Mo
2017/02/13 18:36:17
I think for Chrome to generate an INVALID_OPERATIO
qiankun
2017/02/14 08:08:17
Generete INVALID_OPERATION for such invalid situat
|
+ << GLES2Util::GetStringEnum(internal_format) |
+ << " internalformat."; |
+ return; |
+ } |
ApplyCMAAEffectTexture(source_texture, rgba8_texture_, do_copy); |
// Source format for DoCopySubTexture is always GL_RGBA8. |