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

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

Issue 2410343002: [Reland] Add gl tests to make sure when a buffer is unmapped, all access path generates an INVALID_… (Closed)
Patch Set: Skip the test if context creation fails. Created 4 years, 2 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/program_manager.h" 5 #include "gpu/command_buffer/service/program_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 : manager_(manager), 332 : manager_(manager),
333 use_count_(0), 333 use_count_(0),
334 max_attrib_name_length_(0), 334 max_attrib_name_length_(0),
335 max_uniform_name_length_(0), 335 max_uniform_name_length_(0),
336 service_id_(service_id), 336 service_id_(service_id),
337 deleted_(false), 337 deleted_(false),
338 valid_(false), 338 valid_(false),
339 link_status_(false), 339 link_status_(false),
340 uniforms_cleared_(false), 340 uniforms_cleared_(false),
341 transform_feedback_buffer_mode_(GL_NONE), 341 transform_feedback_buffer_mode_(GL_NONE),
342 effective_transform_feedback_buffer_mode_(GL_NONE),
342 fragment_output_type_mask_(0u), 343 fragment_output_type_mask_(0u),
343 fragment_output_written_mask_(0u) { 344 fragment_output_written_mask_(0u) {
344 DCHECK(manager_); 345 DCHECK(manager_);
345 manager_->StartTracking(this); 346 manager_->StartTracking(this);
346 uint32_t packed_size = (manager_->max_vertex_attribs() + 15) / 16; 347 uint32_t packed_size = (manager_->max_vertex_attribs() + 15) / 16;
347 vertex_input_base_type_mask_.resize(packed_size); 348 vertex_input_base_type_mask_.resize(packed_size);
348 vertex_input_active_mask_.resize(packed_size); 349 vertex_input_active_mask_.resize(packed_size);
349 ClearVertexInputMasks(); 350 ClearVertexInputMasks();
350 } 351 }
351 352
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 << ", name = " << info.name; 688 << ", name = " << info.name;
688 } 689 }
689 } 690 }
690 691
691 UpdateFragmentInputs(); 692 UpdateFragmentInputs();
692 UpdateProgramOutputs(); 693 UpdateProgramOutputs();
693 UpdateFragmentOutputBaseTypes(); 694 UpdateFragmentOutputBaseTypes();
694 UpdateVertexInputBaseTypes(); 695 UpdateVertexInputBaseTypes();
695 UpdateUniformBlockSizeInfo(); 696 UpdateUniformBlockSizeInfo();
696 697
698 effective_transform_feedback_buffer_mode_ = transform_feedback_buffer_mode_;
699 effective_transform_feedback_varyings_ = transform_feedback_varyings_;
700
697 valid_ = true; 701 valid_ = true;
698 } 702 }
699 703
700 void Program::UpdateUniforms() { 704 void Program::UpdateUniforms() {
701 // Reserve each client-bound uniform location. This way unbound uniforms will 705 // Reserve each client-bound uniform location. This way unbound uniforms will
702 // not be allocated to locations that user expects bound uniforms to be, even 706 // not be allocated to locations that user expects bound uniforms to be, even
703 // if the expected uniforms are optimized away by the driver. 707 // if the expected uniforms are optimized away by the driver.
704 for (const auto& binding : bind_uniform_location_map_) { 708 for (const auto& binding : bind_uniform_location_map_) {
705 if (binding.second < 0) 709 if (binding.second < 0)
706 continue; 710 continue;
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 if (link) { 1323 if (link) {
1320 // ANGLE updates the translated shader sources on link. 1324 // ANGLE updates the translated shader sources on link.
1321 for (auto shader : attached_shaders_) { 1325 for (auto shader : attached_shaders_) {
1322 shader->RefreshTranslatedShaderSource(); 1326 shader->RefreshTranslatedShaderSource();
1323 } 1327 }
1324 if (cache) { 1328 if (cache) {
1325 cache->SaveLinkedProgram(service_id(), 1329 cache->SaveLinkedProgram(service_id(),
1326 attached_shaders_[0].get(), 1330 attached_shaders_[0].get(),
1327 attached_shaders_[1].get(), 1331 attached_shaders_[1].get(),
1328 &bind_attrib_location_map_, 1332 &bind_attrib_location_map_,
1329 transform_feedback_varyings_, 1333 effective_transform_feedback_varyings_,
1330 transform_feedback_buffer_mode_, 1334 effective_transform_feedback_buffer_mode_,
1331 shader_callback); 1335 shader_callback);
1332 } 1336 }
1333 UMA_HISTOGRAM_CUSTOM_COUNTS( 1337 UMA_HISTOGRAM_CUSTOM_COUNTS(
1334 "GPU.ProgramCache.BinaryCacheMissTime", 1338 "GPU.ProgramCache.BinaryCacheMissTime",
1335 static_cast<base::HistogramBase::Sample>( 1339 static_cast<base::HistogramBase::Sample>(
1336 (TimeTicks::Now() - before_time).InMicroseconds()), 1340 (TimeTicks::Now() - before_time).InMicroseconds()),
1337 1, 1341 1,
1338 static_cast<base::HistogramBase::Sample>( 1342 static_cast<base::HistogramBase::Sample>(
1339 TimeDelta::FromSeconds(10).InMicroseconds()), 1343 TimeDelta::FromSeconds(10).InMicroseconds()),
1340 50); 1344 50);
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after
2584 DCHECK(program); 2588 DCHECK(program);
2585 program->ClearUniforms(&zero_); 2589 program->ClearUniforms(&zero_);
2586 } 2590 }
2587 2591
2588 int32_t ProgramManager::MakeFakeLocation(int32_t index, int32_t element) { 2592 int32_t ProgramManager::MakeFakeLocation(int32_t index, int32_t element) {
2589 return index + element * 0x10000; 2593 return index + element * 0x10000;
2590 } 2594 }
2591 2595
2592 } // namespace gles2 2596 } // namespace gles2
2593 } // namespace gpu 2597 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/program_manager.h ('k') | gpu/command_buffer/service/program_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698