freedreno/a3xx: fd3_util -> fd3_format
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 28 Nov 2014 22:16:24 +0000 (17:16 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 29 Nov 2014 17:15:43 +0000 (12:15 -0500)
All the "util" helpers are actually format-related

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
17 files changed:
src/gallium/drivers/freedreno/Makefile.sources
src/gallium/drivers/freedreno/a3xx/fd3_blend.c
src/gallium/drivers/freedreno/a3xx/fd3_draw.c
src/gallium/drivers/freedreno/a3xx/fd3_emit.c
src/gallium/drivers/freedreno/a3xx/fd3_emit.h
src/gallium/drivers/freedreno/a3xx/fd3_format.c [new file with mode: 0644]
src/gallium/drivers/freedreno/a3xx/fd3_format.h [new file with mode: 0644]
src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
src/gallium/drivers/freedreno/a3xx/fd3_program.c
src/gallium/drivers/freedreno/a3xx/fd3_query.c
src/gallium/drivers/freedreno/a3xx/fd3_rasterizer.c
src/gallium/drivers/freedreno/a3xx/fd3_screen.c
src/gallium/drivers/freedreno/a3xx/fd3_texture.c
src/gallium/drivers/freedreno/a3xx/fd3_texture.h
src/gallium/drivers/freedreno/a3xx/fd3_util.c [deleted file]
src/gallium/drivers/freedreno/a3xx/fd3_util.h [deleted file]
src/gallium/drivers/freedreno/a3xx/fd3_zsa.c

index 19bb8f9cd243e50ca2f844344e4d161c19ddb650..81019dbfbfa0700af59d7a903a33864b093fbe42 100644 (file)
@@ -72,6 +72,8 @@ a3xx_SOURCES := \
        a3xx/fd3_draw.h \
        a3xx/fd3_emit.c \
        a3xx/fd3_emit.h \
+       a3xx/fd3_format.c \
+       a3xx/fd3_format.h \
        a3xx/fd3_gmem.c \
        a3xx/fd3_gmem.h \
        a3xx/fd3_program.c \
@@ -84,8 +86,6 @@ a3xx_SOURCES := \
        a3xx/fd3_screen.h \
        a3xx/fd3_texture.c \
        a3xx/fd3_texture.h \
-       a3xx/fd3_util.c \
-       a3xx/fd3_util.h \
        a3xx/fd3_zsa.c \
        a3xx/fd3_zsa.h
 
index 940d065d75b94be5af839ab293f421d9494ebfc8..329d304694c6f370648b4cbc587d6111349094fc 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "fd3_blend.h"
 #include "fd3_context.h"
-#include "fd3_util.h"
+#include "fd3_format.h"
 
 
 static enum a3xx_rb_blend_opcode
index b289e76fa24afca6bee5e8add2df76d2b66f1a1f..b824d212a36dd937d6ae653da419709c79f62a1d 100644 (file)
@@ -39,7 +39,7 @@
 #include "fd3_context.h"
 #include "fd3_emit.h"
 #include "fd3_program.h"
-#include "fd3_util.h"
+#include "fd3_format.h"
 #include "fd3_zsa.h"
 
 
index 62ffa73cd20d8fdb8d90e57fcf8e1a59d863736e..64b1c32bb63c5d402546b14dd7fc3b29dbefb3d7 100644 (file)
@@ -40,7 +40,7 @@
 #include "fd3_program.h"
 #include "fd3_rasterizer.h"
 #include "fd3_texture.h"
-#include "fd3_util.h"
+#include "fd3_format.h"
 #include "fd3_zsa.h"
 
 /* regid:          base const register
index a397c8705a36ca8a71fbb62176420b048a6d43c8..c1bd61ae0a875ff275a41f3d1b5628cf23232627 100644 (file)
@@ -32,7 +32,7 @@
 #include "pipe/p_context.h"
 
 #include "freedreno_context.h"
-#include "fd3_util.h"
+#include "fd3_format.h"
 #include "fd3_program.h"
 #include "ir3_shader.h"
 
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_format.c b/src/gallium/drivers/freedreno/a3xx/fd3_format.c
new file mode 100644 (file)
index 0000000..a70aceb
--- /dev/null
@@ -0,0 +1,453 @@
+/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
+
+/*
+ * Copyright (C) 2013 Rob Clark <robclark@freedesktop.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Authors:
+ *    Rob Clark <robclark@freedesktop.org>
+ */
+
+#include "pipe/p_defines.h"
+#include "util/u_format.h"
+
+#include "fd3_format.h"
+
+/* convert pipe format to vertex buffer format: */
+enum a3xx_vtx_fmt
+fd3_pipe2vtx(enum pipe_format format)
+{
+       switch (format) {
+       /* 8-bit buffers. */
+       case PIPE_FORMAT_R8_UNORM:
+               return VFMT_NORM_UBYTE_8;
+
+       case PIPE_FORMAT_R8_SNORM:
+               return VFMT_NORM_BYTE_8;
+
+       case PIPE_FORMAT_R8_UINT:
+       case PIPE_FORMAT_R8_USCALED:
+               return VFMT_UBYTE_8;
+
+       case PIPE_FORMAT_R8_SINT:
+       case PIPE_FORMAT_R8_SSCALED:
+               return VFMT_BYTE_8;
+
+       /* 16-bit buffers. */
+       case PIPE_FORMAT_R16_UNORM:
+       case PIPE_FORMAT_Z16_UNORM:
+               return VFMT_NORM_USHORT_16;
+
+       case PIPE_FORMAT_R16_SNORM:
+               return VFMT_NORM_SHORT_16;
+
+       case PIPE_FORMAT_R16_UINT:
+       case PIPE_FORMAT_R16_USCALED:
+               return VFMT_USHORT_16;
+
+       case PIPE_FORMAT_R16_SINT:
+       case PIPE_FORMAT_R16_SSCALED:
+               return VFMT_SHORT_16;
+
+       case PIPE_FORMAT_R16_FLOAT:
+               return VFMT_FLOAT_16;
+
+       case PIPE_FORMAT_R8G8_UNORM:
+               return VFMT_NORM_UBYTE_8_8;
+
+       case PIPE_FORMAT_R8G8_SNORM:
+               return VFMT_NORM_BYTE_8_8;
+
+       case PIPE_FORMAT_R8G8_UINT:
+       case PIPE_FORMAT_R8G8_USCALED:
+               return VFMT_UBYTE_8_8;
+
+       case PIPE_FORMAT_R8G8_SINT:
+       case PIPE_FORMAT_R8G8_SSCALED:
+               return VFMT_BYTE_8_8;
+
+       /* 24-bit buffers. */
+       case PIPE_FORMAT_R8G8B8_UNORM:
+               return VFMT_NORM_UBYTE_8_8_8;
+
+       case PIPE_FORMAT_R8G8B8_SNORM:
+               return VFMT_NORM_BYTE_8_8_8;
+
+       case PIPE_FORMAT_R8G8B8_UINT:
+       case PIPE_FORMAT_R8G8B8_USCALED:
+               return VFMT_UBYTE_8_8_8;
+
+       case PIPE_FORMAT_R8G8B8_SINT:
+       case PIPE_FORMAT_R8G8B8_SSCALED:
+               return VFMT_BYTE_8_8_8;
+
+       /* 32-bit buffers. */
+       case PIPE_FORMAT_A8B8G8R8_UNORM:
+       case PIPE_FORMAT_A8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
+       case PIPE_FORMAT_R8G8B8A8_UNORM:
+               return VFMT_NORM_UBYTE_8_8_8_8;
+
+       case PIPE_FORMAT_R8G8B8A8_SNORM:
+               return VFMT_NORM_BYTE_8_8_8_8;
+
+       case PIPE_FORMAT_R8G8B8A8_UINT:
+       case PIPE_FORMAT_R8G8B8A8_USCALED:
+               return VFMT_UBYTE_8_8_8_8;
+
+       case PIPE_FORMAT_R8G8B8A8_SINT:
+       case PIPE_FORMAT_R8G8B8A8_SSCALED:
+               return VFMT_BYTE_8_8_8_8;
+
+       case PIPE_FORMAT_R16G16_SSCALED:
+       case PIPE_FORMAT_R16G16_SINT:
+               return VFMT_SHORT_16_16;
+
+       case PIPE_FORMAT_R16G16_FLOAT:
+               return VFMT_FLOAT_16_16;
+
+       case PIPE_FORMAT_R16G16_UINT:
+       case PIPE_FORMAT_R16G16_USCALED:
+               return VFMT_USHORT_16_16;
+
+       case PIPE_FORMAT_R16G16_UNORM:
+               return VFMT_NORM_USHORT_16_16;
+
+       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;
+
+       case PIPE_FORMAT_R10G10B10A2_SNORM:
+               return VFMT_NORM_INT_10_10_10_2;
+
+       case PIPE_FORMAT_R10G10B10A2_UINT:
+       case PIPE_FORMAT_R10G10B10A2_USCALED:
+               return VFMT_UINT_10_10_10_2;
+
+       case PIPE_FORMAT_R10G10B10A2_SSCALED:
+               return VFMT_INT_10_10_10_2;
+
+       /* 48-bit buffers. */
+       case PIPE_FORMAT_R16G16B16_FLOAT:
+               return VFMT_FLOAT_16_16_16;
+
+       case PIPE_FORMAT_R16G16B16_SINT:
+       case PIPE_FORMAT_R16G16B16_SSCALED:
+               return VFMT_SHORT_16_16_16;
+
+       case PIPE_FORMAT_R16G16B16_UINT:
+       case PIPE_FORMAT_R16G16B16_USCALED:
+               return VFMT_USHORT_16_16_16;
+
+       case PIPE_FORMAT_R16G16B16_SNORM:
+               return VFMT_NORM_SHORT_16_16_16;
+
+       case PIPE_FORMAT_R16G16B16_UNORM:
+               return VFMT_NORM_USHORT_16_16_16;
+
+       case PIPE_FORMAT_R32_FLOAT:
+       case PIPE_FORMAT_Z32_FLOAT:
+               return VFMT_FLOAT_32;
+
+       case PIPE_FORMAT_R32_FIXED:
+               return VFMT_FIXED_32;
+
+       /* 64-bit buffers. */
+       case PIPE_FORMAT_R16G16B16A16_UNORM:
+               return VFMT_NORM_USHORT_16_16_16_16;
+
+       case PIPE_FORMAT_R16G16B16A16_SNORM:
+               return VFMT_NORM_SHORT_16_16_16_16;
+
+       case PIPE_FORMAT_R16G16B16A16_UINT:
+       case PIPE_FORMAT_R16G16B16A16_USCALED:
+               return VFMT_USHORT_16_16_16_16;
+
+       case PIPE_FORMAT_R16G16B16A16_SINT:
+       case PIPE_FORMAT_R16G16B16A16_SSCALED:
+               return VFMT_SHORT_16_16_16_16;
+
+       case PIPE_FORMAT_R32G32_FLOAT:
+               return VFMT_FLOAT_32_32;
+
+       case PIPE_FORMAT_R32G32_FIXED:
+               return VFMT_FIXED_32_32;
+
+       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;
+
+       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;
+
+       case PIPE_FORMAT_R32G32B32A32_FIXED:
+               return VFMT_FIXED_32_32_32_32;
+
+       case PIPE_FORMAT_R32G32B32A32_UINT:
+       case PIPE_FORMAT_R32G32B32A32_USCALED:
+               return VFMT_UINT_32_32_32_32;
+
+       case PIPE_FORMAT_R32G32B32A32_SINT:
+       case PIPE_FORMAT_R32G32B32A32_SSCALED:
+               return VFMT_INT_32_32_32_32;
+
+/* 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;
+       }
+}
+
+/* convert pipe format to texture sampler format: */
+enum a3xx_tex_fmt
+fd3_pipe2tex(enum pipe_format format)
+{
+       switch (format) {
+       case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_A8_UNORM:
+       case PIPE_FORMAT_I8_UNORM:
+               return TFMT_NORM_UINT_8;
+
+       case PIPE_FORMAT_R8G8_UNORM:
+               return TFMT_NORM_UINT_8_8;
+
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
+       case PIPE_FORMAT_B8G8R8X8_UNORM:
+       case PIPE_FORMAT_R8G8B8A8_UNORM:
+       case PIPE_FORMAT_R8G8B8X8_UNORM:
+       case PIPE_FORMAT_B8G8R8A8_SRGB:
+       case PIPE_FORMAT_B8G8R8X8_SRGB:
+       case PIPE_FORMAT_R8G8B8A8_SRGB:
+       case PIPE_FORMAT_R8G8B8X8_SRGB:
+               return TFMT_NORM_UINT_8_8_8_8;
+
+       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
+               return TFMT_NORM_UINT_X8Z24;
+
+       case PIPE_FORMAT_Z16_UNORM:
+               return TFMT_NORM_USHORT_Z16;
+
+       case PIPE_FORMAT_R16G16B16A16_FLOAT:
+       case PIPE_FORMAT_R16G16B16X16_FLOAT:
+               return TFMT_FLOAT_16_16_16_16;
+
+       case PIPE_FORMAT_R32G32B32A32_FLOAT:
+       case PIPE_FORMAT_R32G32B32X32_FLOAT:
+               return TFMT_FLOAT_32_32_32_32;
+
+       // TODO add more..
+
+       default:
+               return ~0;
+       }
+}
+
+enum a3xx_tex_fetchsize
+fd3_pipe2fetchsize(enum pipe_format format)
+{
+       switch (format) {
+       case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_A8_UNORM:
+       case PIPE_FORMAT_I8_UNORM:
+               return TFETCH_1_BYTE;
+
+       case PIPE_FORMAT_Z16_UNORM:
+               return TFETCH_2_BYTE;
+
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
+       case PIPE_FORMAT_B8G8R8X8_UNORM:
+       case PIPE_FORMAT_R8G8B8A8_UNORM:
+       case PIPE_FORMAT_R8G8B8X8_UNORM:
+       case PIPE_FORMAT_B8G8R8A8_SRGB:
+       case PIPE_FORMAT_B8G8R8X8_SRGB:
+       case PIPE_FORMAT_R8G8B8A8_SRGB:
+       case PIPE_FORMAT_R8G8B8X8_SRGB:
+       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
+               return TFETCH_4_BYTE;
+
+       // TODO add more..
+
+       default:
+               return TFETCH_DISABLE;  /* safe default */
+       }
+}
+
+/* convert pipe format to MRT / copydest format used for render-target: */
+enum a3xx_color_fmt
+fd3_pipe2color(enum pipe_format format)
+{
+       switch (format) {
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
+       case PIPE_FORMAT_B8G8R8X8_UNORM:
+       case PIPE_FORMAT_R8G8B8A8_UNORM:
+               return RB_R8G8B8A8_UNORM;
+
+       case PIPE_FORMAT_Z16_UNORM:
+               return RB_R8G8_UNORM;
+
+       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
+               /* for DEPTHX_24_8, blob driver also seems to use R8G8B8A8 fmt.. */
+               return RB_R8G8B8A8_UNORM;
+
+       case PIPE_FORMAT_R8_UNORM:
+       case PIPE_FORMAT_L8_UNORM:
+               return RB_R8_UNORM;
+
+       case PIPE_FORMAT_A8_UNORM:
+               return RB_A8_UNORM;
+
+       case PIPE_FORMAT_R16G16B16A16_FLOAT:
+       case PIPE_FORMAT_R16G16B16X16_FLOAT:
+               return RB_R16G16B16A16_FLOAT;
+
+       case PIPE_FORMAT_R32G32B32A32_FLOAT:
+       case PIPE_FORMAT_R32G32B32X32_FLOAT:
+               return RB_R32G32B32A32_FLOAT;
+
+       // TODO add more..
+
+       default:
+               return ~0;
+       }
+}
+
+/* we need to special case a bit the depth/stencil restore, because we are
+ * using the texture sampler to blit into the depth/stencil buffer, *not*
+ * into a color buffer.  Otherwise fd3_tex_swiz() will do the wrong thing,
+ * as it is assuming that you are sampling into normal render target..
+ */
+enum pipe_format
+fd3_gmem_restore_format(enum pipe_format format)
+{
+       switch (format) {
+       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
+               return PIPE_FORMAT_R8G8B8A8_UNORM;
+       case PIPE_FORMAT_Z16_UNORM:
+               return PIPE_FORMAT_R8G8_UNORM;
+       default:
+               return format;
+       }
+}
+
+enum a3xx_color_swap
+fd3_pipe2swap(enum pipe_format format)
+{
+       switch (format) {
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
+       case PIPE_FORMAT_B8G8R8X8_UNORM:
+       case PIPE_FORMAT_B8G8R8A8_SRGB:
+       case PIPE_FORMAT_B8G8R8X8_SRGB:
+               return WXYZ;
+
+       case PIPE_FORMAT_A8R8G8B8_UNORM:
+       case PIPE_FORMAT_X8R8G8B8_UNORM:
+       case PIPE_FORMAT_A8R8G8B8_SRGB:
+       case PIPE_FORMAT_X8R8G8B8_SRGB:
+               return ZYXW;
+
+       case PIPE_FORMAT_A8B8G8R8_UNORM:
+       case PIPE_FORMAT_X8B8G8R8_UNORM:
+       case PIPE_FORMAT_A8B8G8R8_SRGB:
+       case PIPE_FORMAT_X8B8G8R8_SRGB:
+               return XYZW;
+
+       case PIPE_FORMAT_R8G8B8A8_UNORM:
+       case PIPE_FORMAT_R8G8B8X8_UNORM:
+       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
+       default:
+               return WZYX;
+       }
+}
+
+static inline enum a3xx_tex_swiz
+tex_swiz(unsigned swiz)
+{
+       switch (swiz) {
+       default:
+       case PIPE_SWIZZLE_RED:   return A3XX_TEX_X;
+       case PIPE_SWIZZLE_GREEN: return A3XX_TEX_Y;
+       case PIPE_SWIZZLE_BLUE:  return A3XX_TEX_Z;
+       case PIPE_SWIZZLE_ALPHA: return A3XX_TEX_W;
+       case PIPE_SWIZZLE_ZERO:  return A3XX_TEX_ZERO;
+       case PIPE_SWIZZLE_ONE:   return A3XX_TEX_ONE;
+       }
+}
+
+uint32_t
+fd3_tex_swiz(enum pipe_format format, unsigned swizzle_r, unsigned swizzle_g,
+               unsigned swizzle_b, unsigned swizzle_a)
+{
+       const struct util_format_description *desc =
+                       util_format_description(format);
+       unsigned char swiz[4] = {
+                       swizzle_r, swizzle_g, swizzle_b, swizzle_a,
+       }, rswiz[4];
+
+       util_format_compose_swizzles(desc->swizzle, swiz, rswiz);
+
+       return A3XX_TEX_CONST_0_SWIZ_X(tex_swiz(rswiz[0])) |
+                       A3XX_TEX_CONST_0_SWIZ_Y(tex_swiz(rswiz[1])) |
+                       A3XX_TEX_CONST_0_SWIZ_Z(tex_swiz(rswiz[2])) |
+                       A3XX_TEX_CONST_0_SWIZ_W(tex_swiz(rswiz[3]));
+}
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_format.h b/src/gallium/drivers/freedreno/a3xx/fd3_format.h
new file mode 100644 (file)
index 0000000..ebd6795
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2013 Rob Clark <robclark@freedesktop.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef FD3_FORMAT_H_
+#define FD3_FORMAT_H_
+
+#include "freedreno_util.h"
+
+#include "a3xx.xml.h"
+
+enum a3xx_vtx_fmt fd3_pipe2vtx(enum pipe_format format);
+enum a3xx_tex_fmt fd3_pipe2tex(enum pipe_format format);
+enum a3xx_tex_fetchsize fd3_pipe2fetchsize(enum pipe_format format);
+enum a3xx_color_fmt fd3_pipe2color(enum pipe_format format);
+enum pipe_format fd3_gmem_restore_format(enum pipe_format format);
+enum a3xx_color_swap fd3_pipe2swap(enum pipe_format format);
+
+uint32_t fd3_tex_swiz(enum pipe_format format, unsigned swizzle_r,
+               unsigned swizzle_g, unsigned swizzle_b, unsigned swizzle_a);
+
+#endif /* FD3_FORMAT_H_ */
index f454db28a5ecbba04c52cc890d06419e023980aa..1dd43cc6b4c5f9049ed384d8a0ce4e9aa40423e5 100644 (file)
@@ -40,7 +40,7 @@
 #include "fd3_context.h"
 #include "fd3_emit.h"
 #include "fd3_program.h"
-#include "fd3_util.h"
+#include "fd3_format.h"
 #include "fd3_zsa.h"
 
 static const struct ir3_shader_key key = {
index cb0179a68d313191f15e311e5105d0d4248ed1a7..b6710957458e44a0cec6c204078ef1799bc3c3b1 100644 (file)
@@ -39,7 +39,7 @@
 #include "fd3_program.h"
 #include "fd3_emit.h"
 #include "fd3_texture.h"
-#include "fd3_util.h"
+#include "fd3_format.h"
 
 static void
 delete_shader_stateobj(struct fd3_shader_stateobj *so)
index bc3a3ec69c744dd8527ac073c08be37c28378749..cf70ae3bd3c55ebf96b4b69ffbc9eaa4861679d9 100644 (file)
@@ -31,7 +31,7 @@
 #include "freedreno_util.h"
 
 #include "fd3_query.h"
-#include "fd3_util.h"
+#include "fd3_format.h"
 
 
 struct fd_rb_samp_ctrs {
index 1a1a7cbd6536143c46b3faa3f441fa779409cb11..4b926b50f44c5dbbf9c63b94dcf34417b3567733 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "fd3_rasterizer.h"
 #include "fd3_context.h"
-#include "fd3_util.h"
+#include "fd3_format.h"
 
 void *
 fd3_rasterizer_state_create(struct pipe_context *pctx,
index 9bb19abc2a87214baa2c309d7b36fe87303523ed..38716605079ea6ca07d34ff3dec0920c67a3d415 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "fd3_screen.h"
 #include "fd3_context.h"
-#include "fd3_util.h"
+#include "fd3_format.h"
 
 static boolean
 fd3_screen_is_format_supported(struct pipe_screen *pscreen,
index 39befef7672434cc8517e368b823aaeb3746ea87..5dda82de148097832bdacbdeb81b441203e47d14 100644 (file)
@@ -33,7 +33,7 @@
 #include "util/u_format.h"
 
 #include "fd3_texture.h"
-#include "fd3_util.h"
+#include "fd3_format.h"
 
 static enum a3xx_tex_clamp
 tex_clamp(unsigned wrap, bool clamp_to_edge)
index 0434df37413e931e3d217812930c3be74bbae8d2..f3cb12022f0b3f54de1389b9aa5fd0a564b45840 100644 (file)
@@ -35,7 +35,7 @@
 #include "freedreno_resource.h"
 
 #include "fd3_context.h"
-#include "fd3_util.h"
+#include "fd3_format.h"
 
 struct fd3_sampler_stateobj {
        struct pipe_sampler_state base;
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_util.c b/src/gallium/drivers/freedreno/a3xx/fd3_util.c
deleted file mode 100644 (file)
index a73894f..0000000
+++ /dev/null
@@ -1,453 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2013 Rob Clark <robclark@freedesktop.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Authors:
- *    Rob Clark <robclark@freedesktop.org>
- */
-
-#include "pipe/p_defines.h"
-#include "util/u_format.h"
-
-#include "fd3_util.h"
-
-/* convert pipe format to vertex buffer format: */
-enum a3xx_vtx_fmt
-fd3_pipe2vtx(enum pipe_format format)
-{
-       switch (format) {
-       /* 8-bit buffers. */
-       case PIPE_FORMAT_R8_UNORM:
-               return VFMT_NORM_UBYTE_8;
-
-       case PIPE_FORMAT_R8_SNORM:
-               return VFMT_NORM_BYTE_8;
-
-       case PIPE_FORMAT_R8_UINT:
-       case PIPE_FORMAT_R8_USCALED:
-               return VFMT_UBYTE_8;
-
-       case PIPE_FORMAT_R8_SINT:
-       case PIPE_FORMAT_R8_SSCALED:
-               return VFMT_BYTE_8;
-
-       /* 16-bit buffers. */
-       case PIPE_FORMAT_R16_UNORM:
-       case PIPE_FORMAT_Z16_UNORM:
-               return VFMT_NORM_USHORT_16;
-
-       case PIPE_FORMAT_R16_SNORM:
-               return VFMT_NORM_SHORT_16;
-
-       case PIPE_FORMAT_R16_UINT:
-       case PIPE_FORMAT_R16_USCALED:
-               return VFMT_USHORT_16;
-
-       case PIPE_FORMAT_R16_SINT:
-       case PIPE_FORMAT_R16_SSCALED:
-               return VFMT_SHORT_16;
-
-       case PIPE_FORMAT_R16_FLOAT:
-               return VFMT_FLOAT_16;
-
-       case PIPE_FORMAT_R8G8_UNORM:
-               return VFMT_NORM_UBYTE_8_8;
-
-       case PIPE_FORMAT_R8G8_SNORM:
-               return VFMT_NORM_BYTE_8_8;
-
-       case PIPE_FORMAT_R8G8_UINT:
-       case PIPE_FORMAT_R8G8_USCALED:
-               return VFMT_UBYTE_8_8;
-
-       case PIPE_FORMAT_R8G8_SINT:
-       case PIPE_FORMAT_R8G8_SSCALED:
-               return VFMT_BYTE_8_8;
-
-       /* 24-bit buffers. */
-       case PIPE_FORMAT_R8G8B8_UNORM:
-               return VFMT_NORM_UBYTE_8_8_8;
-
-       case PIPE_FORMAT_R8G8B8_SNORM:
-               return VFMT_NORM_BYTE_8_8_8;
-
-       case PIPE_FORMAT_R8G8B8_UINT:
-       case PIPE_FORMAT_R8G8B8_USCALED:
-               return VFMT_UBYTE_8_8_8;
-
-       case PIPE_FORMAT_R8G8B8_SINT:
-       case PIPE_FORMAT_R8G8B8_SSCALED:
-               return VFMT_BYTE_8_8_8;
-
-       /* 32-bit buffers. */
-       case PIPE_FORMAT_A8B8G8R8_UNORM:
-       case PIPE_FORMAT_A8R8G8B8_UNORM:
-       case PIPE_FORMAT_B8G8R8A8_UNORM:
-       case PIPE_FORMAT_R8G8B8A8_UNORM:
-               return VFMT_NORM_UBYTE_8_8_8_8;
-
-       case PIPE_FORMAT_R8G8B8A8_SNORM:
-               return VFMT_NORM_BYTE_8_8_8_8;
-
-       case PIPE_FORMAT_R8G8B8A8_UINT:
-       case PIPE_FORMAT_R8G8B8A8_USCALED:
-               return VFMT_UBYTE_8_8_8_8;
-
-       case PIPE_FORMAT_R8G8B8A8_SINT:
-       case PIPE_FORMAT_R8G8B8A8_SSCALED:
-               return VFMT_BYTE_8_8_8_8;
-
-       case PIPE_FORMAT_R16G16_SSCALED:
-       case PIPE_FORMAT_R16G16_SINT:
-               return VFMT_SHORT_16_16;
-
-       case PIPE_FORMAT_R16G16_FLOAT:
-               return VFMT_FLOAT_16_16;
-
-       case PIPE_FORMAT_R16G16_UINT:
-       case PIPE_FORMAT_R16G16_USCALED:
-               return VFMT_USHORT_16_16;
-
-       case PIPE_FORMAT_R16G16_UNORM:
-               return VFMT_NORM_USHORT_16_16;
-
-       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;
-
-       case PIPE_FORMAT_R10G10B10A2_SNORM:
-               return VFMT_NORM_INT_10_10_10_2;
-
-       case PIPE_FORMAT_R10G10B10A2_UINT:
-       case PIPE_FORMAT_R10G10B10A2_USCALED:
-               return VFMT_UINT_10_10_10_2;
-
-       case PIPE_FORMAT_R10G10B10A2_SSCALED:
-               return VFMT_INT_10_10_10_2;
-
-       /* 48-bit buffers. */
-       case PIPE_FORMAT_R16G16B16_FLOAT:
-               return VFMT_FLOAT_16_16_16;
-
-       case PIPE_FORMAT_R16G16B16_SINT:
-       case PIPE_FORMAT_R16G16B16_SSCALED:
-               return VFMT_SHORT_16_16_16;
-
-       case PIPE_FORMAT_R16G16B16_UINT:
-       case PIPE_FORMAT_R16G16B16_USCALED:
-               return VFMT_USHORT_16_16_16;
-
-       case PIPE_FORMAT_R16G16B16_SNORM:
-               return VFMT_NORM_SHORT_16_16_16;
-
-       case PIPE_FORMAT_R16G16B16_UNORM:
-               return VFMT_NORM_USHORT_16_16_16;
-
-       case PIPE_FORMAT_R32_FLOAT:
-       case PIPE_FORMAT_Z32_FLOAT:
-               return VFMT_FLOAT_32;
-
-       case PIPE_FORMAT_R32_FIXED:
-               return VFMT_FIXED_32;
-
-       /* 64-bit buffers. */
-       case PIPE_FORMAT_R16G16B16A16_UNORM:
-               return VFMT_NORM_USHORT_16_16_16_16;
-
-       case PIPE_FORMAT_R16G16B16A16_SNORM:
-               return VFMT_NORM_SHORT_16_16_16_16;
-
-       case PIPE_FORMAT_R16G16B16A16_UINT:
-       case PIPE_FORMAT_R16G16B16A16_USCALED:
-               return VFMT_USHORT_16_16_16_16;
-
-       case PIPE_FORMAT_R16G16B16A16_SINT:
-       case PIPE_FORMAT_R16G16B16A16_SSCALED:
-               return VFMT_SHORT_16_16_16_16;
-
-       case PIPE_FORMAT_R32G32_FLOAT:
-               return VFMT_FLOAT_32_32;
-
-       case PIPE_FORMAT_R32G32_FIXED:
-               return VFMT_FIXED_32_32;
-
-       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;
-
-       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;
-
-       case PIPE_FORMAT_R32G32B32A32_FIXED:
-               return VFMT_FIXED_32_32_32_32;
-
-       case PIPE_FORMAT_R32G32B32A32_UINT:
-       case PIPE_FORMAT_R32G32B32A32_USCALED:
-               return VFMT_UINT_32_32_32_32;
-
-       case PIPE_FORMAT_R32G32B32A32_SINT:
-       case PIPE_FORMAT_R32G32B32A32_SSCALED:
-               return VFMT_INT_32_32_32_32;
-
-/* 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;
-       }
-}
-
-/* convert pipe format to texture sampler format: */
-enum a3xx_tex_fmt
-fd3_pipe2tex(enum pipe_format format)
-{
-       switch (format) {
-       case PIPE_FORMAT_L8_UNORM:
-       case PIPE_FORMAT_A8_UNORM:
-       case PIPE_FORMAT_I8_UNORM:
-               return TFMT_NORM_UINT_8;
-
-       case PIPE_FORMAT_R8G8_UNORM:
-               return TFMT_NORM_UINT_8_8;
-
-       case PIPE_FORMAT_B8G8R8A8_UNORM:
-       case PIPE_FORMAT_B8G8R8X8_UNORM:
-       case PIPE_FORMAT_R8G8B8A8_UNORM:
-       case PIPE_FORMAT_R8G8B8X8_UNORM:
-       case PIPE_FORMAT_B8G8R8A8_SRGB:
-       case PIPE_FORMAT_B8G8R8X8_SRGB:
-       case PIPE_FORMAT_R8G8B8A8_SRGB:
-       case PIPE_FORMAT_R8G8B8X8_SRGB:
-               return TFMT_NORM_UINT_8_8_8_8;
-
-       case PIPE_FORMAT_Z24X8_UNORM:
-       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
-               return TFMT_NORM_UINT_X8Z24;
-
-       case PIPE_FORMAT_Z16_UNORM:
-               return TFMT_NORM_USHORT_Z16;
-
-       case PIPE_FORMAT_R16G16B16A16_FLOAT:
-       case PIPE_FORMAT_R16G16B16X16_FLOAT:
-               return TFMT_FLOAT_16_16_16_16;
-
-       case PIPE_FORMAT_R32G32B32A32_FLOAT:
-       case PIPE_FORMAT_R32G32B32X32_FLOAT:
-               return TFMT_FLOAT_32_32_32_32;
-
-       // TODO add more..
-
-       default:
-               return ~0;
-       }
-}
-
-enum a3xx_tex_fetchsize
-fd3_pipe2fetchsize(enum pipe_format format)
-{
-       switch (format) {
-       case PIPE_FORMAT_L8_UNORM:
-       case PIPE_FORMAT_A8_UNORM:
-       case PIPE_FORMAT_I8_UNORM:
-               return TFETCH_1_BYTE;
-
-       case PIPE_FORMAT_Z16_UNORM:
-               return TFETCH_2_BYTE;
-
-       case PIPE_FORMAT_B8G8R8A8_UNORM:
-       case PIPE_FORMAT_B8G8R8X8_UNORM:
-       case PIPE_FORMAT_R8G8B8A8_UNORM:
-       case PIPE_FORMAT_R8G8B8X8_UNORM:
-       case PIPE_FORMAT_B8G8R8A8_SRGB:
-       case PIPE_FORMAT_B8G8R8X8_SRGB:
-       case PIPE_FORMAT_R8G8B8A8_SRGB:
-       case PIPE_FORMAT_R8G8B8X8_SRGB:
-       case PIPE_FORMAT_Z24X8_UNORM:
-       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
-               return TFETCH_4_BYTE;
-
-       // TODO add more..
-
-       default:
-               return TFETCH_DISABLE;  /* safe default */
-       }
-}
-
-/* convert pipe format to MRT / copydest format used for render-target: */
-enum a3xx_color_fmt
-fd3_pipe2color(enum pipe_format format)
-{
-       switch (format) {
-       case PIPE_FORMAT_B8G8R8A8_UNORM:
-       case PIPE_FORMAT_B8G8R8X8_UNORM:
-       case PIPE_FORMAT_R8G8B8A8_UNORM:
-               return RB_R8G8B8A8_UNORM;
-
-       case PIPE_FORMAT_Z16_UNORM:
-               return RB_R8G8_UNORM;
-
-       case PIPE_FORMAT_Z24X8_UNORM:
-       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
-               /* for DEPTHX_24_8, blob driver also seems to use R8G8B8A8 fmt.. */
-               return RB_R8G8B8A8_UNORM;
-
-       case PIPE_FORMAT_R8_UNORM:
-       case PIPE_FORMAT_L8_UNORM:
-               return RB_R8_UNORM;
-
-       case PIPE_FORMAT_A8_UNORM:
-               return RB_A8_UNORM;
-
-       case PIPE_FORMAT_R16G16B16A16_FLOAT:
-       case PIPE_FORMAT_R16G16B16X16_FLOAT:
-               return RB_R16G16B16A16_FLOAT;
-
-       case PIPE_FORMAT_R32G32B32A32_FLOAT:
-       case PIPE_FORMAT_R32G32B32X32_FLOAT:
-               return RB_R32G32B32A32_FLOAT;
-
-       // TODO add more..
-
-       default:
-               return ~0;
-       }
-}
-
-/* we need to special case a bit the depth/stencil restore, because we are
- * using the texture sampler to blit into the depth/stencil buffer, *not*
- * into a color buffer.  Otherwise fd3_tex_swiz() will do the wrong thing,
- * as it is assuming that you are sampling into normal render target..
- */
-enum pipe_format
-fd3_gmem_restore_format(enum pipe_format format)
-{
-       switch (format) {
-       case PIPE_FORMAT_Z24X8_UNORM:
-       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
-               return PIPE_FORMAT_R8G8B8A8_UNORM;
-       case PIPE_FORMAT_Z16_UNORM:
-               return PIPE_FORMAT_R8G8_UNORM;
-       default:
-               return format;
-       }
-}
-
-enum a3xx_color_swap
-fd3_pipe2swap(enum pipe_format format)
-{
-       switch (format) {
-       case PIPE_FORMAT_B8G8R8A8_UNORM:
-       case PIPE_FORMAT_B8G8R8X8_UNORM:
-       case PIPE_FORMAT_B8G8R8A8_SRGB:
-       case PIPE_FORMAT_B8G8R8X8_SRGB:
-               return WXYZ;
-
-       case PIPE_FORMAT_A8R8G8B8_UNORM:
-       case PIPE_FORMAT_X8R8G8B8_UNORM:
-       case PIPE_FORMAT_A8R8G8B8_SRGB:
-       case PIPE_FORMAT_X8R8G8B8_SRGB:
-               return ZYXW;
-
-       case PIPE_FORMAT_A8B8G8R8_UNORM:
-       case PIPE_FORMAT_X8B8G8R8_UNORM:
-       case PIPE_FORMAT_A8B8G8R8_SRGB:
-       case PIPE_FORMAT_X8B8G8R8_SRGB:
-               return XYZW;
-
-       case PIPE_FORMAT_R8G8B8A8_UNORM:
-       case PIPE_FORMAT_R8G8B8X8_UNORM:
-       case PIPE_FORMAT_Z24X8_UNORM:
-       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
-       default:
-               return WZYX;
-       }
-}
-
-static inline enum a3xx_tex_swiz
-tex_swiz(unsigned swiz)
-{
-       switch (swiz) {
-       default:
-       case PIPE_SWIZZLE_RED:   return A3XX_TEX_X;
-       case PIPE_SWIZZLE_GREEN: return A3XX_TEX_Y;
-       case PIPE_SWIZZLE_BLUE:  return A3XX_TEX_Z;
-       case PIPE_SWIZZLE_ALPHA: return A3XX_TEX_W;
-       case PIPE_SWIZZLE_ZERO:  return A3XX_TEX_ZERO;
-       case PIPE_SWIZZLE_ONE:   return A3XX_TEX_ONE;
-       }
-}
-
-uint32_t
-fd3_tex_swiz(enum pipe_format format, unsigned swizzle_r, unsigned swizzle_g,
-               unsigned swizzle_b, unsigned swizzle_a)
-{
-       const struct util_format_description *desc =
-                       util_format_description(format);
-       unsigned char swiz[4] = {
-                       swizzle_r, swizzle_g, swizzle_b, swizzle_a,
-       }, rswiz[4];
-
-       util_format_compose_swizzles(desc->swizzle, swiz, rswiz);
-
-       return A3XX_TEX_CONST_0_SWIZ_X(tex_swiz(rswiz[0])) |
-                       A3XX_TEX_CONST_0_SWIZ_Y(tex_swiz(rswiz[1])) |
-                       A3XX_TEX_CONST_0_SWIZ_Z(tex_swiz(rswiz[2])) |
-                       A3XX_TEX_CONST_0_SWIZ_W(tex_swiz(rswiz[3]));
-}
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_util.h b/src/gallium/drivers/freedreno/a3xx/fd3_util.h
deleted file mode 100644 (file)
index 4681840..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2013 Rob Clark <robclark@freedesktop.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Authors:
- *    Rob Clark <robclark@freedesktop.org>
- */
-
-#ifndef FD3_UTIL_H_
-#define FD3_UTIL_H_
-
-#include "freedreno_util.h"
-
-#include "a3xx.xml.h"
-
-enum a3xx_vtx_fmt fd3_pipe2vtx(enum pipe_format format);
-enum a3xx_tex_fmt fd3_pipe2tex(enum pipe_format format);
-enum a3xx_tex_fetchsize fd3_pipe2fetchsize(enum pipe_format format);
-enum a3xx_color_fmt fd3_pipe2color(enum pipe_format format);
-enum pipe_format fd3_gmem_restore_format(enum pipe_format format);
-enum a3xx_color_swap fd3_pipe2swap(enum pipe_format format);
-
-uint32_t fd3_tex_swiz(enum pipe_format format, unsigned swizzle_r,
-               unsigned swizzle_g, unsigned swizzle_b, unsigned swizzle_a);
-
-#endif /* FD3_UTIL_H_ */
index c97cfb73695e63089c166ed78859ad2593b6a276..39471261c899a9aa716ccfe72129dd09b036a88d 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "fd3_zsa.h"
 #include "fd3_context.h"
-#include "fd3_util.h"
+#include "fd3_format.h"
 
 void *
 fd3_zsa_state_create(struct pipe_context *pctx,