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("there is no texture bound to the unit ") + |
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 } else { |
6435 " 'texture complete'"); | 6435 LOCAL_RENDER_WARNING( |
| 6436 std::string("texture bound to texture unit ") + |
| 6437 base::IntToString(texture_unit_index) + |
| 6438 " is not renderable. It maybe non-power-of-2 and have" |
| 6439 " incompatible texture filtering."); |
| 6440 } |
6436 continue; | 6441 continue; |
6437 } | 6442 } |
6438 | 6443 |
6439 if (textarget != GL_TEXTURE_CUBE_MAP) { | 6444 if (textarget != GL_TEXTURE_CUBE_MAP) { |
6440 Texture* texture = texture_ref->texture(); | 6445 Texture* texture = texture_ref->texture(); |
6441 gfx::GLImage* image = texture->GetLevelImage(textarget, 0); | 6446 gfx::GLImage* image = texture->GetLevelImage(textarget, 0); |
6442 if (image && !texture->IsAttachedToFramebuffer()) { | 6447 if (image && !texture->IsAttachedToFramebuffer()) { |
6443 ScopedGLErrorSuppressor suppressor( | 6448 ScopedGLErrorSuppressor suppressor( |
6444 "GLES2DecoderImpl::PrepareTexturesForRender", GetErrorState()); | 6449 "GLES2DecoderImpl::PrepareTexturesForRender", GetErrorState()); |
6445 textures_set = true; | 6450 textures_set = true; |
(...skipping 5189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11635 } | 11640 } |
11636 } | 11641 } |
11637 | 11642 |
11638 // Include the auto-generated part of this file. We split this because it means | 11643 // 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 | 11644 // 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. | 11645 // instead of having to edit some template or the code generator. |
11641 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11646 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
11642 | 11647 |
11643 } // namespace gles2 | 11648 } // namespace gles2 |
11644 } // namespace gpu | 11649 } // namespace gpu |
OLD | NEW |