1/*
2 * Mesa 3-D graphics library
3 *
4 * Copyright (C) 1999-2007  Brian Paul   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 "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25
26#ifndef PROG_PRINT_H
27#define PROG_PRINT_H
28
29#include <stdio.h>
30
31#include "main/glheader.h"
32#include "prog_parameter.h"
33
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39
40struct gl_program;
41struct gl_program_parameter_list;
42struct gl_shader;
43struct prog_instruction;
44
45
46/**
47 * The output style to use when printing programs.
48 */
49typedef enum {
50   PROG_PRINT_ARB,
51   PROG_PRINT_DEBUG
52} gl_prog_print_mode;
53
54
55extern const char *
56_mesa_register_file_name(gl_register_file f);
57
58extern void
59_mesa_print_vp_inputs(GLbitfield inputs);
60
61extern void
62_mesa_print_fp_inputs(GLbitfield inputs);
63
64extern const char *
65_mesa_condcode_string(GLuint condcode);
66
67extern const char *
68_mesa_swizzle_string(GLuint swizzle, GLuint negateBase, GLboolean extended);
69
70const char *
71_mesa_writemask_string(GLuint writeMask);
72
73extern void
74_mesa_print_swizzle(GLuint swizzle);
75
76extern void
77_mesa_fprint_alu_instruction(FILE *f,
78			     const struct prog_instruction *inst,
79			     const char *opcode_string, GLuint numRegs,
80			     gl_prog_print_mode mode,
81			     const struct gl_program *prog);
82
83extern void
84_mesa_print_alu_instruction(const struct prog_instruction *inst,
85                            const char *opcode_string, GLuint numRegs);
86
87extern void
88_mesa_print_instruction(const struct prog_instruction *inst);
89
90extern GLint
91_mesa_fprint_instruction_opt(FILE *f,
92                            const struct prog_instruction *inst,
93                            GLint indent,
94                            gl_prog_print_mode mode,
95                            const struct gl_program *prog);
96
97extern GLint
98_mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent,
99                            gl_prog_print_mode mode,
100                            const struct gl_program *prog);
101
102extern void
103_mesa_print_program(const struct gl_program *prog);
104
105extern void
106_mesa_fprint_program_opt(FILE *f,
107                         const struct gl_program *prog, gl_prog_print_mode mode,
108                         GLboolean lineNumbers);
109
110extern void
111_mesa_print_program_parameters(struct gl_context *ctx, const struct gl_program *prog);
112
113extern void
114_mesa_print_parameter_list(const struct gl_program_parameter_list *list);
115
116
117extern void
118_mesa_write_shader_to_file(const struct gl_shader *shader);
119
120extern void
121_mesa_append_uniforms_to_file(const struct gl_program *prog);
122
123
124#ifdef __cplusplus
125}
126#endif
127
128
129#endif /* PROG_PRINT_H */
130