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

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

Issue 2485253005: CopyTexImage2D: don't pick invalid unsized internal formats on ES3 (Closed)
Patch Set: simplify Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1fce44cbb8d7ee858dc1d7faef634d6867c411bb..3cc5890d778af373bba4d6ef7970505c5750ad2b 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -13819,6 +13819,24 @@ void GLES2DecoderImpl::DoCopyTexImage2D(
GLenum format =
TextureManager::ExtractFormatFromStorageFormat(internal_format);
GLenum type = TextureManager::ExtractTypeFromStorageFormat(internal_format);
+ bool internal_format_unsized = internal_format == format;
+ if (internal_format_unsized && feature_info_->IsWebGL2OrES3Context()) {
+ // The picks made by the temporary logic above may not be valid on ES3.
+ DCHECK(type == GL_UNSIGNED_BYTE);
+ switch (internal_format) {
+ case GL_RGB:
+ case GL_RGBA:
+ case GL_LUMINANCE_ALPHA:
+ case GL_LUMINANCE:
+ case GL_ALPHA:
+ case GL_BGRA_EXT:
+ break;
+ default:
+ // Other unsized internal_formats are invalid in ES3.
Ken Russell (switch to Gerrit) 2016/11/10 23:32:30 Is this correct? ES spec 3.0.5, section 3.7, table
Ken Russell (switch to Gerrit) 2016/11/10 23:32:55 Also, please refer to this table in a comment.
Kai Ninomiya 2016/11/10 23:50:00 Done.
+ format = GL_NONE;
+ break;
+ }
+ }
if (!format || !type) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698