[Mesa-dev] [PATCH 05/16] i965: Add functions up/downsampling on miptrees (v2)
Eric Anholt
eric at anholt.net
Mon Aug 6 11:38:16 PDT 2012
Chad Versace <chad.versace at linux.intel.com> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120806/a220438b/attachment.pgp>
More information about the mesa-dev
mailing list