Commit 6b0124f4 authored by bajones's avatar bajones Committed by Commit bot

GPU workaround to simulate Out of Memory errors with large textures

BUG=445542

Review URL: https://codereview.chromium.org/1050043003

Cr-Commit-Position: refs/heads/master@{#324150}
parent e908733b
......@@ -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};
......
......@@ -100,6 +100,8 @@
scalarize_vec_and_mat_constructor_args) \
GPU_OP(SET_TEXTURE_FILTER_BEFORE_GENERATING_MIPMAP, \
set_texture_filter_before_generating_mipmap) \
GPU_OP(SIMULATE_OUT_OF_MEMORY_ON_LARGE_TEXTURES, \
simulate_out_of_memory_on_large_textures) \
GPU_OP(SWIZZLE_RGBA_FOR_ASYNC_READPIXELS, \
swizzle_rgba_for_async_readpixels) \
GPU_OP(TEXSUBIMAGE2D_FASTER_THAN_TEXIMAGE2D, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment