From 1a5ec9624a64c90455c9174143454c592efce89e Mon Sep 17 00:00:00 2001 From: Samuel Iglesias Gonsalvez Date: Fri, 10 Oct 2014 10:38:06 +0200 Subject: [PATCH] mesa/pack: use autogenerated format_pack functions Take advantage of new mesa formats and new format_pack functions to reduce source code in _mesa_pack_rgba_span_from_ints() and _mesa_pack_rgba_span_from_uints(). Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Jason Ekstrand --- src/mesa/main/pack.c | 663 +++++++++---------------------------------- 1 file changed, 138 insertions(+), 525 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 649a74cce6f..067a0f5d459 100644 --- a/src/mesa/main/pack.c +++ b/src/mesa/main/pack.c @@ -55,6 +55,8 @@ #include "glformats.h" #include "../../gallium/auxiliary/util/u_format_rgb9e5.h" #include "../../gallium/auxiliary/util/u_format_r11g11b10f.h" +#include "format_utils.h" +#include "format_pack.h" /** @@ -527,8 +529,6 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][ GLenum dstFormat, GLenum dstType, GLvoid *dstAddr) { - GLuint i; - switch(dstType) { case GL_UNSIGNED_INT: pack_uint_from_uint_rgba(ctx, dstAddr, dstFormat, rgba, n); @@ -549,300 +549,108 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][ pack_byte_from_uint_rgba(ctx, dstAddr, dstFormat, rgba, n); break; case GL_UNSIGNED_BYTE_3_3_2: - if ((dstFormat == GL_RGB) || (dstFormat == GL_RGB_INTEGER)) { - GLubyte *dst = (GLubyte *) dstAddr; - for (i=0;i