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

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

Issue 1498033003: Implement SamplerManager in the command buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unnessecary state initialization Created 5 years 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/context_state.h" 5 #include "gpu/command_buffer/service/context_state.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
10 #include "gpu/command_buffer/service/buffer_manager.h" 10 #include "gpu/command_buffer/service/buffer_manager.h"
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 } 578 }
579 glBindTexture(GL_TEXTURE_2D_ARRAY, 0); 579 glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
580 } 580 }
581 } 581 }
582 582
583 if (active_unit != active_texture_unit) { 583 if (active_unit != active_texture_unit) {
584 glActiveTexture(GL_TEXTURE0 + active_texture_unit); 584 glActiveTexture(GL_TEXTURE0 + active_texture_unit);
585 } 585 }
586 } 586 }
587 587
588 void ContextState::UnbindSampler(Sampler* sampler) {
589 for (size_t jj = 0; jj < sampler_units.size(); ++jj) {
590 if (sampler_units[jj].get() == sampler) {
591 sampler_units[jj] = nullptr;
592 glBindSampler(jj, 0);
593 }
594 }
595 }
596
588 // Include the auto-generated part of this file. We split this because it means 597 // Include the auto-generated part of this file. We split this because it means
589 // we can easily edit the non-auto generated parts right here in this file 598 // we can easily edit the non-auto generated parts right here in this file
590 // instead of having to edit some template or the code generator. 599 // instead of having to edit some template or the code generator.
591 #include "gpu/command_buffer/service/context_state_impl_autogen.h" 600 #include "gpu/command_buffer/service/context_state_impl_autogen.h"
592 601
593 } // namespace gles2 602 } // namespace gles2
594 } // namespace gpu 603 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_state.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698