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

Side by Side Diff: gpu/command_buffer/service/buffer_manager.h

Issue 2150803003: Introduce gpu_fuzzer to fuzz the GPU command buffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fuzzer_land_base
Patch Set: Fix check, zero-out padding Created 4 years, 5 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 | « gpu/BUILD.gn ('k') | gpu/command_buffer/service/buffer_manager.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 #ifndef GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 ContextState* context_state, GLenum target, GLenum pname, GLint64* params); 257 ContextState* context_state, GLenum target, GLenum pname, GLint64* params);
258 258
259 // Validates a glGetBufferParameteriv, and then calls GetBufferParameteriv if 259 // Validates a glGetBufferParameteriv, and then calls GetBufferParameteriv if
260 // validation was successful. 260 // validation was successful.
261 void ValidateAndDoGetBufferParameteriv( 261 void ValidateAndDoGetBufferParameteriv(
262 ContextState* context_state, GLenum target, GLenum pname, GLint* params); 262 ContextState* context_state, GLenum target, GLenum pname, GLint* params);
263 263
264 // Sets the target of a buffer. Returns false if the target can not be set. 264 // Sets the target of a buffer. Returns false if the target can not be set.
265 bool SetTarget(Buffer* buffer, GLenum target); 265 bool SetTarget(Buffer* buffer, GLenum target);
266 266
267 void set_max_buffer_size(GLsizeiptr max_buffer_size) {
268 max_buffer_size_ = max_buffer_size;
269 }
270
267 void set_allow_buffers_on_multiple_targets(bool allow) { 271 void set_allow_buffers_on_multiple_targets(bool allow) {
268 allow_buffers_on_multiple_targets_ = allow; 272 allow_buffers_on_multiple_targets_ = allow;
269 } 273 }
270 274
271 void set_allow_fixed_attribs(bool allow) { 275 void set_allow_fixed_attribs(bool allow) {
272 allow_fixed_attribs_ = allow; 276 allow_fixed_attribs_ = allow;
273 } 277 }
274 278
275 size_t mem_represented() const { 279 size_t mem_represented() const {
276 return memory_type_tracker_->GetMemRepresented(); 280 return memory_type_tracker_->GetMemRepresented();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 bool use_shadow); 336 bool use_shadow);
333 337
334 std::unique_ptr<MemoryTypeTracker> memory_type_tracker_; 338 std::unique_ptr<MemoryTypeTracker> memory_type_tracker_;
335 MemoryTracker* memory_tracker_; 339 MemoryTracker* memory_tracker_;
336 scoped_refptr<FeatureInfo> feature_info_; 340 scoped_refptr<FeatureInfo> feature_info_;
337 341
338 // Info for each buffer in the system. 342 // Info for each buffer in the system.
339 typedef base::hash_map<GLuint, scoped_refptr<Buffer> > BufferMap; 343 typedef base::hash_map<GLuint, scoped_refptr<Buffer> > BufferMap;
340 BufferMap buffers_; 344 BufferMap buffers_;
341 345
346 // The maximum size of buffers.
347 GLsizeiptr max_buffer_size_;
348
342 // Whether or not buffers can be bound to multiple targets. 349 // Whether or not buffers can be bound to multiple targets.
343 bool allow_buffers_on_multiple_targets_; 350 bool allow_buffers_on_multiple_targets_;
344 351
345 // Whether or not allow using GL_FIXED type for vertex attribs. 352 // Whether or not allow using GL_FIXED type for vertex attribs.
346 bool allow_fixed_attribs_; 353 bool allow_fixed_attribs_;
347 354
348 // Counts the number of Buffer allocated with 'this' as its manager. 355 // Counts the number of Buffer allocated with 'this' as its manager.
349 // Allows to check no Buffer will outlive this. 356 // Allows to check no Buffer will outlive this.
350 unsigned int buffer_count_; 357 unsigned int buffer_count_;
351 358
352 GLuint primitive_restart_fixed_index_; 359 GLuint primitive_restart_fixed_index_;
353 360
354 bool lost_context_; 361 bool lost_context_;
355 bool use_client_side_arrays_for_stream_buffers_; 362 bool use_client_side_arrays_for_stream_buffers_;
356 363
357 DISALLOW_COPY_AND_ASSIGN(BufferManager); 364 DISALLOW_COPY_AND_ASSIGN(BufferManager);
358 }; 365 };
359 366
360 } // namespace gles2 367 } // namespace gles2
361 } // namespace gpu 368 } // namespace gpu
362 369
363 #endif // GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_ 370 #endif // GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_
OLDNEW
« no previous file with comments | « gpu/BUILD.gn ('k') | gpu/command_buffer/service/buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698