1/**************************************************************************
2 *
3 * Copyright 2009 VMware, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28/**
29 * @file
30 * Dump data in human/machine readable format.
31 *
32 * @author Jose Fonseca <jfonseca@vmware.com>
33 */
34
35#ifndef U_DEBUG_DUMP_H_
36#define U_DEBUG_DUMP_H_
37
38
39#include "pipe/p_compiler.h"
40#include "pipe/p_state.h"
41
42#include <stdio.h>
43
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49
50#define UTIL_DUMP_INVALID_NAME "<invalid>"
51
52
53/*
54 * p_defines.h
55 */
56
57const char *
58util_str_blend_factor(unsigned value, boolean shortened);
59
60const char *
61util_str_blend_func(unsigned value, boolean shortened);
62
63const char *
64util_str_logicop(unsigned value, boolean shortened);
65
66const char *
67util_str_func(unsigned value, boolean shortened);
68
69const char *
70util_str_stencil_op(unsigned value, boolean shortened);
71
72const char *
73util_str_tex_target(unsigned value, boolean shortened);
74
75const char *
76util_str_tex_wrap(unsigned value, boolean shortened);
77
78const char *
79util_str_tex_mipfilter(unsigned value, boolean shortened);
80
81const char *
82util_str_tex_filter(unsigned value, boolean shortened);
83
84const char *
85util_str_query_type(unsigned value, boolean shortened);
86
87const char *
88util_str_query_value_type(unsigned value, boolean shortened);
89
90const char *
91util_str_prim_mode(unsigned value, boolean shortened);
92
93void
94util_dump_ns(FILE *f, uint64_t time);
95
96void
97util_dump_ptr(FILE *stream, const void *value);
98
99void
100util_dump_query_type(FILE *stream, unsigned value);
101
102void
103util_dump_query_value_type(FILE *stream, unsigned value);
104
105void
106util_dump_query_flags(FILE *stream, unsigned value);
107
108void
109util_dump_transfer_usage(FILE *stream, unsigned value);
110
111/*
112 * p_state.h, through a FILE
113 */
114
115void
116util_dump_resource(FILE *stream, const struct pipe_resource *state);
117
118void
119util_dump_rasterizer_state(FILE *stream,
120                           const struct pipe_rasterizer_state *state);
121
122void
123util_dump_poly_stipple(FILE *stream,
124                       const struct pipe_poly_stipple *state);
125
126void
127util_dump_viewport_state(FILE *stream,
128                         const struct pipe_viewport_state *state);
129
130void
131util_dump_scissor_state(FILE *stream,
132                        const struct pipe_scissor_state *state);
133
134void
135util_dump_clip_state(FILE *stream,
136                     const struct pipe_clip_state *state);
137
138void
139util_dump_stream_output_info(FILE *stream,
140                             const struct pipe_stream_output_info *state);
141
142void
143util_dump_shader_state(FILE *stream,
144                       const struct pipe_shader_state *state);
145
146void
147util_dump_depth_stencil_alpha_state(FILE *stream,
148                                    const struct pipe_depth_stencil_alpha_state *state);
149
150void
151util_dump_rt_blend_state(FILE *stream,
152                         const struct pipe_rt_blend_state *state);
153
154void
155util_dump_blend_state(FILE *stream,
156                      const struct pipe_blend_state *state);
157
158void
159util_dump_blend_color(FILE *stream,
160                      const struct pipe_blend_color *state);
161
162void
163util_dump_stencil_ref(FILE *stream,
164                      const struct pipe_stencil_ref *state);
165
166void
167util_dump_framebuffer_state(FILE *stream,
168                            const struct pipe_framebuffer_state *state);
169
170void
171util_dump_sampler_state(FILE *stream,
172                        const struct pipe_sampler_state *state);
173
174void
175util_dump_surface(FILE *stream,
176                  const struct pipe_surface *state);
177
178void
179util_dump_image_view(FILE *stream, const struct pipe_image_view *state);
180
181void
182util_dump_shader_buffer(FILE *stream, const struct pipe_shader_buffer *state);
183
184void
185util_dump_sampler_view(FILE *stream, const struct pipe_sampler_view *state);
186
187void
188util_dump_transfer(FILE *stream,
189                   const struct pipe_transfer *state);
190
191void
192util_dump_constant_buffer(FILE *stream,
193                          const struct pipe_constant_buffer *state);
194
195void
196util_dump_vertex_buffer(FILE *stream,
197                        const struct pipe_vertex_buffer *state);
198
199void
200util_dump_vertex_element(FILE *stream,
201                         const struct pipe_vertex_element *state);
202
203void
204util_dump_stream_output_target(FILE *stream,
205                               const struct pipe_stream_output_target *state);
206
207void
208util_dump_draw_info(FILE *stream, const struct pipe_draw_info *state);
209
210void
211util_dump_draw_start_count_bias(FILE *stream, const struct pipe_draw_start_count_bias *state);
212
213void
214util_dump_draw_indirect_info(FILE *stream,
215                             const struct pipe_draw_indirect_info *indirect);
216
217void
218util_dump_grid_info(FILE *stream, const struct pipe_grid_info *state);
219
220void
221util_dump_box(FILE *stream, const struct pipe_box *box);
222
223void
224util_dump_blit_info(FILE *stream, const struct pipe_blit_info *info);
225
226/* FIXME: Move the other debug_dump_xxx functions out of u_debug.h into here. */
227
228
229#ifdef __cplusplus
230}
231#endif
232
233#endif /* U_DEBUG_H_ */
234