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 <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 6409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6420 TextureUnit& texture_unit = state_.texture_units[texture_unit_index]; | 6420 TextureUnit& texture_unit = state_.texture_units[texture_unit_index]; |
6421 TextureRef* texture_ref = | 6421 TextureRef* texture_ref = |
6422 texture_unit.GetInfoForSamplerType(uniform_info->type).get(); | 6422 texture_unit.GetInfoForSamplerType(uniform_info->type).get(); |
6423 GLenum textarget = GetBindTargetForSamplerType(uniform_info->type); | 6423 GLenum textarget = GetBindTargetForSamplerType(uniform_info->type); |
6424 if (!texture_ref || !texture_manager()->CanRender(texture_ref)) { | 6424 if (!texture_ref || !texture_manager()->CanRender(texture_ref)) { |
6425 textures_set = true; | 6425 textures_set = true; |
6426 glActiveTexture(GL_TEXTURE0 + texture_unit_index); | 6426 glActiveTexture(GL_TEXTURE0 + texture_unit_index); |
6427 glBindTexture( | 6427 glBindTexture( |
6428 textarget, | 6428 textarget, |
6429 texture_manager()->black_texture_id(uniform_info->type)); | 6429 texture_manager()->black_texture_id(uniform_info->type)); |
6430 LOCAL_RENDER_WARNING( | 6430 if (!texture_ref) { |
6431 std::string("texture bound to texture unit ") + | 6431 LOCAL_RENDER_WARNING( |
6432 base::IntToString(texture_unit_index) + | 6432 std::string("texture bound to texture unit ") + |
no sievers
2015/01/13 20:21:01
Isn't it rather that there is no texture bound to
dshwang
2015/01/14 14:41:55
Done.
| |
6433 " is not renderable. It maybe non-power-of-2 and have" | 6433 base::IntToString(texture_unit_index) + |
6434 " incompatible texture filtering or is not" | 6434 " is not renderable due to not 'texture complete'"); |
6435 " 'texture complete'"); | 6435 } else { |
6436 LOCAL_RENDER_WARNING( | |
6437 std::string("texture bound to texture unit ") + | |
6438 base::IntToString(texture_unit_index) + | |
6439 " is not renderable. It maybe non-power-of-2 and have" | |
6440 " incompatible texture filtering"); | |
no sievers
2015/01/13 20:21:01
and if it's not renderable it could also be becaus
dshwang
2015/01/14 14:41:55
Yes, I think that "not renderable" is same meaning
| |
6441 } | |
6436 continue; | 6442 continue; |
6437 } | 6443 } |
6438 | 6444 |
6439 if (textarget != GL_TEXTURE_CUBE_MAP) { | 6445 if (textarget != GL_TEXTURE_CUBE_MAP) { |
6440 Texture* texture = texture_ref->texture(); | 6446 Texture* texture = texture_ref->texture(); |
6441 gfx::GLImage* image = texture->GetLevelImage(textarget, 0); | 6447 gfx::GLImage* image = texture->GetLevelImage(textarget, 0); |
6442 if (image && !texture->IsAttachedToFramebuffer()) { | 6448 if (image && !texture->IsAttachedToFramebuffer()) { |
6443 ScopedGLErrorSuppressor suppressor( | 6449 ScopedGLErrorSuppressor suppressor( |
6444 "GLES2DecoderImpl::PrepareTexturesForRender", GetErrorState()); | 6450 "GLES2DecoderImpl::PrepareTexturesForRender", GetErrorState()); |
6445 textures_set = true; | 6451 textures_set = true; |
(...skipping 5189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11635 } | 11641 } |
11636 } | 11642 } |
11637 | 11643 |
11638 // Include the auto-generated part of this file. We split this because it means | 11644 // Include the auto-generated part of this file. We split this because it means |
11639 // we can easily edit the non-auto generated parts right here in this file | 11645 // we can easily edit the non-auto generated parts right here in this file |
11640 // instead of having to edit some template or the code generator. | 11646 // instead of having to edit some template or the code generator. |
11641 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11647 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
11642 | 11648 |
11643 } // namespace gles2 | 11649 } // namespace gles2 |
11644 } // namespace gpu | 11650 } // namespace gpu |
OLD | NEW |