• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright © 2022 Collabora Ltd.
3  * SPDX-License-Identifier: MIT
4  */
5 #ifndef NIL_FORMAT_H
6 #define NIL_FORMAT_H
7 
8 #include <assert.h>
9 #include <stdbool.h>
10 #include <stdint.h>
11 
12 #include "util/format/u_format.h"
13 
14 struct nv_device_info;
15 
16 /* We don't have our own format enum; we use PIPE_FORMAT for everything */
17 
18 bool nil_format_supports_texturing(struct nv_device_info *dev,
19                                    enum pipe_format format);
20 
21 bool nil_format_supports_filtering(struct nv_device_info *dev,
22                                    enum pipe_format format);
23 
24 bool nil_format_supports_buffer(struct nv_device_info *dev,
25                                 enum pipe_format format);
26 
27 bool nil_format_supports_storage(struct nv_device_info *dev,
28                                  enum pipe_format format);
29 
30 bool nil_format_supports_color_targets(struct nv_device_info *dev,
31                                        enum pipe_format format);
32 
33 bool nil_format_supports_blending(struct nv_device_info *dev,
34                                   enum pipe_format format);
35 
36 bool nil_format_supports_depth_stencil(struct nv_device_info *dev,
37                                        enum pipe_format format);
38 
39 uint8_t nil_format_to_color_target(enum pipe_format format);
40 
41 uint8_t nil_format_to_depth_stencil(enum pipe_format format);
42 
43 struct nil_tic_format {
44    unsigned comp_sizes:8;
45    unsigned type_r:3;
46    unsigned type_g:3;
47    unsigned type_b:3;
48    unsigned type_a:3;
49    unsigned src_x:3;
50    unsigned src_y:3;
51    unsigned src_z:3;
52    unsigned src_w:3;
53 };
54 
55 const struct nil_tic_format *
56 nil_tic_format_for_pipe(enum pipe_format format);
57 
58 #endif /* NIL_FORMAT_H */
59