Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2760843002: Add readback path for CopyTextureCHROMIUM (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 6fb3faedb45e9143ac7acb69278d480f448bd20b..7b8d03e244c4fbccc718607b161aa362acb39b25 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -16482,8 +16482,6 @@ bool GLES2DecoderImpl::ValidateCopyTextureCHROMIUMInternalFormats(
valid_dest_format = feature_info_->IsWebGL2OrES3Context();
break;
case GL_RGB9_E5:
- valid_dest_format = !gl_version_info().is_es;
- break;
case GL_R16F:
case GL_R32F:
case GL_RG16F:
@@ -16554,6 +16552,32 @@ CopyTextureMethod GLES2DecoderImpl::getCopyTextureCHROMIUMMethod(
Texture::ColorRenderable(GetFeatureInfo(), dest_internal_format, false);
std::string output_error_msg;
+ switch (dest_internal_format) {
+#if defined(OS_MACOSX)
Zhenyao Mo 2017/03/20 17:05:40 Can we hook this up with a driver bug workaround s
qiankun 2017/03/21 08:47:13 I can do this.
qiankun 2017/03/29 09:00:10 I added the workaround for NVIDIA Mac. But it didn
+ // RGB5_A1 is not color-renderable on NVIDIA Mac, see crbug.com/676209.
+ case GL_RGB5_A1:
+ return DRAW_AND_READBACK;
+#endif
+ // RGB9_E5 isn't accepted by glCopyTexImage2D if underlying context is ES.
+ case GL_RGB9_E5:
+ if (gl_version_info().is_es)
+ return DRAW_AND_READBACK;
+ break;
+ // SRGB format has color-space conversion issue, see
+ // https://github.com/KhronosGroup/WebGL/issues/2165.
+ // TODO(qiankun.miao@intel.com): revisit this once the above issue is
+ // resolved.
Zhenyao Mo 2017/03/20 17:05:40 Can we not put them on DRAW_AND_READBACK path for
qiankun 2017/03/21 08:47:13 We cannot detect internalformat in texSubImage2D i
qiankun 2017/03/22 02:52:30 I put SRGB related formats here because current GP
+ case GL_SRGB_EXT:
+ case GL_SRGB_ALPHA_EXT:
+ case GL_SRGB8:
+ case GL_SRGB8_ALPHA8:
+ if (feature_info_->IsWebGLContext())
+ return DRAW_AND_READBACK;
+ break;
+ default:
+ break;
+ }
+
// CopyTexImage* should not allow internalformat of GL_BGRA_EXT and
// GL_BGRA8_EXT. crbug.com/663086.
bool copy_tex_image_format_valid =

Powered by Google App Engine
This is Rietveld 408576698