diff options
author | Topi Pohjolainen <[email protected]> | 2017-07-21 11:17:57 +0300 |
---|---|---|
committer | Topi Pohjolainen <[email protected]> | 2017-07-22 00:14:16 +0300 |
commit | f8894fab0294817481b30e3cc40f6b3ccfe9314d (patch) | |
tree | 76e01cfa53baa492f8f62b7264d380fabb81e958 /src | |
parent | 4aea4d6d64de81b2c00784aa69ca900fdbec3690 (diff) |
i965/miptree: Check tex image allocation failures
allowing graceful failure instead of crash on assert later on.
This can be hit, for example, on SNB when trying to allocate
8kx8k CUBE_MAP against isl: x-tiled buffer size becomes
2421161984 exceeding the maximum of 1 << 31 == 2147483648.
Another way to hit this on SNB is with multisampling of over
64-bit formats.
Reviewed-by: Jason Ekstrand <[email protected]>
Signed-off-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_tex.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_tex.c b/src/mesa/drivers/dri/i965/intel_tex.c index 82e25fc5ea1..7ce2ceb9a2f 100644 --- a/src/mesa/drivers/dri/i965/intel_tex.c +++ b/src/mesa/drivers/dri/i965/intel_tex.c @@ -95,6 +95,8 @@ intel_alloc_texture_image_buffer(struct gl_context *ctx, intel_image->mt = intel_miptree_create_for_teximage(brw, intel_texobj, intel_image, 1 /* samples */); + if (!intel_image->mt) + return false; /* Even if the object currently has a mipmap tree associated * with it, this one is a more likely candidate to represent the |