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

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

Issue 1299683002: gpu: If not cube complete, the texture isn't renderable, no matter mipmap complete. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check cube complete correctly 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/texture_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 first_face.height == 0 || 436 first_face.height == 0 ||
437 first_face.depth == 0) { 437 first_face.depth == 0) {
438 return CAN_RENDER_NEVER; 438 return CAN_RENDER_NEVER;
439 } 439 }
440 } 440 }
441 441
442 bool needs_mips = NeedsMips(); 442 bool needs_mips = NeedsMips();
443 if (needs_mips) { 443 if (needs_mips) {
444 if (!texture_complete()) 444 if (!texture_complete())
445 return CAN_RENDER_NEVER; 445 return CAN_RENDER_NEVER;
446 if (target_ == GL_TEXTURE_CUBE_MAP && !cube_complete())
447 return CAN_RENDER_NEVER;
448 } 446 }
449 447
448 if (target_ == GL_TEXTURE_CUBE_MAP && !cube_complete())
449 return CAN_RENDER_NEVER;
dshwang 2015/08/18 07:18:16 I change the CL's goal. Texture::GetCanRenderCondi
450
450 bool is_npot_compatible = !needs_mips && 451 bool is_npot_compatible = !needs_mips &&
451 wrap_s_ == GL_CLAMP_TO_EDGE && 452 wrap_s_ == GL_CLAMP_TO_EDGE &&
452 wrap_t_ == GL_CLAMP_TO_EDGE; 453 wrap_t_ == GL_CLAMP_TO_EDGE;
453 454
454 if (!is_npot_compatible) { 455 if (!is_npot_compatible) {
455 if (target_ == GL_TEXTURE_RECTANGLE_ARB) 456 if (target_ == GL_TEXTURE_RECTANGLE_ARB)
456 return CAN_RENDER_NEVER; 457 return CAN_RENDER_NEVER;
457 else if (npot()) 458 else if (npot())
458 return CAN_RENDER_ONLY_IF_NPOT; 459 return CAN_RENDER_ONLY_IF_NPOT;
459 } 460 }
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 // The link to the memory tracking |client_id| is given a higher importance 2100 // The link to the memory tracking |client_id| is given a higher importance
2100 // than other refs. 2101 // than other refs.
2101 if (ref == ref->texture()->memory_tracking_ref_) 2102 if (ref == ref->texture()->memory_tracking_ref_)
2102 importance = 2; 2103 importance = 2;
2103 2104
2104 pmd->AddOwnershipEdge(client_guid, service_guid, importance); 2105 pmd->AddOwnershipEdge(client_guid, service_guid, importance);
2105 } 2106 }
2106 2107
2107 } // namespace gles2 2108 } // namespace gles2
2108 } // namespace gpu 2109 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/texture_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698