diff options
author | Sergii Romantsov <[email protected]> | 2019-02-28 13:35:54 +0200 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2019-03-30 11:50:40 +0000 |
commit | 72a921e12ac1828998d2a32966e1dd0123eabfdf (patch) | |
tree | f97bd96be8515e5118219a21ee3cdb3161f7e7d3 /src/mesa/drivers/dri/i965/brw_meta_util.c | |
parent | e757a2481f7076e98e776e18c1ecda7062ee8504 (diff) |
i965,iris/blorp: do not blit 0-sizes
Seems there is no sense in blitting 0-sized sources
or destinations.
Additionaly it may cause segfaults for i965.
v2: Function call replaced with inline check
v3: Added check to avoid devision by zero (L. Landwerlin)
v4: Added simillar check for Iris (L. Landwerlin)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110239
Signed-off-by: Sergii Romantsov <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_meta_util.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_meta_util.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_meta_util.c b/src/mesa/drivers/dri/i965/brw_meta_util.c index 908b0989769..6a6d68425fa 100644 --- a/src/mesa/drivers/dri/i965/brw_meta_util.c +++ b/src/mesa/drivers/dri/i965/brw_meta_util.c @@ -220,6 +220,10 @@ brw_meta_mirror_clip_and_scissor(const struct gl_context *ctx, * 4 * 2 = 8 > 5 in the src. */ + if (*srcX0 == *srcX1 || *srcY0 == *srcY1 + || *dstX0 == *dstX1 || *dstY0 == *dstY1) + return true; + float scaleX = (float) (*srcX1 - *srcX0) / (*dstX1 - *dstX0); float scaleY = (float) (*srcY1 - *srcY0) / (*dstY1 - *dstY0); @@ -263,7 +267,11 @@ brw_meta_mirror_clip_and_scissor(const struct gl_context *ctx, *mirror_y = !*mirror_y; } - return false; + /* Check for invalid bounds + * Can't blit for 0-dimensions + */ + return *srcX0 == *srcX1 || *srcY0 == *srcY1 + || *dstX0 == *dstX1 || *dstY0 == *dstY1; } /** |