freedreno/a4xx: fd4_util -> fd4_format
authorRob Clark <robclark@freedesktop.org>
Wed, 3 Dec 2014 23:02:38 +0000 (18:02 -0500)
committerRob Clark <robclark@freedesktop.org>
Thu, 4 Dec 2014 21:01:37 +0000 (16:01 -0500)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
17 files changed:
src/gallium/drivers/freedreno/Makefile.sources
src/gallium/drivers/freedreno/a4xx/fd4_blend.c
src/gallium/drivers/freedreno/a4xx/fd4_draw.c
src/gallium/drivers/freedreno/a4xx/fd4_emit.c
src/gallium/drivers/freedreno/a4xx/fd4_emit.h
src/gallium/drivers/freedreno/a4xx/fd4_format.c [new file with mode: 0644]
src/gallium/drivers/freedreno/a4xx/fd4_format.h [new file with mode: 0644]
src/gallium/drivers/freedreno/a4xx/fd4_gmem.c
src/gallium/drivers/freedreno/a4xx/fd4_program.c
src/gallium/drivers/freedreno/a4xx/fd4_query.c
src/gallium/drivers/freedreno/a4xx/fd4_rasterizer.c
src/gallium/drivers/freedreno/a4xx/fd4_screen.c
src/gallium/drivers/freedreno/a4xx/fd4_texture.c
src/gallium/drivers/freedreno/a4xx/fd4_texture.h
src/gallium/drivers/freedreno/a4xx/fd4_util.c [deleted file]
src/gallium/drivers/freedreno/a4xx/fd4_util.h [deleted file]
src/gallium/drivers/freedreno/a4xx/fd4_zsa.c

index 81019dbfbfa0700af59d7a903a33864b093fbe42..4f7a053114297e3b72eadddfe2c973244fb6ef02 100644 (file)
@@ -99,6 +99,8 @@ a4xx_SOURCES := \
        a4xx/fd4_draw.h \
        a4xx/fd4_emit.c \
        a4xx/fd4_emit.h \
+       a4xx/fd4_format.c \
+       a4xx/fd4_format.h \
        a4xx/fd4_gmem.c \
        a4xx/fd4_gmem.h \
        a4xx/fd4_program.c \
@@ -111,8 +113,6 @@ a4xx_SOURCES := \
        a4xx/fd4_screen.h \
        a4xx/fd4_texture.c \
        a4xx/fd4_texture.h \
-       a4xx/fd4_util.c \
-       a4xx/fd4_util.h \
        a4xx/fd4_zsa.c \
        a4xx/fd4_zsa.h
 
index bf2254a8ae0102b55af573195e45c8fec1b02e1a..b2d494930c46375384b1204d51992197281df27b 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "fd4_blend.h"
 #include "fd4_context.h"
-#include "fd4_util.h"
+#include "fd4_format.h"
 
 static enum a4xx_rb_blend_opcode
 blend_func(unsigned func)
index 9a586c8806b70bff0bdd223cbe4b92159682d038..aa3df9fc57bb8d3fbee580e1aa405ce5f2b182ff 100644 (file)
@@ -38,7 +38,7 @@
 #include "fd4_context.h"
 #include "fd4_emit.h"
 #include "fd4_program.h"
-#include "fd4_util.h"
+#include "fd4_format.h"
 #include "fd4_zsa.h"
 
 
index a1f53cfb89e1b43e2d69c241c37139abec79af51..c7be161a073f4895ed28315b5f722345576c808f 100644 (file)
@@ -40,7 +40,7 @@
 #include "fd4_program.h"
 #include "fd4_rasterizer.h"
 #include "fd4_texture.h"
-#include "fd4_util.h"
+#include "fd4_format.h"
 #include "fd4_zsa.h"
 
 /* regid:          base const register
index d133f011e98fc6cec9e7e18a6aacb240768868e7..cdfa0f4c53a154786c72b2769850a04697a1fa10 100644 (file)
@@ -32,7 +32,7 @@
 #include "pipe/p_context.h"
 
 #include "freedreno_context.h"
-#include "fd4_util.h"
+#include "fd4_format.h"
 #include "fd4_program.h"
 #include "ir3_shader.h"
 
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_format.c b/src/gallium/drivers/freedreno/a4xx/fd4_format.c
new file mode 100644 (file)
index 0000000..6b99a74
--- /dev/null
@@ -0,0 +1,421 @@
+/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
+
+/*
+ * Copyright (C) 2014 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 "fd4_format.h"
+
+/* convert pipe format to vertex buffer format: */
+enum a4xx_vtx_fmt
+fd4_pipe2vtx(enum pipe_format format)
+{
+       switch (format) {
+       /* 8-bit buffers. */
+       case PIPE_FORMAT_R8_UNORM:
+               return VFMT4_8_UNORM;
+
+       case PIPE_FORMAT_R8_SNORM:
+               return VFMT4_8_SNORM;
+
+       case PIPE_FORMAT_R8_UINT:
+       case PIPE_FORMAT_R8_USCALED:
+               return VFMT4_8_UINT;
+
+       case PIPE_FORMAT_R8_SINT:
+       case PIPE_FORMAT_R8_SSCALED:
+               return VFMT4_8_SINT;
+
+       /* 16-bit buffers. */
+       case PIPE_FORMAT_R16_UNORM:
+       case PIPE_FORMAT_Z16_UNORM:
+               return VFMT4_16_UNORM;
+
+       case PIPE_FORMAT_R16_SNORM:
+               return VFMT4_16_SNORM;
+
+       case PIPE_FORMAT_R16_UINT:
+       case PIPE_FORMAT_R16_USCALED:
+               return VFMT4_16_UINT;
+
+       case PIPE_FORMAT_R16_SINT:
+       case PIPE_FORMAT_R16_SSCALED:
+               return VFMT4_16_SINT;
+
+       case PIPE_FORMAT_R16_FLOAT:
+               return VFMT4_16_FLOAT;
+
+       case PIPE_FORMAT_R8G8_UNORM:
+               return VFMT4_8_8_UNORM;
+
+       case PIPE_FORMAT_R8G8_SNORM:
+               return VFMT4_8_8_SNORM;
+
+       case PIPE_FORMAT_R8G8_UINT:
+       case PIPE_FORMAT_R8G8_USCALED:
+               return VFMT4_8_8_UINT;
+
+       case PIPE_FORMAT_R8G8_SINT:
+       case PIPE_FORMAT_R8G8_SSCALED:
+               return VFMT4_8_8_SINT;
+
+       /* 24-bit buffers. */
+       case PIPE_FORMAT_R8G8B8_UNORM:
+               return VFMT4_8_8_8_UNORM;
+
+       case PIPE_FORMAT_R8G8B8_SNORM:
+               return VFMT4_8_8_8_SNORM;
+
+       case PIPE_FORMAT_R8G8B8_UINT:
+       case PIPE_FORMAT_R8G8B8_USCALED:
+               return VFMT4_8_8_8_UINT;
+
+       case PIPE_FORMAT_R8G8B8_SINT:
+       case PIPE_FORMAT_R8G8B8_SSCALED:
+               return VFMT4_8_8_8_SINT;
+
+       /* 32-bit buffers. */
+       case PIPE_FORMAT_A8B8G8R8_UNORM:
+       case PIPE_FORMAT_A8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
+       case PIPE_FORMAT_R8G8B8A8_UNORM:
+               return VFMT4_8_8_8_8_UNORM;
+
+       case PIPE_FORMAT_R8G8B8A8_SNORM:
+               return VFMT4_8_8_8_8_SNORM;
+
+       case PIPE_FORMAT_R8G8B8A8_UINT:
+       case PIPE_FORMAT_R8G8B8A8_USCALED:
+               return VFMT4_8_8_8_8_UINT;
+
+       case PIPE_FORMAT_R8G8B8A8_SINT:
+       case PIPE_FORMAT_R8G8B8A8_SSCALED:
+               return VFMT4_8_8_8_8_SINT;
+
+       case PIPE_FORMAT_R16G16_SSCALED:
+       case PIPE_FORMAT_R16G16_SINT:
+               return VFMT4_16_16_SINT;
+
+       case PIPE_FORMAT_R16G16_FLOAT:
+               return VFMT4_16_16_FLOAT;
+
+       case PIPE_FORMAT_R16G16_UINT:
+       case PIPE_FORMAT_R16G16_USCALED:
+               return VFMT4_16_16_UINT;
+
+       case PIPE_FORMAT_R16G16_UNORM:
+               return VFMT4_16_16_UNORM;
+
+       case PIPE_FORMAT_R16G16_SNORM:
+               return VFMT4_16_16_SNORM;
+
+       case PIPE_FORMAT_R10G10B10A2_UNORM:
+               return VFMT4_10_10_10_2_UNORM;
+
+       case PIPE_FORMAT_R10G10B10A2_SNORM:
+               return VFMT4_10_10_10_2_SNORM;
+
+       case PIPE_FORMAT_R10G10B10A2_UINT:
+       case PIPE_FORMAT_R10G10B10A2_USCALED:
+               return VFMT4_10_10_10_2_UINT;
+
+       case PIPE_FORMAT_R10G10B10A2_SSCALED:
+               return VFMT4_10_10_10_2_SINT;
+
+       /* 48-bit buffers. */
+       case PIPE_FORMAT_R16G16B16_FLOAT:
+               return VFMT4_16_16_16_FLOAT;
+
+       case PIPE_FORMAT_R16G16B16_SINT:
+       case PIPE_FORMAT_R16G16B16_SSCALED:
+               return VFMT4_16_16_16_SINT;
+
+       case PIPE_FORMAT_R16G16B16_UINT:
+       case PIPE_FORMAT_R16G16B16_USCALED:
+               return VFMT4_16_16_16_UINT;
+
+       case PIPE_FORMAT_R16G16B16_SNORM:
+               return VFMT4_16_16_16_SNORM;
+
+       case PIPE_FORMAT_R16G16B16_UNORM:
+               return VFMT4_16_16_16_UNORM;
+
+       case PIPE_FORMAT_R32_FLOAT:
+       case PIPE_FORMAT_Z32_FLOAT:
+               return VFMT4_32_FLOAT;
+
+       case PIPE_FORMAT_R32_FIXED:
+               return VFMT4_32_FIXED;
+
+       /* 64-bit buffers. */
+       case PIPE_FORMAT_R16G16B16A16_UNORM:
+               return VFMT4_16_16_16_16_UNORM;
+
+       case PIPE_FORMAT_R16G16B16A16_SNORM:
+               return VFMT4_16_16_16_16_SNORM;
+
+       case PIPE_FORMAT_R16G16B16A16_UINT:
+       case PIPE_FORMAT_R16G16B16A16_USCALED:
+               return VFMT4_16_16_16_16_UINT;
+
+       case PIPE_FORMAT_R16G16B16A16_SINT:
+       case PIPE_FORMAT_R16G16B16A16_SSCALED:
+               return VFMT4_16_16_16_16_SINT;
+
+       case PIPE_FORMAT_R32G32_FLOAT:
+               return VFMT4_32_32_FLOAT;
+
+       case PIPE_FORMAT_R32G32_FIXED:
+               return VFMT4_32_32_FIXED;
+
+       case PIPE_FORMAT_R16G16B16A16_FLOAT:
+               return VFMT4_16_16_16_16_FLOAT;
+
+       /* 96-bit buffers. */
+       case PIPE_FORMAT_R32G32B32_FLOAT:
+               return VFMT4_32_32_32_FLOAT;
+
+       case PIPE_FORMAT_R32G32B32_FIXED:
+               return VFMT4_32_32_32_FIXED;
+
+       /* 128-bit buffers. */
+       case PIPE_FORMAT_R32G32B32A32_FLOAT:
+               return VFMT4_32_32_32_32_FLOAT;
+
+       case PIPE_FORMAT_R32G32B32A32_FIXED:
+               return VFMT4_32_32_32_32_FIXED;
+
+/* 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_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_R32G32_SINT:
+       case PIPE_FORMAT_R32G32_UINT:
+       case PIPE_FORMAT_L32A32_UINT:
+       case PIPE_FORMAT_L32A32_SINT:
+*/
+
+       default:
+               return ~0;
+       }
+}
+
+/* convert pipe format to texture sampler format: */
+enum a4xx_tex_fmt
+fd4_pipe2tex(enum pipe_format format)
+{
+       switch (format) {
+       case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_A8_UNORM:
+       case PIPE_FORMAT_I8_UNORM:
+               return TFMT4_8_UNORM;
+
+       case PIPE_FORMAT_R8G8_UNORM:
+               return TFMT4_8_8_UNORM;
+
+       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 TFMT4_8_8_8_8_UNORM;
+
+       case PIPE_FORMAT_Z24X8_UNORM:
+               return TFMT4_X8Z24_UNORM;
+
+       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
+               return TFMT4_8_8_8_8_UNORM;
+
+//     case PIPE_FORMAT_Z16_UNORM:
+//             return TFMT4_NORM_UINT_8_8;
+//
+       case PIPE_FORMAT_R16G16B16A16_FLOAT:
+       case PIPE_FORMAT_R16G16B16X16_FLOAT:
+               return TFMT4_16_16_16_16_FLOAT;
+
+       case PIPE_FORMAT_R32G32B32A32_FLOAT:
+       case PIPE_FORMAT_R32G32B32X32_FLOAT:
+               return TFMT4_32_32_32_32_FLOAT;
+
+       // TODO add more..
+
+       default:
+               return ~0;
+       }
+}
+
+/* convert pipe format to MRT / copydest format used for render-target: */
+enum a4xx_color_fmt
+fd4_pipe2color(enum pipe_format format)
+{
+       switch (format) {
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
+       case PIPE_FORMAT_B8G8R8X8_UNORM:
+       case PIPE_FORMAT_R8G8B8A8_UNORM:
+               return RB4_R8G8B8A8_UNORM;
+
+       case PIPE_FORMAT_Z16_UNORM:
+               return RB4_Z16_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 RB4_R8G8B8A8_UNORM;
+
+       case PIPE_FORMAT_R8_UNORM:
+       case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_A8_UNORM:
+               return RB4_A8_UNORM;
+//
+//     case PIPE_FORMAT_R16G16B16A16_FLOAT:
+//     case PIPE_FORMAT_R16G16B16X16_FLOAT:
+//             return RB4_R16G16B16A16_FLOAT;
+//
+//     case PIPE_FORMAT_R32G32B32A32_FLOAT:
+//     case PIPE_FORMAT_R32G32B32X32_FLOAT:
+//             return RB4_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 fd4_tex_swiz() will do the wrong thing,
+ * as it is assuming that you are sampling into normal render target..
+ */
+enum pipe_format
+fd4_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;
+       }
+}
+
+/* TODO share w/ a3xx?? */
+enum a3xx_color_swap
+fd4_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;
+       }
+}
+
+enum a4xx_depth_format
+fd4_pipe2depth(enum pipe_format format)
+{
+       switch (format) {
+       case PIPE_FORMAT_Z16_UNORM:
+               return DEPTH4_16;
+       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
+       case PIPE_FORMAT_X8Z24_UNORM:
+       case PIPE_FORMAT_S8_UINT_Z24_UNORM:
+               return DEPTH4_24_8;
+       default:
+               return ~0;
+       }
+}
+
+static inline enum a4xx_tex_swiz
+tex_swiz(unsigned swiz)
+{
+       switch (swiz) {
+       default:
+       case PIPE_SWIZZLE_RED:   return A4XX_TEX_X;
+       case PIPE_SWIZZLE_GREEN: return A4XX_TEX_Y;
+       case PIPE_SWIZZLE_BLUE:  return A4XX_TEX_Z;
+       case PIPE_SWIZZLE_ALPHA: return A4XX_TEX_W;
+       case PIPE_SWIZZLE_ZERO:  return A4XX_TEX_ZERO;
+       case PIPE_SWIZZLE_ONE:   return A4XX_TEX_ONE;
+       }
+}
+
+uint32_t
+fd4_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 A4XX_TEX_CONST_0_SWIZ_X(tex_swiz(rswiz[0])) |
+                       A4XX_TEX_CONST_0_SWIZ_Y(tex_swiz(rswiz[1])) |
+                       A4XX_TEX_CONST_0_SWIZ_Z(tex_swiz(rswiz[2])) |
+                       A4XX_TEX_CONST_0_SWIZ_W(tex_swiz(rswiz[3]));
+}
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_format.h b/src/gallium/drivers/freedreno/a4xx/fd4_format.h
new file mode 100644 (file)
index 0000000..5d6d1ae
--- /dev/null
@@ -0,0 +1,46 @@
+/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
+
+/*
+ * Copyright (C) 2014 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 FD4_UTIL_H_
+#define FD4_UTIL_H_
+
+#include "freedreno_util.h"
+
+#include "a4xx.xml.h"
+
+enum a4xx_vtx_fmt fd4_pipe2vtx(enum pipe_format format);
+enum a4xx_tex_fmt fd4_pipe2tex(enum pipe_format format);
+enum a4xx_color_fmt fd4_pipe2color(enum pipe_format format);
+enum pipe_format fd4_gmem_restore_format(enum pipe_format format);
+enum a3xx_color_swap fd4_pipe2swap(enum pipe_format format);
+enum a4xx_depth_format fd4_pipe2depth(enum pipe_format format);
+
+uint32_t fd4_tex_swiz(enum pipe_format format, unsigned swizzle_r,
+               unsigned swizzle_g, unsigned swizzle_b, unsigned swizzle_a);
+
+#endif /* FD4_UTIL_H_ */
index ce0a8c14d34320fd0400f6f81ecb18197ea1be38..89ae260c855a93801ab39db53c9224aba2e8adf8 100644 (file)
@@ -41,7 +41,7 @@
 #include "fd4_draw.h"
 #include "fd4_emit.h"
 #include "fd4_program.h"
-#include "fd4_util.h"
+#include "fd4_format.h"
 #include "fd4_zsa.h"
 
 static const struct ir3_shader_key key = {
index 651828018953bd5e885945eea4be61bbeb55a0e9..e085d88f0c17d2d631db11ce22dd059fcad90e13 100644 (file)
@@ -39,7 +39,7 @@
 #include "fd4_program.h"
 #include "fd4_emit.h"
 #include "fd4_texture.h"
-#include "fd4_util.h"
+#include "fd4_format.h"
 
 static void
 delete_shader_stateobj(struct fd4_shader_stateobj *so)
index 9a50626aaeb14cb2a11ae11f02d43623cc0996b9..6db1c11b94ba49f3c1f2c91ac760fdeb56178fbf 100644 (file)
@@ -31,7 +31,7 @@
 #include "freedreno_util.h"
 
 #include "fd4_query.h"
-#include "fd4_util.h"
+#include "fd4_format.h"
 
 void fd4_query_context_init(struct pipe_context *pctx)
 {
index b363cb79a28c86c395c826f6dfee13fa595f818e..e54b606a285b02d56970d5fb1bddfe448109622a 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "fd4_rasterizer.h"
 #include "fd4_context.h"
-#include "fd4_util.h"
+#include "fd4_format.h"
 
 void *
 fd4_rasterizer_state_create(struct pipe_context *pctx,
index df5ac6e6cadc959b164d38593b63c5481c5f4632..cf697d4b741b1fc2e1084476760fb82e88faa807 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "fd4_screen.h"
 #include "fd4_context.h"
-#include "fd4_util.h"
+#include "fd4_format.h"
 
 static boolean
 fd4_screen_is_format_supported(struct pipe_screen *pscreen,
index 6523c71e4c18cc84e4824e9b5cca75918998c05c..2b826d6325d84d604745d2908cd4ccab7c63b22e 100644 (file)
@@ -33,7 +33,7 @@
 #include "util/u_format.h"
 
 #include "fd4_texture.h"
-#include "fd4_util.h"
+#include "fd4_format.h"
 
 /* TODO do we need to emulate clamp-to-edge like a3xx? */
 static enum a4xx_tex_clamp
index 3592b1049b12bd5e169276112192a61d8189813d..07eb961eb8fb67c38a65d7cd8349734b4b7fa0f4 100644 (file)
@@ -35,7 +35,7 @@
 #include "freedreno_resource.h"
 
 #include "fd4_context.h"
-#include "fd4_util.h"
+#include "fd4_format.h"
 
 struct fd4_sampler_stateobj {
        struct pipe_sampler_state base;
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_util.c b/src/gallium/drivers/freedreno/a4xx/fd4_util.c
deleted file mode 100644 (file)
index 2dd0e7f..0000000
+++ /dev/null
@@ -1,421 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2014 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 "fd4_util.h"
-
-/* convert pipe format to vertex buffer format: */
-enum a4xx_vtx_fmt
-fd4_pipe2vtx(enum pipe_format format)
-{
-       switch (format) {
-       /* 8-bit buffers. */
-       case PIPE_FORMAT_R8_UNORM:
-               return VFMT4_8_UNORM;
-
-       case PIPE_FORMAT_R8_SNORM:
-               return VFMT4_8_SNORM;
-
-       case PIPE_FORMAT_R8_UINT:
-       case PIPE_FORMAT_R8_USCALED:
-               return VFMT4_8_UINT;
-
-       case PIPE_FORMAT_R8_SINT:
-       case PIPE_FORMAT_R8_SSCALED:
-               return VFMT4_8_SINT;
-
-       /* 16-bit buffers. */
-       case PIPE_FORMAT_R16_UNORM:
-       case PIPE_FORMAT_Z16_UNORM:
-               return VFMT4_16_UNORM;
-
-       case PIPE_FORMAT_R16_SNORM:
-               return VFMT4_16_SNORM;
-
-       case PIPE_FORMAT_R16_UINT:
-       case PIPE_FORMAT_R16_USCALED:
-               return VFMT4_16_UINT;
-
-       case PIPE_FORMAT_R16_SINT:
-       case PIPE_FORMAT_R16_SSCALED:
-               return VFMT4_16_SINT;
-
-       case PIPE_FORMAT_R16_FLOAT:
-               return VFMT4_16_FLOAT;
-
-       case PIPE_FORMAT_R8G8_UNORM:
-               return VFMT4_8_8_UNORM;
-
-       case PIPE_FORMAT_R8G8_SNORM:
-               return VFMT4_8_8_SNORM;
-
-       case PIPE_FORMAT_R8G8_UINT:
-       case PIPE_FORMAT_R8G8_USCALED:
-               return VFMT4_8_8_UINT;
-
-       case PIPE_FORMAT_R8G8_SINT:
-       case PIPE_FORMAT_R8G8_SSCALED:
-               return VFMT4_8_8_SINT;
-
-       /* 24-bit buffers. */
-       case PIPE_FORMAT_R8G8B8_UNORM:
-               return VFMT4_8_8_8_UNORM;
-
-       case PIPE_FORMAT_R8G8B8_SNORM:
-               return VFMT4_8_8_8_SNORM;
-
-       case PIPE_FORMAT_R8G8B8_UINT:
-       case PIPE_FORMAT_R8G8B8_USCALED:
-               return VFMT4_8_8_8_UINT;
-
-       case PIPE_FORMAT_R8G8B8_SINT:
-       case PIPE_FORMAT_R8G8B8_SSCALED:
-               return VFMT4_8_8_8_SINT;
-
-       /* 32-bit buffers. */
-       case PIPE_FORMAT_A8B8G8R8_UNORM:
-       case PIPE_FORMAT_A8R8G8B8_UNORM:
-       case PIPE_FORMAT_B8G8R8A8_UNORM:
-       case PIPE_FORMAT_R8G8B8A8_UNORM:
-               return VFMT4_8_8_8_8_UNORM;
-
-       case PIPE_FORMAT_R8G8B8A8_SNORM:
-               return VFMT4_8_8_8_8_SNORM;
-
-       case PIPE_FORMAT_R8G8B8A8_UINT:
-       case PIPE_FORMAT_R8G8B8A8_USCALED:
-               return VFMT4_8_8_8_8_UINT;
-
-       case PIPE_FORMAT_R8G8B8A8_SINT:
-       case PIPE_FORMAT_R8G8B8A8_SSCALED:
-               return VFMT4_8_8_8_8_SINT;
-
-       case PIPE_FORMAT_R16G16_SSCALED:
-       case PIPE_FORMAT_R16G16_SINT:
-               return VFMT4_16_16_SINT;
-
-       case PIPE_FORMAT_R16G16_FLOAT:
-               return VFMT4_16_16_FLOAT;
-
-       case PIPE_FORMAT_R16G16_UINT:
-       case PIPE_FORMAT_R16G16_USCALED:
-               return VFMT4_16_16_UINT;
-
-       case PIPE_FORMAT_R16G16_UNORM:
-               return VFMT4_16_16_UNORM;
-
-       case PIPE_FORMAT_R16G16_SNORM:
-               return VFMT4_16_16_SNORM;
-
-       case PIPE_FORMAT_R10G10B10A2_UNORM:
-               return VFMT4_10_10_10_2_UNORM;
-
-       case PIPE_FORMAT_R10G10B10A2_SNORM:
-               return VFMT4_10_10_10_2_SNORM;
-
-       case PIPE_FORMAT_R10G10B10A2_UINT:
-       case PIPE_FORMAT_R10G10B10A2_USCALED:
-               return VFMT4_10_10_10_2_UINT;
-
-       case PIPE_FORMAT_R10G10B10A2_SSCALED:
-               return VFMT4_10_10_10_2_SINT;
-
-       /* 48-bit buffers. */
-       case PIPE_FORMAT_R16G16B16_FLOAT:
-               return VFMT4_16_16_16_FLOAT;
-
-       case PIPE_FORMAT_R16G16B16_SINT:
-       case PIPE_FORMAT_R16G16B16_SSCALED:
-               return VFMT4_16_16_16_SINT;
-
-       case PIPE_FORMAT_R16G16B16_UINT:
-       case PIPE_FORMAT_R16G16B16_USCALED:
-               return VFMT4_16_16_16_UINT;
-
-       case PIPE_FORMAT_R16G16B16_SNORM:
-               return VFMT4_16_16_16_SNORM;
-
-       case PIPE_FORMAT_R16G16B16_UNORM:
-               return VFMT4_16_16_16_UNORM;
-
-       case PIPE_FORMAT_R32_FLOAT:
-       case PIPE_FORMAT_Z32_FLOAT:
-               return VFMT4_32_FLOAT;
-
-       case PIPE_FORMAT_R32_FIXED:
-               return VFMT4_32_FIXED;
-
-       /* 64-bit buffers. */
-       case PIPE_FORMAT_R16G16B16A16_UNORM:
-               return VFMT4_16_16_16_16_UNORM;
-
-       case PIPE_FORMAT_R16G16B16A16_SNORM:
-               return VFMT4_16_16_16_16_SNORM;
-
-       case PIPE_FORMAT_R16G16B16A16_UINT:
-       case PIPE_FORMAT_R16G16B16A16_USCALED:
-               return VFMT4_16_16_16_16_UINT;
-
-       case PIPE_FORMAT_R16G16B16A16_SINT:
-       case PIPE_FORMAT_R16G16B16A16_SSCALED:
-               return VFMT4_16_16_16_16_SINT;
-
-       case PIPE_FORMAT_R32G32_FLOAT:
-               return VFMT4_32_32_FLOAT;
-
-       case PIPE_FORMAT_R32G32_FIXED:
-               return VFMT4_32_32_FIXED;
-
-       case PIPE_FORMAT_R16G16B16A16_FLOAT:
-               return VFMT4_16_16_16_16_FLOAT;
-
-       /* 96-bit buffers. */
-       case PIPE_FORMAT_R32G32B32_FLOAT:
-               return VFMT4_32_32_32_FLOAT;
-
-       case PIPE_FORMAT_R32G32B32_FIXED:
-               return VFMT4_32_32_32_FIXED;
-
-       /* 128-bit buffers. */
-       case PIPE_FORMAT_R32G32B32A32_FLOAT:
-               return VFMT4_32_32_32_32_FLOAT;
-
-       case PIPE_FORMAT_R32G32B32A32_FIXED:
-               return VFMT4_32_32_32_32_FIXED;
-
-/* 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_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_R32G32_SINT:
-       case PIPE_FORMAT_R32G32_UINT:
-       case PIPE_FORMAT_L32A32_UINT:
-       case PIPE_FORMAT_L32A32_SINT:
-*/
-
-       default:
-               return ~0;
-       }
-}
-
-/* convert pipe format to texture sampler format: */
-enum a4xx_tex_fmt
-fd4_pipe2tex(enum pipe_format format)
-{
-       switch (format) {
-       case PIPE_FORMAT_L8_UNORM:
-       case PIPE_FORMAT_A8_UNORM:
-       case PIPE_FORMAT_I8_UNORM:
-               return TFMT4_8_UNORM;
-
-       case PIPE_FORMAT_R8G8_UNORM:
-               return TFMT4_8_8_UNORM;
-
-       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 TFMT4_8_8_8_8_UNORM;
-
-       case PIPE_FORMAT_Z24X8_UNORM:
-               return TFMT4_X8Z24_UNORM;
-
-       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
-               return TFMT4_8_8_8_8_UNORM;
-
-//     case PIPE_FORMAT_Z16_UNORM:
-//             return TFMT4_NORM_UINT_8_8;
-//
-       case PIPE_FORMAT_R16G16B16A16_FLOAT:
-       case PIPE_FORMAT_R16G16B16X16_FLOAT:
-               return TFMT4_16_16_16_16_FLOAT;
-
-       case PIPE_FORMAT_R32G32B32A32_FLOAT:
-       case PIPE_FORMAT_R32G32B32X32_FLOAT:
-               return TFMT4_32_32_32_32_FLOAT;
-
-       // TODO add more..
-
-       default:
-               return ~0;
-       }
-}
-
-/* convert pipe format to MRT / copydest format used for render-target: */
-enum a4xx_color_fmt
-fd4_pipe2color(enum pipe_format format)
-{
-       switch (format) {
-       case PIPE_FORMAT_B8G8R8A8_UNORM:
-       case PIPE_FORMAT_B8G8R8X8_UNORM:
-       case PIPE_FORMAT_R8G8B8A8_UNORM:
-               return RB4_R8G8B8A8_UNORM;
-
-       case PIPE_FORMAT_Z16_UNORM:
-               return RB4_Z16_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 RB4_R8G8B8A8_UNORM;
-
-       case PIPE_FORMAT_R8_UNORM:
-       case PIPE_FORMAT_L8_UNORM:
-       case PIPE_FORMAT_A8_UNORM:
-               return RB4_A8_UNORM;
-//
-//     case PIPE_FORMAT_R16G16B16A16_FLOAT:
-//     case PIPE_FORMAT_R16G16B16X16_FLOAT:
-//             return RB4_R16G16B16A16_FLOAT;
-//
-//     case PIPE_FORMAT_R32G32B32A32_FLOAT:
-//     case PIPE_FORMAT_R32G32B32X32_FLOAT:
-//             return RB4_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 fd4_tex_swiz() will do the wrong thing,
- * as it is assuming that you are sampling into normal render target..
- */
-enum pipe_format
-fd4_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;
-       }
-}
-
-/* TODO share w/ a3xx?? */
-enum a3xx_color_swap
-fd4_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;
-       }
-}
-
-enum a4xx_depth_format
-fd4_pipe2depth(enum pipe_format format)
-{
-       switch (format) {
-       case PIPE_FORMAT_Z16_UNORM:
-               return DEPTH4_16;
-       case PIPE_FORMAT_Z24X8_UNORM:
-       case PIPE_FORMAT_Z24_UNORM_S8_UINT:
-       case PIPE_FORMAT_X8Z24_UNORM:
-       case PIPE_FORMAT_S8_UINT_Z24_UNORM:
-               return DEPTH4_24_8;
-       default:
-               return ~0;
-       }
-}
-
-static inline enum a4xx_tex_swiz
-tex_swiz(unsigned swiz)
-{
-       switch (swiz) {
-       default:
-       case PIPE_SWIZZLE_RED:   return A4XX_TEX_X;
-       case PIPE_SWIZZLE_GREEN: return A4XX_TEX_Y;
-       case PIPE_SWIZZLE_BLUE:  return A4XX_TEX_Z;
-       case PIPE_SWIZZLE_ALPHA: return A4XX_TEX_W;
-       case PIPE_SWIZZLE_ZERO:  return A4XX_TEX_ZERO;
-       case PIPE_SWIZZLE_ONE:   return A4XX_TEX_ONE;
-       }
-}
-
-uint32_t
-fd4_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 A4XX_TEX_CONST_0_SWIZ_X(tex_swiz(rswiz[0])) |
-                       A4XX_TEX_CONST_0_SWIZ_Y(tex_swiz(rswiz[1])) |
-                       A4XX_TEX_CONST_0_SWIZ_Z(tex_swiz(rswiz[2])) |
-                       A4XX_TEX_CONST_0_SWIZ_W(tex_swiz(rswiz[3]));
-}
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_util.h b/src/gallium/drivers/freedreno/a4xx/fd4_util.h
deleted file mode 100644 (file)
index 5d6d1ae..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2014 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 FD4_UTIL_H_
-#define FD4_UTIL_H_
-
-#include "freedreno_util.h"
-
-#include "a4xx.xml.h"
-
-enum a4xx_vtx_fmt fd4_pipe2vtx(enum pipe_format format);
-enum a4xx_tex_fmt fd4_pipe2tex(enum pipe_format format);
-enum a4xx_color_fmt fd4_pipe2color(enum pipe_format format);
-enum pipe_format fd4_gmem_restore_format(enum pipe_format format);
-enum a3xx_color_swap fd4_pipe2swap(enum pipe_format format);
-enum a4xx_depth_format fd4_pipe2depth(enum pipe_format format);
-
-uint32_t fd4_tex_swiz(enum pipe_format format, unsigned swizzle_r,
-               unsigned swizzle_g, unsigned swizzle_b, unsigned swizzle_a);
-
-#endif /* FD4_UTIL_H_ */
index 59942dceb9e787b4fe04fbb0b73c33ac4d32219a..da0c2b748fed9fd85922697dd055af757fd4bca0 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "fd4_zsa.h"
 #include "fd4_context.h"
-#include "fd4_util.h"
+#include "fd4_format.h"
 
 void *
 fd4_zsa_state_create(struct pipe_context *pctx,