[Mesa-dev] [PATCH 16/40] i965/blorp: Add check for supported sample numbers

Kenneth Graunke kenneth at whitecape.org
Mon Apr 18 07:42:34 UTC 2016


On Saturday, April 16, 2016 4:42:44 PM PDT Topi Pohjolainen wrote:
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_blorp_blit.cpp  | 10 ++++++++++
>  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 abbef8b..073767c 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> @@ -247,6 +247,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;
> @@ -352,6 +357,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 7f8b3c1..9f754e7 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) {

Isn't this backwards?  Should be:

   if (!use_blorp)

>           brw_meta_stencil_updownsample(brw, src->stencil_mt, dst);
>           return;
>        }
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160418/8dd2cb1c/attachment.sig>


More information about the mesa-dev mailing list