xref: /aosp_15_r20/external/mesa3d/src/util/texcompress_astc_luts_wrap.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright © 2022 Intel Corporation
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef TEXCOMPRESS_ASTC_LUTS_WRAP_H
24 #define TEXCOMPRESS_ASTC_LUTS_WRAP_H
25 
26 #include <stdint.h>
27 #include <stddef.h>
28 #include "format/u_formats.h"
29 
30 /* C wrapper for Granite::ASTCLutHolder. */
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 typedef struct
37 {
38    void *data;
39    size_t size_B;
40    enum pipe_format format;
41 } astc_decoder_lut;
42 
43 typedef struct
44 {
45    astc_decoder_lut color_endpoint;
46    astc_decoder_lut color_endpoint_unquant;
47    astc_decoder_lut weights;
48    astc_decoder_lut weights_unquant;
49    astc_decoder_lut trits_quints;
50 } astc_decoder_lut_holder;
51 
52 void _mesa_init_astc_decoder_luts(astc_decoder_lut_holder *holder);
53 void *_mesa_get_astc_decoder_partition_table(uint32_t block_width,
54                                              uint32_t block_height,
55                                              unsigned *lut_width,
56                                              unsigned *lut_height);
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 #endif
63