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

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

Issue 2826043002: Do not share FBOs/VAOs/Transform feedback objects across contexts (Closed)
Patch Set: fixed unittests failures; zmo@ review comments Created 3 years, 7 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/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 } 562 }
563 void RestoreBufferBinding(unsigned int target) override; 563 void RestoreBufferBinding(unsigned int target) override;
564 void RestoreFramebufferBindings() const override; 564 void RestoreFramebufferBindings() const override;
565 void RestoreRenderbufferBindings() override; 565 void RestoreRenderbufferBindings() override;
566 void RestoreTextureState(unsigned service_id) const override; 566 void RestoreTextureState(unsigned service_id) const override;
567 567
568 void ClearAllAttributes() const override; 568 void ClearAllAttributes() const override;
569 void RestoreAllAttributes() const override; 569 void RestoreAllAttributes() const override;
570 570
571 QueryManager* GetQueryManager() override { return query_manager_.get(); } 571 QueryManager* GetQueryManager() override { return query_manager_.get(); }
572 FramebufferManager* GetFramebufferManager() override {
573 return framebuffer_manager_.get();
574 }
572 TransformFeedbackManager* GetTransformFeedbackManager() override { 575 TransformFeedbackManager* GetTransformFeedbackManager() override {
573 return transform_feedback_manager_.get(); 576 return transform_feedback_manager_.get();
574 } 577 }
575 VertexArrayManager* GetVertexArrayManager() override { 578 VertexArrayManager* GetVertexArrayManager() override {
576 return vertex_array_manager_.get(); 579 return vertex_array_manager_.get();
577 } 580 }
578 ImageManager* GetImageManager() override { return image_manager_.get(); } 581 ImageManager* GetImageManager() override { return image_manager_.get(); }
579 582
580 bool HasPendingQueries() const override; 583 bool HasPendingQueries() const override;
581 void ProcessPendingQueries(bool did_finish) override; 584 void ProcessPendingQueries(bool did_finish) override;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 // TODO(gman): Cache these pointers? 719 // TODO(gman): Cache these pointers?
717 BufferManager* buffer_manager() { 720 BufferManager* buffer_manager() {
718 return group_->buffer_manager(); 721 return group_->buffer_manager();
719 } 722 }
720 723
721 RenderbufferManager* renderbuffer_manager() { 724 RenderbufferManager* renderbuffer_manager() {
722 return group_->renderbuffer_manager(); 725 return group_->renderbuffer_manager();
723 } 726 }
724 727
725 FramebufferManager* framebuffer_manager() { 728 FramebufferManager* framebuffer_manager() {
726 return group_->framebuffer_manager(); 729 return framebuffer_manager_.get();
727 } 730 }
728 731
729 ProgramManager* program_manager() { 732 ProgramManager* program_manager() {
730 return group_->program_manager(); 733 return group_->program_manager();
731 } 734 }
732 735
733 SamplerManager* sampler_manager() { 736 SamplerManager* sampler_manager() {
734 return group_->sampler_manager(); 737 return group_->sampler_manager();
735 } 738 }
736 739
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after
2315 size_t GetCreatedBackTextureCountForTest() override; 2318 size_t GetCreatedBackTextureCountForTest() override;
2316 2319
2317 // The copy that is used as the destination for multi-sample resolves. 2320 // The copy that is used as the destination for multi-sample resolves.
2318 std::unique_ptr<BackFramebuffer> offscreen_resolved_frame_buffer_; 2321 std::unique_ptr<BackFramebuffer> offscreen_resolved_frame_buffer_;
2319 std::unique_ptr<BackTexture> offscreen_resolved_color_texture_; 2322 std::unique_ptr<BackTexture> offscreen_resolved_color_texture_;
2320 GLenum offscreen_saved_color_format_; 2323 GLenum offscreen_saved_color_format_;
2321 2324
2322 // Whether the client requested an offscreen buffer with an alpha channel. 2325 // Whether the client requested an offscreen buffer with an alpha channel.
2323 bool offscreen_buffer_should_have_alpha_; 2326 bool offscreen_buffer_should_have_alpha_;
2324 2327
2328 std::unique_ptr<FramebufferManager> framebuffer_manager_;
2329
2325 std::unique_ptr<QueryManager> query_manager_; 2330 std::unique_ptr<QueryManager> query_manager_;
2326 2331
2327 std::unique_ptr<VertexArrayManager> vertex_array_manager_; 2332 std::unique_ptr<VertexArrayManager> vertex_array_manager_;
2328 2333
2329 std::unique_ptr<ImageManager> image_manager_; 2334 std::unique_ptr<ImageManager> image_manager_;
2330 2335
2331 FenceSyncReleaseCallback fence_sync_release_callback_; 2336 FenceSyncReleaseCallback fence_sync_release_callback_;
2332 WaitSyncTokenCallback wait_sync_token_callback_; 2337 WaitSyncTokenCallback wait_sync_token_callback_;
2333 NoParamCallback deschedule_until_finished_callback_; 2338 NoParamCallback deschedule_until_finished_callback_;
2334 NoParamCallback reschedule_after_finished_callback_; 2339 NoParamCallback reschedule_after_finished_callback_;
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
3243 state_.default_vertex_attrib_manager = 3248 state_.default_vertex_attrib_manager =
3244 CreateVertexAttribManager(0, default_vertex_attrib_service_id, false); 3249 CreateVertexAttribManager(0, default_vertex_attrib_service_id, false);
3245 3250
3246 state_.default_vertex_attrib_manager->Initialize( 3251 state_.default_vertex_attrib_manager->Initialize(
3247 group_->max_vertex_attribs(), 3252 group_->max_vertex_attribs(),
3248 workarounds().init_vertex_attributes); 3253 workarounds().init_vertex_attributes);
3249 3254
3250 // vertex_attrib_manager is set to default_vertex_attrib_manager by this call 3255 // vertex_attrib_manager is set to default_vertex_attrib_manager by this call
3251 DoBindVertexArrayOES(0); 3256 DoBindVertexArrayOES(0);
3252 3257
3258 framebuffer_manager_.reset(new FramebufferManager(
3259 group_->max_draw_buffers(), group_->max_color_attachments(),
3260 group_->framebuffer_completeness_cache()));
3261 group_->texture_manager()->AddFramebufferManager(framebuffer_manager_.get());
3262
3253 query_manager_.reset(new QueryManager(this, feature_info_.get())); 3263 query_manager_.reset(new QueryManager(this, feature_info_.get()));
3254 3264
3255 image_manager_.reset(new ImageManager); 3265 image_manager_.reset(new ImageManager);
3256 3266
3257 util_.set_num_compressed_texture_formats( 3267 util_.set_num_compressed_texture_formats(
3258 validators_->compressed_texture_format.GetValues().size()); 3268 validators_->compressed_texture_format.GetValues().size());
3259 3269
3260 if (!gl_version_info().BehavesLikeGLES()) { 3270 if (!gl_version_info().BehavesLikeGLES()) {
3261 // We have to enable vertex array 0 on GL with compatibility profile or it 3271 // We have to enable vertex array 0 on GL with compatibility profile or it
3262 // won't render. Note that ES or GL with core profile does not have this 3272 // won't render. Note that ES or GL with core profile does not have this
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
4849 // the later deletes the ProgramManager object that referred by 4859 // the later deletes the ProgramManager object that referred by
4850 // state_.current_program object. 4860 // state_.current_program object.
4851 state_.current_program = NULL; 4861 state_.current_program = NULL;
4852 4862
4853 apply_framebuffer_attachment_cmaa_intel_.reset(); 4863 apply_framebuffer_attachment_cmaa_intel_.reset();
4854 copy_tex_image_blit_.reset(); 4864 copy_tex_image_blit_.reset();
4855 copy_texture_CHROMIUM_.reset(); 4865 copy_texture_CHROMIUM_.reset();
4856 srgb_converter_.reset(); 4866 srgb_converter_.reset();
4857 clear_framebuffer_blit_.reset(); 4867 clear_framebuffer_blit_.reset();
4858 4868
4869 if (framebuffer_manager_.get()) {
4870 framebuffer_manager_->Destroy(false);
Chandan 2017/05/17 13:08:08 I think this needs a revisit. Passing false instea
Zhenyao Mo 2017/05/17 18:06:51 I don't think this is the right fix. Instead, you
Chandan 2017/05/18 13:33:36 Done.
4871 if (group_->texture_manager())
4872 group_->texture_manager()->RemoveFramebufferManager(
4873 framebuffer_manager_.get());
4874 framebuffer_manager_.reset();
4875 }
4876
4859 if (query_manager_.get()) { 4877 if (query_manager_.get()) {
4860 query_manager_->Destroy(have_context); 4878 query_manager_->Destroy(have_context);
4861 query_manager_.reset(); 4879 query_manager_.reset();
4862 } 4880 }
4863 4881
4864 if (vertex_array_manager_ .get()) { 4882 if (vertex_array_manager_ .get()) {
4865 vertex_array_manager_->Destroy(have_context); 4883 vertex_array_manager_->Destroy(have_context);
4866 vertex_array_manager_.reset(); 4884 vertex_array_manager_.reset();
4867 } 4885 }
4868 4886
(...skipping 14771 matching lines...) Expand 10 before | Expand all | Expand 10 after
19640 } 19658 }
19641 19659
19642 // Include the auto-generated part of this file. We split this because it means 19660 // Include the auto-generated part of this file. We split this because it means
19643 // we can easily edit the non-auto generated parts right here in this file 19661 // we can easily edit the non-auto generated parts right here in this file
19644 // instead of having to edit some template or the code generator. 19662 // instead of having to edit some template or the code generator.
19645 #include "base/macros.h" 19663 #include "base/macros.h"
19646 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 19664 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
19647 19665
19648 } // namespace gles2 19666 } // namespace gles2
19649 } // namespace gpu 19667 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698