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

Side by Side Diff: gpu/command_buffer/service/texture_manager.cc

Issue 1283303002: gpu: FBO must be incomplete if the attached texture is not cube complete. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Depend on https://codereview.chromium.org/1299683002 Created 5 years, 4 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 unified diff | Download patch
OLDNEW
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/texture_manager.h" 5 #include "gpu/command_buffer/service/texture_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 first_face.height == 0 || 435 first_face.height == 0 ||
436 first_face.depth == 0) { 436 first_face.depth == 0) {
437 return TEXTURE_INCOMPLETE; 437 return TEXTURE_INCOMPLETE;
438 } 438 }
439 } 439 }
440 440
441 bool needs_mips = NeedsMips(); 441 bool needs_mips = NeedsMips();
442 if (needs_mips) { 442 if (needs_mips) {
443 if (!texture_2d_complete()) 443 if (!texture_2d_complete())
444 return TEXTURE_INCOMPLETE; 444 return TEXTURE_INCOMPLETE;
445 if (target_ == GL_TEXTURE_CUBE_MAP && !cube_complete())
446 return TEXTURE_INCOMPLETE;
447 } 445 }
448 446
447 if (target_ == GL_TEXTURE_CUBE_MAP && !cube_complete())
448 return TEXTURE_INCOMPLETE;
449
449 bool is_npot_compatible = !needs_mips && 450 bool is_npot_compatible = !needs_mips &&
450 wrap_s_ == GL_CLAMP_TO_EDGE && 451 wrap_s_ == GL_CLAMP_TO_EDGE &&
451 wrap_t_ == GL_CLAMP_TO_EDGE; 452 wrap_t_ == GL_CLAMP_TO_EDGE;
452 453
453 if (!is_npot_compatible) { 454 if (!is_npot_compatible) {
454 if (target_ == GL_TEXTURE_RECTANGLE_ARB) 455 if (target_ == GL_TEXTURE_RECTANGLE_ARB)
455 return TEXTURE_INCOMPLETE; 456 return TEXTURE_INCOMPLETE;
456 else if (npot()) 457 else if (npot())
457 return TEXTURE_COMPLETE_ONLY_IF_NPOT; 458 return TEXTURE_COMPLETE_ONLY_IF_NPOT;
458 } 459 }
(...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after
2121 // The link to the memory tracking |client_id| is given a higher importance 2122 // The link to the memory tracking |client_id| is given a higher importance
2122 // than other refs. 2123 // than other refs.
2123 if (ref == ref->texture()->memory_tracking_ref_) 2124 if (ref == ref->texture()->memory_tracking_ref_)
2124 importance = 2; 2125 importance = 2;
2125 2126
2126 pmd->AddOwnershipEdge(client_guid, service_guid, importance); 2127 pmd->AddOwnershipEdge(client_guid, service_guid, importance);
2127 } 2128 }
2128 2129
2129 } // namespace gles2 2130 } // namespace gles2
2130 } // namespace gpu 2131 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_manager.h ('k') | gpu/command_buffer/tests/gl_cube_map_texture_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698