diff options
author | Topi Pohjolainen <[email protected]> | 2016-04-01 12:01:23 +0300 |
---|---|---|
committer | Topi Pohjolainen <[email protected]> | 2016-04-21 10:20:01 +0300 |
commit | 708453952b5e27af4e29cb0351de9a465459f742 (patch) | |
tree | 3406397502f2c1791c4fdb4f121fbdda1aeed54d | |
parent | 9e4d19372b1d7f6ab12ddab1929a53335d9cce06 (diff) |
i965/blorp: Add check for supported sample numbers
v2 (Ken): Fix the condition on using meta for stencil blits:
use_blorp -> !use_blorp
Signed-off-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 9 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 00087238ab4..7cf809b4066 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -251,6 +251,11 @@ brw_blorp_copytexsubimage(struct brw_context *brw, struct intel_mipmap_tree *src_mt = src_irb->mt; struct intel_mipmap_tree *dst_mt = intel_image->mt; + /* There is support only for four and eight samples. */ + if (src_mt->num_samples == 2 || dst_mt->num_samples == 2 || + src_mt->num_samples > 8 || dst_mt->num_samples > 8) + return false; + /* BLORP is only supported for Gen6-7. */ if (brw->gen < 6 || brw->gen > 7) return false; @@ -357,6 +362,11 @@ brw_blorp_framebuffer(struct brw_context *brw, if (brw->gen < 6 || brw->gen >= 8) return mask; + /* There is support only for four and eight samples. */ + if (readFb->Visual.samples == 2 || drawFb->Visual.samples == 2 || + readFb->Visual.samples > 8 || drawFb->Visual.samples > 8) + return mask; + static GLbitfield buffer_bits[] = { GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index f60e1c368f5..e2d897a0b37 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -2164,7 +2164,12 @@ intel_miptree_updownsample(struct brw_context *brw, struct intel_mipmap_tree *src, struct intel_mipmap_tree *dst) { - if (brw->gen < 8) { + /* There is support only for four and eight samples. */ + const bool use_blorp = brw->gen < 8 && + src->num_samples != 2 && dst->num_samples != 2 && + src->num_samples <= 8 && dst->num_samples <= 8; + + if (use_blorp) { brw_blorp_blit_miptrees(brw, src, 0 /* level */, 0 /* layer */, src->format, SWIZZLE_XYZW, @@ -2182,7 +2187,7 @@ intel_miptree_updownsample(struct brw_context *brw, } if (src->stencil_mt) { - if (brw->gen >= 8) { + if (!use_blorp) { brw_meta_stencil_updownsample(brw, src->stencil_mt, dst); return; } |