Chad Versace <[email protected]> writes:

> These functions do an up or downsample between mt and mt->singlesample_mt.


> +static void
> +intel_miptree_updownsample(struct intel_context *intel,
> +                           struct intel_mipmap_tree *mt,
> +                           enum intel_updownsample direction)
> +{
> +   struct intel_mipmap_tree *src;
> +   struct intel_mipmap_tree *dst;
> +
> +   /* Only flat, renderbuffer-like miptrees are supported. */
> +   assert(mt->target == GL_TEXTURE_2D);
> +   assert(mt->first_level == 0);
> +   assert(mt->last_level == 0);
> +
> +   switch (direction) {
> +   case INTEL_DOWNSAMPLE: {
> +      if (!mt->need_downsample)
> +         return;
> +      src = mt;
> +      dst = mt->singlesample_mt;
> +      break;
> +   }
> +   case INTEL_UPSAMPLE: {
> +      assert(!mt->need_downsample);
> +      src = mt->singlesample_mt;
> +      dst = mt;
> +      break;
> +   }

Also, I think the direction-dependent code should be moved into the two
callers.

Attachment: pgpJMY1CTzv6u.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to