freedreno/a3xx: add 32bit integer vtx formats
authorRob Clark <robclark@freedesktop.org>
Fri, 26 Sep 2014 14:33:35 +0000 (10:33 -0400)
committerRob Clark <robclark@freedesktop.org>
Mon, 29 Sep 2014 22:30:42 +0000 (18:30 -0400)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a3xx/fd3_emit.c
src/gallium/drivers/freedreno/a3xx/fd3_util.c

index 624155b0aded893a3616144d135300c11a923be8..c48381c95077081341a6c6c3c41ca755e2b09c20 100644 (file)
@@ -343,6 +343,7 @@ fd3_emit_vertex_bufs(struct fd_ringbuffer *ring,
                        enum pipe_format pfmt = vbufs[i].format;
                        enum a3xx_vtx_fmt fmt = fd3_pipe2vtx(pfmt);
                        bool switchnext = (i != last);
+                       bool isint = util_format_is_pure_integer(pfmt);
                        uint32_t fs = util_format_get_blocksize(pfmt);
 
                        debug_assert(fmt != ~0);
@@ -363,6 +364,7 @@ fd3_emit_vertex_bufs(struct fd_ringbuffer *ring,
                                        A3XX_VFD_DECODE_INSTR_REGID(vp->inputs[i].regid) |
                                        A3XX_VFD_DECODE_INSTR_SHIFTCNT(fs) |
                                        A3XX_VFD_DECODE_INSTR_LASTCOMPVALID |
+                                       COND(isint, A3XX_VFD_DECODE_INSTR_INT) |
                                        COND(switchnext, A3XX_VFD_DECODE_INSTR_SWITCHNEXT));
 
                        total_in += vp->inputs[i].ncomp;
index c921bc2da9eaa6c3cff224a66942dc1b657326cf..c83f65ae42192e933ee8d44a50a590a413c724c3 100644 (file)
@@ -134,6 +134,14 @@ fd3_pipe2vtx(enum pipe_format format)
        case PIPE_FORMAT_R16G16_SNORM:
                return VFMT_NORM_SHORT_16_16;
 
+       case PIPE_FORMAT_R32_UINT:
+       case PIPE_FORMAT_R32_USCALED:
+               return VFMT_UINT_32;
+
+       case PIPE_FORMAT_R32_SINT:
+       case PIPE_FORMAT_R32_SSCALED:
+               return VFMT_INT_32;
+
        case PIPE_FORMAT_R10G10B10A2_UNORM:
                return VFMT_NORM_UINT_10_10_10_2;
 
@@ -196,6 +204,14 @@ fd3_pipe2vtx(enum pipe_format format)
        case PIPE_FORMAT_R16G16B16A16_FLOAT:
                return VFMT_FLOAT_16_16_16_16;
 
+       case PIPE_FORMAT_R32G32_UINT:
+       case PIPE_FORMAT_R32G32_USCALED:
+               return VFMT_UINT_32_32;
+
+       case PIPE_FORMAT_R32G32_SINT:
+       case PIPE_FORMAT_R32G32_SSCALED:
+               return VFMT_INT_32_32;
+
        /* 96-bit buffers. */
        case PIPE_FORMAT_R32G32B32_FLOAT:
                return VFMT_FLOAT_32_32_32;
@@ -203,6 +219,14 @@ fd3_pipe2vtx(enum pipe_format format)
        case PIPE_FORMAT_R32G32B32_FIXED:
                return VFMT_FIXED_32_32_32;
 
+       case PIPE_FORMAT_R32G32B32_UINT:
+       case PIPE_FORMAT_R32G32B32_USCALED:
+               return VFMT_UINT_32_32_32;
+
+       case PIPE_FORMAT_R32G32B32_SINT:
+       case PIPE_FORMAT_R32G32B32_SSCALED:
+               return VFMT_INT_32_32_32;
+
        /* 128-bit buffers. */
        case PIPE_FORMAT_R32G32B32A32_FLOAT:
                return VFMT_FLOAT_32_32_32_32;
@@ -210,26 +234,20 @@ fd3_pipe2vtx(enum pipe_format format)
        case PIPE_FORMAT_R32G32B32A32_FIXED:
                return VFMT_FIXED_32_32_32_32;
 
-/* TODO probably need gles3 blob drivers to find the 32bit int formats:
-       case PIPE_FORMAT_R32G32B32A32_SNORM:
-       case PIPE_FORMAT_R32G32B32A32_UNORM:
-       case PIPE_FORMAT_R32G32B32A32_SINT:
        case PIPE_FORMAT_R32G32B32A32_UINT:
+       case PIPE_FORMAT_R32G32B32A32_USCALED:
+               return VFMT_UINT_32_32_32_32;
 
-       case PIPE_FORMAT_R32_UINT:
-       case PIPE_FORMAT_R32_SINT:
-       case PIPE_FORMAT_A32_UINT:
-       case PIPE_FORMAT_A32_SINT:
-       case PIPE_FORMAT_L32_UINT:
-       case PIPE_FORMAT_L32_SINT:
-       case PIPE_FORMAT_I32_UINT:
-       case PIPE_FORMAT_I32_SINT:
+       case PIPE_FORMAT_R32G32B32A32_SINT:
+       case PIPE_FORMAT_R32G32B32A32_SSCALED:
+               return VFMT_INT_32_32_32_32;
 
-       case PIPE_FORMAT_R32G32_SINT:
-       case PIPE_FORMAT_R32G32_UINT:
-       case PIPE_FORMAT_L32A32_UINT:
-       case PIPE_FORMAT_L32A32_SINT:
-*/
+/* TODO normalized 32bit int formats do not appear to be supported
+ * natively.. will require either shader variant or VFD_DECODE
+ * gymnastics like the blob driver does..
+       case PIPE_FORMAT_R32G32B32A32_SNORM:
+       case PIPE_FORMAT_R32G32B32A32_UNORM:
+ */
 
        default:
                return ~0;