1 /* 2 * Copyright © 2016 Red Hat. 3 * Copyright © 2016 Bas Nieuwenhuizen 4 * SPDX-License-Identifier: MIT 5 * 6 * based in part on anv driver which is: 7 * Copyright © 2015 Intel Corporation 8 */ 9 10 #ifndef TU_FORMATS_H 11 #define TU_FORMATS_H 12 13 #include "tu_common.h" 14 15 struct tu_native_format 16 { 17 enum a6xx_format fmt : 8; 18 enum a3xx_color_swap swap : 8; 19 enum a6xx_tile_mode tile_mode : 8; 20 }; 21 22 enum pipe_format tu_vk_format_to_pipe_format(VkFormat vk_format); 23 bool tu6_format_vtx_supported(VkFormat format); 24 struct tu_native_format tu6_format_vtx(VkFormat format); 25 bool tu6_format_color_supported(enum pipe_format format); 26 struct tu_native_format tu6_format_color(enum pipe_format format, enum a6xx_tile_mode tile_mode); 27 bool tu6_format_texture_supported(enum pipe_format format); 28 struct tu_native_format tu6_format_texture(enum pipe_format format, enum a6xx_tile_mode tile_mode); 29 30 static inline enum a6xx_format tu6_base_format(enum pipe_format format)31tu6_base_format(enum pipe_format format) 32 { 33 /* note: tu6_format_color doesn't care about tiling for .fmt field */ 34 return tu6_format_color(format, TILE6_LINEAR).fmt; 35 } 36 37 #endif /* TU_FORMATS_H */ 38