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

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

Issue 1050043003: GPU workaround to simulate Out of Memory errors with large textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed logic to OOM on texture width * height >= 4096 * 4096 Created 5 years, 8 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 | « no previous file | gpu/config/gpu_driver_bug_workaround_type.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 388ebdbb8e22766a031cbbfdcdef552a6db9c7b4..754f73579f1a99f86978bbc590834c1d4dd267c6 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -9072,6 +9072,15 @@ error::Error GLES2DecoderImpl::HandleTexImage2D(uint32 immediate_data_size,
}
}
+ // For testing only. Allows us to stress the ability to respond to OOM errors.
+ if (workarounds().simulate_out_of_memory_on_large_textures &&
+ (width * height >= 4096 * 4096)) {
+ LOCAL_SET_GL_ERROR(
+ GL_OUT_OF_MEMORY,
+ "glTexImage2D", "synthetic out of memory");
+ return error::kNoError;
+ }
+
TextureManager::DoTextImage2DArguments args = {
target, level, internal_format, width, height, border, format, type,
pixels, pixels_size};
« no previous file with comments | « no previous file | gpu/config/gpu_driver_bug_workaround_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698