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

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

Issue 1007523002: Update ES3 enums for texture parameters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Two CLs combined Created 5 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 3e568e3c5ed7e3ce11285591512433a31326867b..bb3038ee63178ef24fcee4e7b9068a71fd5bd1eb 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -9105,6 +9105,16 @@ void GLES2DecoderImpl::DoCopyTexImage2D(
GLsizei height,
GLint border) {
DCHECK(!ShouldDeferReads());
+ uint32 channels_needed = GLES2Util::GetChannelsForFormat(internal_format);
+ // We need to reject DEPTH or STENCIL internal formats here because it shares
+ // the same validator as TexImage*D's internal format, where such formats are
+ // supported.
+ if ((channels_needed & (GLES2Util::kDepth | GLES2Util::kStencil)) != 0) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_ENUM,
+ "glCopyImage2D", "invalid internal format");
+ return;
+ }
TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
&state_, target);
if (!texture_ref) {
@@ -9134,7 +9144,6 @@ void GLES2DecoderImpl::DoCopyTexImage2D(
// Check we have compatible formats.
GLenum read_format = GetBoundReadFrameBufferInternalFormat();
uint32 channels_exist = GLES2Util::GetChannelsForFormat(read_format);
- uint32 channels_needed = GLES2Util::GetChannelsForFormat(internal_format);
if ((channels_needed & channels_exist) != channels_needed) {
LOCAL_SET_GL_ERROR(
@@ -9142,13 +9151,6 @@ void GLES2DecoderImpl::DoCopyTexImage2D(
return;
}
- if ((channels_needed & (GLES2Util::kDepth | GLES2Util::kStencil)) != 0) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION,
- "glCopyTexImage2D", "can not be used with depth or stencil textures");
- return;
- }
-
uint32 estimated_size = 0;
if (!GLES2Util::ComputeImageDataSizes(
width, height, 1, internal_format, GL_UNSIGNED_BYTE,

Powered by Google App Engine
This is Rietveld 408576698