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