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

Unified Diff: gpu/command_buffer/service/buffer_manager.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/buffer_manager.h ('k') | gpu/command_buffer/service/command_buffer_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/buffer_manager.cc
diff --git a/gpu/command_buffer/service/buffer_manager.cc b/gpu/command_buffer/service/buffer_manager.cc
index 4183359102c254d114e16a348b0eb93be899d60b..a53b93f679d9689c34238c58013543099bca76d6 100644
--- a/gpu/command_buffer/service/buffer_manager.cc
+++ b/gpu/command_buffer/service/buffer_manager.cc
@@ -27,6 +27,9 @@
namespace gpu {
namespace gles2 {
+namespace {
+static const GLsizeiptr kDefaultMaxBufferSize = 1u << 30; // 1GB
+}
BufferManager::BufferManager(MemoryTracker* memory_tracker,
FeatureInfo* feature_info)
@@ -34,6 +37,7 @@ BufferManager::BufferManager(MemoryTracker* memory_tracker,
new MemoryTypeTracker(memory_tracker)),
memory_tracker_(memory_tracker),
feature_info_(feature_info),
+ max_buffer_size_(kDefaultMaxBufferSize),
allow_buffers_on_multiple_targets_(false),
allow_fixed_attribs_(false),
buffer_count_(0),
@@ -395,7 +399,7 @@ void BufferManager::ValidateAndDoBufferData(
return;
}
- if (size > 1024 * 1024 * 1024) {
+ if (size > max_buffer_size_) {
ERRORSTATE_SET_GL_ERROR(error_state, GL_OUT_OF_MEMORY, "glBufferData",
"cannot allocate more than 1GB.");
return;
« no previous file with comments | « gpu/command_buffer/service/buffer_manager.h ('k') | gpu/command_buffer/service/command_buffer_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698