prog_print.h revision af69d88d
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 "main/mtypes.h" 33 34struct gl_program; 35struct gl_program_parameter_list; 36struct gl_shader; 37struct prog_instruction; 38 39 40/** 41 * The output style to use when printing programs. 42 */ 43typedef enum { 44 PROG_PRINT_ARB, 45 PROG_PRINT_DEBUG 46} gl_prog_print_mode; 47 48 49extern const char * 50_mesa_register_file_name(gl_register_file f); 51 52extern void 53_mesa_print_vp_inputs(GLbitfield inputs); 54 55extern void 56_mesa_print_fp_inputs(GLbitfield inputs); 57 58extern const char * 59_mesa_condcode_string(GLuint condcode); 60 61extern const char * 62_mesa_swizzle_string(GLuint swizzle, GLuint negateBase, GLboolean extended); 63 64const char * 65_mesa_writemask_string(GLuint writeMask); 66 67extern void 68_mesa_print_swizzle(GLuint swizzle); 69 70extern void 71_mesa_fprint_alu_instruction(FILE *f, 72 const struct prog_instruction *inst, 73 const char *opcode_string, GLuint numRegs, 74 gl_prog_print_mode mode, 75 const struct gl_program *prog); 76 77extern void 78_mesa_print_alu_instruction(const struct prog_instruction *inst, 79 const char *opcode_string, GLuint numRegs); 80 81extern void 82_mesa_print_instruction(const struct prog_instruction *inst); 83 84extern GLint 85_mesa_fprint_instruction_opt(FILE *f, 86 const struct prog_instruction *inst, 87 GLint indent, 88 gl_prog_print_mode mode, 89 const struct gl_program *prog); 90 91extern GLint 92_mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent, 93 gl_prog_print_mode mode, 94 const struct gl_program *prog); 95 96extern void 97_mesa_print_program(const struct gl_program *prog); 98 99extern void 100_mesa_fprint_program_opt(FILE *f, 101 const struct gl_program *prog, gl_prog_print_mode mode, 102 GLboolean lineNumbers); 103 104extern void 105_mesa_print_program_parameters(struct gl_context *ctx, const struct gl_program *prog); 106 107extern void 108_mesa_print_parameter_list(const struct gl_program_parameter_list *list); 109 110 111extern void 112_mesa_write_shader_to_file(const struct gl_shader *shader); 113 114extern void 115_mesa_append_uniforms_to_file(const struct gl_shader *shader); 116 117 118#endif /* PROG_PRINT_H */ 119