1 /* 2 * Copyright © 2016 Rob Clark <[email protected]> 3 * Copyright © 2018 Google, Inc. 4 * SPDX-License-Identifier: MIT 5 * 6 * Authors: 7 * Rob Clark <[email protected]> 8 */ 9 10 #ifndef FD6_FORMAT_TABLE_H 11 #define FD6_FORMAT_TABLE_H 12 13 #include "util/format/u_format.h" 14 #include "util/u_math.h" 15 16 #include "common/freedreno_common.h" 17 18 #include "adreno_pm4.xml.h" 19 #include "adreno_common.xml.h" 20 #include "a6xx.xml.h" 21 22 BEGINC; 23 24 static inline enum a6xx_tex_swiz fdl6_swiz(unsigned char swiz)25fdl6_swiz(unsigned char swiz) 26 { 27 STATIC_ASSERT((unsigned) A6XX_TEX_X == (unsigned) PIPE_SWIZZLE_X); 28 STATIC_ASSERT((unsigned) A6XX_TEX_Y == (unsigned) PIPE_SWIZZLE_Y); 29 STATIC_ASSERT((unsigned) A6XX_TEX_Z == (unsigned) PIPE_SWIZZLE_Z); 30 STATIC_ASSERT((unsigned) A6XX_TEX_W == (unsigned) PIPE_SWIZZLE_W); 31 STATIC_ASSERT((unsigned) A6XX_TEX_ZERO == (unsigned) PIPE_SWIZZLE_0); 32 STATIC_ASSERT((unsigned) A6XX_TEX_ONE == (unsigned) PIPE_SWIZZLE_1); 33 return (enum a6xx_tex_swiz) swiz; 34 } 35 36 enum a6xx_depth_format fd6_pipe2depth(enum pipe_format format); 37 38 enum a6xx_format fd6_vertex_format(enum pipe_format format) ATTRIBUTE_CONST; 39 enum a3xx_color_swap fd6_vertex_swap(enum pipe_format format) ATTRIBUTE_CONST; 40 enum a6xx_format fd6_texture_format(enum pipe_format format, 41 enum a6xx_tile_mode tile_mode) ATTRIBUTE_CONST; 42 enum a3xx_color_swap fd6_texture_swap(enum pipe_format format, 43 enum a6xx_tile_mode tile_mode) ATTRIBUTE_CONST; 44 enum a6xx_format fd6_color_format(enum pipe_format format, 45 enum a6xx_tile_mode tile_mode) ATTRIBUTE_CONST; 46 enum a3xx_color_swap fd6_color_swap(enum pipe_format format, 47 enum a6xx_tile_mode tile_mode) ATTRIBUTE_CONST; 48 49 ENDC; 50 51 #endif /* FD6_FORMAT_TABLE_H */ 52