[Mesa-dev] [PATCH] gallium: add initial pure integer support

Dave Airlie airlied at gmail.com
Sun Sep 25 11:09:45 PDT 2011


From: Dave Airlie <airlied at redhat.com>

This add support for unsigned/signed integer types via adding a 'pure' bit
in the format description table. It adds 4 new u_format get/put hooks,
for get/put uint and get/put sint so that accessors can get native access
to the integer bits. This is used to avoid precision loss via float converting
paths.

It doesn't add any float fetchers for these types at the moment, GL doesn't
require float fetching from these types and I expect we'll introduce a lot
of hidden bugs if we start allowing such conversions without an API mandating
it.

0 regressions on llvmpipe here with this.

(there is some more follow on code in my gallium-int-work branch, bringing
 softpipe and mesa to a pretty integer clean state)

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/gallium/auxiliary/util/u_format.c        |   84 ++++++++++++++++
 src/gallium/auxiliary/util/u_format.csv      |    8 ++
 src/gallium/auxiliary/util/u_format.h        |   60 +++++++++++-
 src/gallium/auxiliary/util/u_format_pack.py  |   58 +++++++++--
 src/gallium/auxiliary/util/u_format_parse.py |   18 +++-
 src/gallium/auxiliary/util/u_format_table.py |   23 ++++-
 src/gallium/auxiliary/util/u_tile.c          |  138 ++++++++++++++++++++++++++
 src/gallium/auxiliary/util/u_tile.h          |   39 +++++++
 src/gallium/drivers/llvmpipe/lp_tile_soa.py  |    2 +-
 src/gallium/include/pipe/p_format.h          |    6 +
 10 files changed, 416 insertions(+), 20 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_format.c b/src/gallium/auxiliary/util/u_format.c
index 9bf4258..de80060 100644
--- a/src/gallium/auxiliary/util/u_format.c
+++ b/src/gallium/auxiliary/util/u_format.c
@@ -262,6 +262,90 @@ util_format_write_4ub(enum pipe_format format, const uint8_t *src, unsigned src_
    format_desc->pack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, w, h);
 }
 
+void
+util_format_read_4ui(enum pipe_format format,
+                     unsigned *dst, unsigned dst_stride,
+                     const void *src, unsigned src_stride,
+                     unsigned x, unsigned y, unsigned w, unsigned h)
+{
+   const struct util_format_description *format_desc;
+   const uint8_t *src_row;
+   unsigned *dst_row;
+
+   format_desc = util_format_description(format);
+
+   assert(x % format_desc->block.width == 0);
+   assert(y % format_desc->block.height == 0);
+
+   src_row = (const uint8_t *)src + y*src_stride + x*(format_desc->block.bits/8);
+   dst_row = dst;
+
+   format_desc->unpack_rgba_uint(dst_row, dst_stride, src_row, src_stride, w, h);
+}
+
+void
+util_format_write_4ui(enum pipe_format format,
+                      const unsigned int *src, unsigned src_stride,
+                      void *dst, unsigned dst_stride,
+                      unsigned x, unsigned y, unsigned w, unsigned h)
+{
+   const struct util_format_description *format_desc;
+   uint8_t *dst_row;
+   const unsigned *src_row;
+
+   format_desc = util_format_description(format);
+
+   assert(x % format_desc->block.width == 0);
+   assert(y % format_desc->block.height == 0);
+
+   dst_row = (uint8_t *)dst + y*dst_stride + x*(format_desc->block.bits/8);
+   src_row = src;
+
+   format_desc->pack_rgba_uint(dst_row, dst_stride, src_row, src_stride, w, h);
+}
+
+void
+util_format_read_4i(enum pipe_format format,
+                    int *dst, unsigned dst_stride,
+                    const void *src, unsigned src_stride,
+                    unsigned x, unsigned y, unsigned w, unsigned h)
+{
+   const struct util_format_description *format_desc;
+   const uint8_t *src_row;
+   int *dst_row;
+
+   format_desc = util_format_description(format);
+
+   assert(x % format_desc->block.width == 0);
+   assert(y % format_desc->block.height == 0);
+
+   src_row = (const uint8_t *)src + y*src_stride + x*(format_desc->block.bits/8);
+   dst_row = dst;
+
+   format_desc->unpack_rgba_sint(dst_row, dst_stride, src_row, src_stride, w, h);
+}
+
+
+void
+util_format_write_4i(enum pipe_format format,
+                      const int *src, unsigned src_stride,
+                      void *dst, unsigned dst_stride,
+                      unsigned x, unsigned y, unsigned w, unsigned h)
+{
+   const struct util_format_description *format_desc;
+   uint8_t *dst_row;
+   const int *src_row;
+
+   format_desc = util_format_description(format);
+
+   assert(x % format_desc->block.width == 0);
+   assert(y % format_desc->block.height == 0);
+
+   dst_row = (uint8_t *)dst + y*dst_stride + x*(format_desc->block.bits/8);
+   src_row = src;
+
+   format_desc->pack_rgba_sint(dst_row, dst_stride, src_row, src_stride, w, h);
+}
 
 boolean
 util_is_format_compatible(const struct util_format_description *src_desc,
diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv
index 621a46d..50daa40 100644
--- a/src/gallium/auxiliary/util/u_format.csv
+++ b/src/gallium/auxiliary/util/u_format.csv
@@ -42,6 +42,7 @@
 #     - 'h': fixed
 #     - 'f': FLOAT
 #   - optionally followed by 'n' if it is normalized
+#   - optionally followed by 'p' if it is pure
 #   - number of bits
 # - channel swizzle 
 # - color space: rgb, yub, sz
@@ -278,3 +279,10 @@ PIPE_FORMAT_R10G10B10A2_SNORM       , plain, 1, 1, sn10, sn10, sn10, sn2, xyzw,
 PIPE_FORMAT_B10G10R10A2_USCALED     , plain, 1, 1, u10, u10, u10, u2, zyxw, rgb
 PIPE_FORMAT_B10G10R10A2_SSCALED     , plain, 1, 1, s10, s10, s10, s2, zyxw, rgb
 PIPE_FORMAT_B10G10R10A2_SNORM       , plain, 1, 1, sn10, sn10, sn10, sn2, zyxw, rgb
+
+PIPE_FORMAT_R8G8B8A8_UINT        , plain, 1, 1, up8, up8, up8, up8, xyzw, rgb
+PIPE_FORMAT_R8G8B8A8_SINT        , plain, 1, 1, sp8, sp8, sp8, sp8, xyzw, rgb
+PIPE_FORMAT_R16G16B16A16_UINT    , plain, 1, 1, up16, up16, up16, up16, xyzw, rgb
+PIPE_FORMAT_R16G16B16A16_SINT    , plain, 1, 1, sp16, sp16, sp16, sp16, xyzw, rgb
+PIPE_FORMAT_R32G32B32A32_UINT    , plain, 1, 1, up32, up32, up32, up32, xyzw, rgb
+PIPE_FORMAT_R32G32B32A32_SINT    , plain, 1, 1, sp32, sp32, sp32, sp32, xyzw, rgb
diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h
index 98528ea..483a799 100644
--- a/src/gallium/auxiliary/util/u_format.h
+++ b/src/gallium/auxiliary/util/u_format.h
@@ -120,8 +120,9 @@ enum util_format_colorspace {
 
 struct util_format_channel_description
 {
-   unsigned type:6;        /**< UTIL_FORMAT_TYPE_x */
+   unsigned type:5;        /**< UTIL_FORMAT_TYPE_x */
    unsigned normalized:1;
+   unsigned pure_integer:1;
    unsigned size:9;        /**< bits per channel */
 };
 
@@ -321,6 +322,37 @@ struct util_format_description
                       const uint8_t *src, unsigned src_stride,
                       unsigned width, unsigned height);
 
+  /**
+    * Unpack pixel blocks to R32G32B32A32_UINT.
+    * Note: strides are in bytes.
+    *
+    * Only defined for UINT formats
+    */
+   void
+   (*unpack_rgba_uint)(unsigned *dst, unsigned dst_stride,
+                       const uint8_t *src, unsigned src_stride,
+                       unsigned width, unsigned height);
+
+   void
+   (*pack_rgba_uint)(uint8_t *dst, unsigned dst_stride,
+                     const unsigned *src, unsigned src_stride,
+                     unsigned width, unsigned height);
+
+  /**
+    * Unpack pixel blocks to R32G32B32A32_SINT.
+    * Note: strides are in bytes.
+    *
+    * Only defined for SINT formats
+    */
+   void
+   (*unpack_rgba_sint)(signed *dst, unsigned dst_stride,
+                       const uint8_t *src, unsigned src_stride,
+                       unsigned width, unsigned height);
+
+   void
+   (*pack_rgba_sint)(uint8_t *dst, unsigned dst_stride,
+                     const int *src, unsigned src_stride,
+                     unsigned width, unsigned height);
 };
 
 
@@ -834,6 +866,32 @@ util_format_write_4ub(enum pipe_format format,
                       void *dst, unsigned dst_stride, 
                       unsigned x, unsigned y, unsigned w, unsigned h);
 
+
+void
+util_format_read_4ui(enum pipe_format format,
+                     unsigned *dst, unsigned dst_stride,
+                     const void *src, unsigned src_stride,
+                     unsigned x, unsigned y, unsigned w, unsigned h);
+
+void
+util_format_write_4ui(enum pipe_format format,
+                      const unsigned int *src, unsigned src_stride,
+                      void *dst, unsigned dst_stride,
+                      unsigned x, unsigned y, unsigned w, unsigned h);
+
+void
+util_format_read_4i(enum pipe_format format,
+                    int *dst, unsigned dst_stride,
+                    const void *src, unsigned src_stride,
+                    unsigned x, unsigned y, unsigned w, unsigned h);
+
+
+void
+util_format_write_4i(enum pipe_format format,
+                     const int *src, unsigned src_stride,
+                     void *dst, unsigned dst_stride,
+                     unsigned x, unsigned y, unsigned w, unsigned h);
+
 /*
  * Generic format conversion;
  */
diff --git a/src/gallium/auxiliary/util/u_format_pack.py b/src/gallium/auxiliary/util/u_format_pack.py
index cc173f8..ac46ce2 100644
--- a/src/gallium/auxiliary/util/u_format_pack.py
+++ b/src/gallium/auxiliary/util/u_format_pack.py
@@ -126,6 +126,26 @@ def is_format_supported(format):
 
     return True
 
+def is_format_pure_unsigned(format):
+    for i in range(4):
+        channel = format.channels[i]
+        if channel.type not in (VOID, UNSIGNED):
+            return False
+        if channel.type == UNSIGNED and channel.pure == False:
+            return False
+
+    return True
+
+
+def is_format_pure_signed(format):
+    for i in range(4):
+        channel = format.channels[i]
+        if channel.type not in (VOID, SIGNED):
+            return False
+        if channel.type == SIGNED and channel.pure == False:
+            return False
+
+    return True
 
 def native_type(format):
     '''Get the native appropriate for a format.'''
@@ -290,6 +310,7 @@ def conversion_expr(src_channel,
     src_type = src_channel.type
     src_size = src_channel.size
     src_norm = src_channel.norm
+    src_pure = src_channel.pure
 
     # Promote half to float
     if src_type == FLOAT and src_size == 16:
@@ -653,18 +674,33 @@ def generate(formats):
             if is_format_supported(format):
                 generate_format_type(format)
 
-            channel = Channel(FLOAT, False, 32)
-            native_type = 'float'
-            suffix = 'rgba_float'
+            if is_format_pure_unsigned(format):
+                native_type = 'unsigned'
+                suffix = 'unsigned'
+                channel = Channel(UNSIGNED, False, True, 32)
+
+                generate_format_unpack(format, channel, native_type, suffix)
+                generate_format_pack(format, channel, native_type, suffix)
+            elif is_format_pure_signed(format):
+                native_type = 'int'
+                suffix = 'signed'
+                channel = Channel(SIGNED, False, True, 32)
+
+                generate_format_unpack(format, channel, native_type, suffix)
+                generate_format_pack(format, channel, native_type, suffix)   
+            else:
+                channel = Channel(FLOAT, False, False, 32)
+                native_type = 'float'
+                suffix = 'rgba_float'
 
-            generate_format_unpack(format, channel, native_type, suffix)
-            generate_format_pack(format, channel, native_type, suffix)
-            generate_format_fetch(format, channel, native_type, suffix)
+                generate_format_unpack(format, channel, native_type, suffix)
+                generate_format_pack(format, channel, native_type, suffix)
+                generate_format_fetch(format, channel, native_type, suffix)
 
-            channel = Channel(UNSIGNED, True, 8)
-            native_type = 'uint8_t'
-            suffix = 'rgba_8unorm'
+                channel = Channel(UNSIGNED, True, False, 8)
+                native_type = 'uint8_t'
+                suffix = 'rgba_8unorm'
 
-            generate_format_unpack(format, channel, native_type, suffix)
-            generate_format_pack(format, channel, native_type, suffix)
+                generate_format_unpack(format, channel, native_type, suffix)
+                generate_format_pack(format, channel, native_type, suffix)
 
diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py
index ddb9f24..73a4bcb 100755
--- a/src/gallium/auxiliary/util/u_format_parse.py
+++ b/src/gallium/auxiliary/util/u_format_parse.py
@@ -52,9 +52,10 @@ VERY_LARGE = 99999999999999999999999
 class Channel:
     '''Describe the channel of a color channel.'''
     
-    def __init__(self, type, norm, size, name = ''):
+    def __init__(self, type, norm, pure, size, name = ''):
         self.type = type
         self.norm = norm
+        self.pure = pure
         self.size = size
         self.sign = type in (SIGNED, FIXED, FLOAT)
         self.name = name
@@ -63,11 +64,13 @@ class Channel:
         s = str(self.type)
         if self.norm:
             s += 'n'
+        if self.pure:
+            s += 'p'
         s += str(self.size)
         return s
 
     def __eq__(self, other):
-        return self.type == other.type and self.norm == other.norm and self.size == other.size
+        return self.type == other.type and self.norm == other.norm and self.pure == other.pure and self.size == other.size
 
     def max(self):
         '''Maximum representable number.'''
@@ -158,6 +161,8 @@ class Format:
                     return True
                 if channel.norm != ref_channel.norm:
                     return True
+                if channel.pure != ref_channel.pure:
+                    return True
         return False
 
     def is_pot(self):
@@ -274,15 +279,22 @@ def parse(filename):
                 type = _type_parse_map[field[0]]
                 if field[1] == 'n':
                     norm = True
+                    pure = False
+                    size = int(field[2:])
+                elif field[1] == 'p':
+                    pure = True
+                    norm = False
                     size = int(field[2:])
                 else:
                     norm = False
+                    pure = False
                     size = int(field[1:])
             else:
                 type = VOID
                 norm = False
+                pure = False
                 size = 0
-            channel = Channel(type, norm, size, names[i])
+            channel = Channel(type, norm, pure, size, names[i])
             channels.append(channel)
 
         format = Format(name, layout, block_width, block_height, channels, swizzles, colorspace)
diff --git a/src/gallium/auxiliary/util/u_format_table.py b/src/gallium/auxiliary/util/u_format_table.py
index 55e0f78..66afcf7 100755
--- a/src/gallium/auxiliary/util/u_format_table.py
+++ b/src/gallium/auxiliary/util/u_format_table.py
@@ -113,7 +113,7 @@ def write_format_table(formats):
             else:
                 sep = ""
             if channel.size:
-                print "      {%s, %s, %u}%s\t/* %s = %s */" % (type_map[channel.type], bool_map(channel.norm), channel.size, sep, "xyzw"[i], channel.name)
+                print "      {%s, %s, %s, %u}%s\t/* %s = %s */" % (type_map[channel.type], bool_map(channel.norm), bool_map(channel.pure), channel.size, sep, "xyzw"[i], channel.name)
             else:
                 print "      {0, 0, 0}%s" % (sep,)
         print "   },"
@@ -131,7 +131,7 @@ def write_format_table(formats):
             print "      %s%s\t/* %s */" % (swizzle_map[swizzle], sep, comment)
         print "   },"
         print "   %s," % (colorspace_map(format.colorspace),)
-        if format.colorspace != ZS:
+        if format.colorspace != ZS and format.channels[0].pure == False:
             print "   &util_format_%s_unpack_rgba_8unorm," % format.short_name() 
             print "   &util_format_%s_pack_rgba_8unorm," % format.short_name() 
             if format.layout == 's3tc' or format.layout == 'rgtc':
@@ -160,10 +160,25 @@ def write_format_table(formats):
             print "   NULL, /* pack_z_float */" 
         if format.colorspace == ZS and format.swizzles[1] != SWIZZLE_NONE:
             print "   &util_format_%s_unpack_s_8uscaled," % format.short_name() 
-            print "   &util_format_%s_pack_s_8uscaled" % format.short_name() 
+            print "   &util_format_%s_pack_s_8uscaled," % format.short_name() 
         else:
             print "   NULL, /* unpack_s_8uscaled */" 
-            print "   NULL /* pack_s_8uscaled */" 
+            print "   NULL, /* pack_s_8uscaled */"
+        if format.channels[0].pure == True and format.channels[0].type == UNSIGNED:   
+            print "   &util_format_%s_unpack_unsigned, /* unpack_rgba_uint */" % format.short_name() 
+            print "   &util_format_%s_pack_unsigned, /* pack_rgba_uint */" % format.short_name()
+            print "   NULL, /* unpack_rgba_sint */" 
+            print "   NULL  /* pack_rgba_sint */" 
+        elif format.channels[0].pure == True and format.channels[0].type == SIGNED:   
+            print "   NULL, /* unpack_rgba_uint */" 
+            print "   NULL, /* pack_rgba_uint */" 
+            print "   &util_format_%s_unpack_signed, /* unpack_rgba_sint */" % format.short_name()
+            print "   &util_format_%s_pack_signed  /* pack_rgba_sint */" % format.short_name()
+        else:
+            print "   NULL, /* unpack_rgba_uint */" 
+            print "   NULL, /* pack_rgba_uint */" 
+            print "   NULL, /* unpack_rgba_sint */" 
+            print "   NULL  /* pack_rgba_sint */" 
         print "};"
         print
         
diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c
index 23f12e5..6342bfb 100644
--- a/src/gallium/auxiliary/util/u_tile.c
+++ b/src/gallium/auxiliary/util/u_tile.c
@@ -389,6 +389,29 @@ pipe_tile_raw_to_rgba(enum pipe_format format,
    }
 }
 
+void
+pipe_tile_raw_to_unsigned(enum pipe_format format,
+                          void *src,
+                          uint w, uint h,
+                          unsigned *dst, unsigned dst_stride)
+{
+  util_format_read_4ui(format,
+                       dst, dst_stride * sizeof(float),
+                       src, util_format_get_stride(format, w),
+                       0, 0, w, h);
+}
+
+void
+pipe_tile_raw_to_signed(enum pipe_format format,
+                          void *src,
+                          uint w, uint h,
+                          int *dst, unsigned dst_stride)
+{
+  util_format_read_4i(format,
+                      dst, dst_stride * sizeof(float),
+                      src, util_format_get_stride(format, w),
+                      0, 0, w, h);
+}
 
 void
 pipe_get_tile_rgba(struct pipe_context *pipe,
@@ -492,6 +515,61 @@ pipe_put_tile_rgba_format(struct pipe_context *pipe,
    FREE(packed);
 }
 
+void
+pipe_put_tile_i_format(struct pipe_context *pipe,
+                       struct pipe_transfer *pt,
+                       uint x, uint y, uint w, uint h,
+                       enum pipe_format format,
+                       const int *p)
+{
+   unsigned src_stride = w * 4;
+   void *packed;
+
+   if (u_clip_tile(x, y, &w, &h, &pt->box))
+      return;
+
+   packed = MALLOC(util_format_get_nblocks(format, w, h) * util_format_get_blocksize(format));
+
+   if (!packed)
+      return;
+
+   util_format_write_4i(format,
+                        p, src_stride * sizeof(float),
+                        packed, util_format_get_stride(format, w),
+                        0, 0, w, h);
+
+   pipe_put_tile_raw(pipe, pt, x, y, w, h, packed, 0);
+
+   FREE(packed);
+}
+
+void
+pipe_put_tile_ui_format(struct pipe_context *pipe,
+                        struct pipe_transfer *pt,
+                        uint x, uint y, uint w, uint h,
+                        enum pipe_format format,
+                        const unsigned int *p)
+{
+   unsigned src_stride = w * 4;
+   void *packed;
+
+   if (u_clip_tile(x, y, &w, &h, &pt->box))
+      return;
+
+   packed = MALLOC(util_format_get_nblocks(format, w, h) * util_format_get_blocksize(format));
+
+   if (!packed)
+      return;
+
+   util_format_write_4ui(format,
+                         p, src_stride * sizeof(float),
+                         packed, util_format_get_stride(format, w),
+                         0, 0, w, h);
+
+   pipe_put_tile_raw(pipe, pt, x, y, w, h, packed, 0);
+
+   FREE(packed);
+}
 
 /**
  * Get a block of Z values, converted to 32-bit range.
@@ -688,3 +766,63 @@ pipe_put_tile_z(struct pipe_context *pipe,
 }
 
 
+void
+pipe_get_tile_ui_format(struct pipe_context *pipe,
+                        struct pipe_transfer *pt,
+                        uint x, uint y, uint w, uint h,
+                        enum pipe_format format,
+                        unsigned int *p)
+{
+   unsigned dst_stride = w * 4;
+   void *packed;
+
+   if (u_clip_tile(x, y, &w, &h, &pt->box)) {
+      return;
+   }
+
+   packed = MALLOC(util_format_get_nblocks(format, w, h) * util_format_get_blocksize(format));
+   if (!packed) {
+      return;
+   }
+
+   if (format == PIPE_FORMAT_UYVY || format == PIPE_FORMAT_YUYV) {
+      assert((x & 1) == 0);
+   }
+
+   pipe_get_tile_raw(pipe, pt, x, y, w, h, packed, 0);
+
+   pipe_tile_raw_to_unsigned(format, packed, w, h, p, dst_stride);
+
+   FREE(packed);
+}
+
+
+void
+pipe_get_tile_i_format(struct pipe_context *pipe,
+                       struct pipe_transfer *pt,
+                       uint x, uint y, uint w, uint h,
+                       enum pipe_format format,
+                       int *p)
+{
+   unsigned dst_stride = w * 4;
+   void *packed;
+
+   if (u_clip_tile(x, y, &w, &h, &pt->box)) {
+      return;
+   }
+
+   packed = MALLOC(util_format_get_nblocks(format, w, h) * util_format_get_blocksize(format));
+   if (!packed) {
+      return;
+   }
+
+   if (format == PIPE_FORMAT_UYVY || format == PIPE_FORMAT_YUYV) {
+      assert((x & 1) == 0);
+   }
+
+   pipe_get_tile_raw(pipe, pt, x, y, w, h, packed, 0);
+
+   pipe_tile_raw_to_signed(format, packed, w, h, p, dst_stride);
+
+   FREE(packed);
+}
diff --git a/src/gallium/auxiliary/util/u_tile.h b/src/gallium/auxiliary/util/u_tile.h
index 0ba2743..926f169 100644
--- a/src/gallium/auxiliary/util/u_tile.h
+++ b/src/gallium/auxiliary/util/u_tile.h
@@ -118,6 +118,45 @@ pipe_tile_raw_to_rgba(enum pipe_format format,
                       uint w, uint h,
                       float *dst, unsigned dst_stride);
 
+void
+pipe_tile_raw_to_unsigned(enum pipe_format format,
+                          void *src,
+                          uint w, uint h,
+                          unsigned *dst, unsigned dst_stride);
+
+void
+pipe_tile_raw_to_signed(enum pipe_format format,
+                        void *src,
+                        uint w, uint h,
+                        int *dst, unsigned dst_stride);
+
+void
+pipe_get_tile_ui_format(struct pipe_context *pipe,
+                        struct pipe_transfer *pt,
+                        uint x, uint y, uint w, uint h,
+                        enum pipe_format format,
+                        unsigned int *p);
+
+void
+pipe_get_tile_i_format(struct pipe_context *pipe,
+                       struct pipe_transfer *pt,
+                       uint x, uint y, uint w, uint h,
+                       enum pipe_format format,
+                       int *p);
+
+void
+pipe_put_tile_ui_format(struct pipe_context *pipe,
+                        struct pipe_transfer *pt,
+                        uint x, uint y, uint w, uint h,
+                        enum pipe_format format,
+                        const unsigned *p);
+
+void
+pipe_put_tile_i_format(struct pipe_context *pipe,
+                       struct pipe_transfer *pt,
+                       uint x, uint y, uint w, uint h,
+                       enum pipe_format format,
+                       const int *p);
 
 #ifdef __cplusplus
 }
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.py b/src/gallium/drivers/llvmpipe/lp_tile_soa.py
index a2795b6..706411c 100644
--- a/src/gallium/drivers/llvmpipe/lp_tile_soa.py
+++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.py
@@ -612,7 +612,7 @@ def main():
 
     generate_sse2()
 
-    channel = Channel(UNSIGNED, True, 8)
+    channel = Channel(UNSIGNED, True, False, 8)
     native_type = 'uint8_t'
     suffix = '4ub'
 
diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h
index 3d1c997..043091c 100644
--- a/src/gallium/include/pipe/p_format.h
+++ b/src/gallium/include/pipe/p_format.h
@@ -251,6 +251,12 @@ enum pipe_format {
    PIPE_FORMAT_B10G10R10A2_SSCALED     = 175,
    PIPE_FORMAT_B10G10R10A2_SNORM       = 176,
 
+   PIPE_FORMAT_R8G8B8A8_UINT = 177,
+   PIPE_FORMAT_R8G8B8A8_SINT = 178,
+   PIPE_FORMAT_R16G16B16A16_UINT = 179,
+   PIPE_FORMAT_R16G16B16A16_SINT = 180,
+   PIPE_FORMAT_R32G32B32A32_UINT = 181,
+   PIPE_FORMAT_R32G32B32A32_SINT = 182,
    PIPE_FORMAT_COUNT
 };
 
-- 
1.7.6.2



More information about the mesa-dev mailing list