[Mesa-dev] [PATCH] mesa/pack: don't apply transfer operations to integer format buffers.

Brian Paul brianp at vmware.com
Mon Sep 12 07:42:04 PDT 2011


On 09/12/2011 07:46 AM, Dave Airlie wrote:
> From: Dave Airlie<airlied at redhat.com>
>
> The EXT_texture_integer issues says:
>
> Should pixel transfer operations be defined for the integer pixel
> path?
>
> RESOLVED: No.  Fragment shaders can achieve similar results
> with more flexibility.  There is no need to aggrandize this
> legacy mechanism.
>
> Signed-off-by: Dave Airlie<airlied at redhat.com>
> ---
>   src/mesa/main/pack.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
> index fd3f89d..98aec2f 100644
> --- a/src/mesa/main/pack.c
> +++ b/src/mesa/main/pack.c
> @@ -506,7 +506,9 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4],
>         luminance = NULL;
>      }
>
> -   if (transferOps) {
> +   /* EXT_texture_integer specifies no transfer ops on integer
> +      types in the resolved issues section */
> +   if (transferOps&&  !intDstFormat) {
>         _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba);
>      }
>

Reviewed-by: Brian Paul <brianp at vmware.com>

Just one nit.  I'd prefer the multi-line comment format used elsewhere:

    /* EXT_texture_integer specifies no transfer ops on integer
     * types in the resolved issues section
     */

Also, a similar check is probably need for the unpack path (used for 
glDrawPixels, glTexImage, etc).

-Brian


More information about the mesa-dev mailing list