2 * Copyright (C) 2018-2019 Lima Project
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:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
27 static const char *PIPE_COMPARE_FUNC_STRING
[] = {
38 static const char *PIPE_STENCIL_OP_STRING
[] = {
49 static const char *PIPE_BLEND_FUNC_STRING
[] = {
51 "REV_SUBTRACT", /* 1 */
58 static const char *PIPE_BLENDFACTOR_STRING
[] = {
61 "CONST_COLOR", /* 2 */
66 "SRC_ALPHA_SAT", /* 7 */
67 "INV_SRC_COLOR", /* 8 */
68 "INV_DST_COLOR", /* 9 */
69 "INV_CONST_COLOR", /* 10 */
71 "UNKNOWN_12", /* 12 */
72 "UNKNOWN_13", /* 13 */
73 "UNKNOWN_14", /* 14 */
74 "UNKNOWN_15", /* 15 */
77 "CONST_ALPHA", /* 18 */
78 "UNKNOWN_19", /* 19 */
79 "UNKNOWN_20", /* 20 */
80 "UNKNOWN_21", /* 21 */
81 "UNKNOWN_22", /* 22 */
82 "UNKNOWN_23", /* 23 */
83 "INV_SRC_ALPHA", /* 24 */
84 "INV_DST_ALPHA", /* 25 */
85 "INV_CONST_ALPHA", /* 26 */
89 static inline const char
90 *lima_get_compare_func_string(int func
) {
91 if ((func
>= 0) && (func
<= 7))
92 return PIPE_COMPARE_FUNC_STRING
[func
];
97 static inline const char
98 *lima_get_stencil_op_string(int func
) {
99 if ((func
>= 0) && (func
<= 7))
100 return PIPE_STENCIL_OP_STRING
[func
];
105 static inline const char
106 *lima_get_blend_func_string(int func
) {
107 if ((func
>= 0) && (func
<= 5))
108 return PIPE_BLEND_FUNC_STRING
[func
];
113 static inline const char
114 *lima_get_blendfactor_string(int func
) {
115 if ((func
>= 0) && (func
<= 26))
116 return PIPE_BLENDFACTOR_STRING
[func
];
121 void lima_parse_vs(FILE *fp
, uint32_t *data
, int size
, uint32_t start
);
122 void lima_parse_plbu(FILE *fp
, uint32_t *data
, int size
, uint32_t start
);
123 void lima_parse_render_state(FILE *fp
, uint32_t *data
, int size
, uint32_t start
);
124 void lima_parse_texture_descriptor(FILE *fp
, uint32_t *data
, int size
, uint32_t start
, uint32_t offset
);