OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 13272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13283 glCopyTexImage2D(dest_texture_target, level, final_internal_format, 0, 0, | 13283 glCopyTexImage2D(dest_texture_target, level, final_internal_format, 0, 0, |
13284 copyWidth, copyHeight, 0); | 13284 copyWidth, copyHeight, 0); |
13285 | 13285 |
13286 // Rebind source texture. | 13286 // Rebind source texture. |
13287 glFramebufferTexture2DEXT(framebuffer_target, GL_COLOR_ATTACHMENT0, | 13287 glFramebufferTexture2DEXT(framebuffer_target, GL_COLOR_ATTACHMENT0, |
13288 source_texture_target, | 13288 source_texture_target, |
13289 source_texture_service_id, 0); | 13289 source_texture_service_id, 0); |
13290 | 13290 |
13291 glDeleteTextures(1, &temp_texture); | 13291 glDeleteTextures(1, &temp_texture); |
13292 } else { | 13292 } else { |
13293 if (workarounds().do_texture_image_before_copy_texture_image && | |
13294 target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X) { | |
piman
2016/09/19 20:33:13
Is it /really/ only GL_TEXTURE_CUBE_MAP_NEGATIVE_X
Ken Russell (switch to Gerrit)
2016/09/19 23:15:10
+1 to piman's comments -- also, if a separate work
qiankun
2016/09/20 11:34:16
Yes. They are similar. I used the same workaround
| |
13295 for (int i = 0; i < 6; ++i) { | |
13296 GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + i; | |
13297 glTexImage2D(face, level, final_internal_format, | |
13298 width, height, border, format, type, 0); | |
piman
2016/09/19 20:33:13
What if those were already defined? This would los
Ken Russell (switch to Gerrit)
2016/09/19 23:15:10
+1. Also, have you verified that it's necessary to
qiankun
2016/09/20 11:34:16
Do initialization for uninitialized GL_TEXTURE_CUB
| |
13299 } | |
13300 } | |
13293 glCopyTexImage2D(target, level, final_internal_format, copyX, copyY, | 13301 glCopyTexImage2D(target, level, final_internal_format, copyX, copyY, |
13294 copyWidth, copyHeight, border); | 13302 copyWidth, copyHeight, border); |
13295 } | 13303 } |
13296 } | 13304 } |
13297 GLenum error = LOCAL_PEEK_GL_ERROR(func_name); | 13305 GLenum error = LOCAL_PEEK_GL_ERROR(func_name); |
13298 if (error == GL_NO_ERROR) { | 13306 if (error == GL_NO_ERROR) { |
13299 texture_manager()->SetLevelInfo(texture_ref, target, level, internal_format, | 13307 texture_manager()->SetLevelInfo(texture_ref, target, level, internal_format, |
13300 width, height, 1, border, format, | 13308 width, height, 1, border, format, |
13301 type, gfx::Rect(width, height)); | 13309 type, gfx::Rect(width, height)); |
13302 texture->ApplyFormatWorkarounds(feature_info_.get()); | 13310 texture->ApplyFormatWorkarounds(feature_info_.get()); |
(...skipping 4691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
17994 } | 18002 } |
17995 | 18003 |
17996 // Include the auto-generated part of this file. We split this because it means | 18004 // Include the auto-generated part of this file. We split this because it means |
17997 // we can easily edit the non-auto generated parts right here in this file | 18005 // we can easily edit the non-auto generated parts right here in this file |
17998 // instead of having to edit some template or the code generator. | 18006 // instead of having to edit some template or the code generator. |
17999 #include "base/macros.h" | 18007 #include "base/macros.h" |
18000 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18008 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
18001 | 18009 |
18002 } // namespace gles2 | 18010 } // namespace gles2 |
18003 } // namespace gpu | 18011 } // namespace gpu |
OLD | NEW |