Chromium Code Reviews| 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, |