Merge branch 'mesa_7_5_branch'
[mesa.git] / src / gallium / drivers / r300 / r300_debug.h
1 /*
2 * Copyright 2009 Corbin Simpson <MostAwesomeDude@gmail.com>
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 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE. */
22
23 #ifndef R300_DEBUG_H
24 #define R300_DEBUG_H
25
26 #include "r300_reg.h"
27 #include "r300_fs.h"
28 #include "r300_vs.h"
29
30 static char* r5xx_fs_swiz[] = {
31 " R",
32 " G",
33 " B",
34 " A",
35 " 0",
36 ".5",
37 " 1",
38 " U",
39 };
40
41 static char* r5xx_fs_op_rgb[] = {
42 "MAD",
43 "DP3",
44 "DP4",
45 "D2A",
46 "MIN",
47 "MAX",
48 "---",
49 "CND",
50 "CMP",
51 "FRC",
52 "SOP",
53 "MDH",
54 "MDV",
55 };
56
57 static char* r5xx_fs_op_alpha[] = {
58 "MAD",
59 " DP",
60 "MIN",
61 "MAX",
62 "---",
63 "CND",
64 "CMP",
65 "FRC",
66 "EX2",
67 "LN2",
68 "RCP",
69 "RSQ",
70 "SIN",
71 "COS",
72 "MDH",
73 "MDV",
74 };
75
76 static char* r5xx_fs_mask[] = {
77 "NONE",
78 "R ",
79 " G ",
80 "RG ",
81 " B ",
82 "R B ",
83 " GB ",
84 "RGB ",
85 " A",
86 "R A",
87 " G A",
88 "RG A",
89 " BA",
90 "R BA",
91 " GBA",
92 "RGBA",
93 };
94
95 static char* r5xx_fs_tex[] = {
96 " NOP",
97 " LD",
98 "TEXKILL",
99 " PROJ",
100 "LODBIAS",
101 " LOD",
102 " DXDY",
103 };
104
105 static char* r300_vs_ve_ops[] = {
106 /* R300 vector ops */
107 " VE_NO_OP",
108 " VE_DOT_PRODUCT",
109 " VE_MULTIPLY",
110 " VE_ADD",
111 " VE_MULTIPLY_ADD",
112 " VE_DISTANCE_FACTOR",
113 " VE_FRACTION",
114 " VE_MAXIMUM",
115 " VE_MINIMUM",
116 "VE_SET_GREATER_THAN_EQUAL",
117 " VE_SET_LESS_THAN",
118 " VE_MULTIPLYX2_ADD",
119 " VE_MULTIPLY_CLAMP",
120 " VE_FLT2FIX_DX",
121 " VE_FLT2FIX_DX_RND",
122 /* R500 vector ops */
123 " VE_PRED_SET_EQ_PUSH",
124 " VE_PRED_SET_GT_PUSH",
125 " VE_PRED_SET_GTE_PUSH",
126 " VE_PRED_SET_NEQ_PUSH",
127 " VE_COND_WRITE_EQ",
128 " VE_COND_WRITE_GT",
129 " VE_COND_WRITE_GTE",
130 " VE_COND_WRITE_NEQ",
131 " VE_SET_GREATER_THAN",
132 " VE_SET_EQUAL",
133 " VE_SET_NOT_EQUAL",
134 " (reserved)",
135 " (reserved)",
136 " (reserved)",
137 };
138
139 static char* r300_vs_me_ops[] = {
140 /* R300 math ops */
141 " ME_NO_OP",
142 " ME_EXP_BASE2_DX",
143 " ME_LOG_BASE2_DX",
144 " ME_EXP_BASEE_FF",
145 " ME_LIGHT_COEFF_DX",
146 " ME_POWER_FUNC_FF",
147 " ME_RECIP_DX",
148 " ME_RECIP_FF",
149 " ME_RECIP_SQRT_DX",
150 " ME_RECIP_SQRT_FF",
151 " ME_MULTIPLY",
152 " ME_EXP_BASE2_FULL_DX",
153 " ME_LOG_BASE2_FULL_DX",
154 " ME_POWER_FUNC_FF_CLAMP_B",
155 "ME_POWER_FUNC_FF_CLAMP_B1",
156 "ME_POWER_FUNC_FF_CLAMP_01",
157 " ME_SIN",
158 " ME_COS",
159 /* R500 math ops */
160 " ME_LOG_BASE2_IEEE",
161 " ME_RECIP_IEEE",
162 " ME_RECIP_SQRT_IEEE",
163 " ME_PRED_SET_EQ",
164 " ME_PRED_SET_GT",
165 " ME_PRED_SET_GTE",
166 " ME_PRED_SET_NEQ",
167 " ME_PRED_SET_CLR",
168 " ME_PRED_SET_INV",
169 " ME_PRED_SET_POP",
170 " ME_PRED_SET_RESTORE",
171 " (reserved)",
172 " (reserved)",
173 " (reserved)",
174 };
175
176 /* XXX refactor to avoid clashing symbols */
177 static char* r300_vs_src_debug[] = {
178 "t",
179 "i",
180 "c",
181 "a",
182 };
183
184 static char* r300_vs_dst_debug[] = {
185 "t",
186 "a0",
187 "o",
188 "ox",
189 "a",
190 "i",
191 "u",
192 "u",
193 };
194
195 static char* r300_vs_swiz_debug[] = {
196 "X",
197 "Y",
198 "Z",
199 "W",
200 "0",
201 "1",
202 "U",
203 "U",
204 };
205
206 void r5xx_fs_dump(struct r5xx_fragment_shader* fs);
207 void r3xx_dump_fs(struct r3xx_fragment_shader* fs);
208
209 void r300_vs_dump(struct r300_vertex_shader* vs);
210
211 #endif /* R300_DEBUG_H */