13464ebd5Sriastradh/* 23464ebd5Sriastradh * Mesa 3-D graphics library 33464ebd5Sriastradh * 43464ebd5Sriastradh * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. 53464ebd5Sriastradh * 63464ebd5Sriastradh * Permission is hereby granted, free of charge, to any person obtaining a 73464ebd5Sriastradh * copy of this software and associated documentation files (the "Software"), 83464ebd5Sriastradh * to deal in the Software without restriction, including without limitation 93464ebd5Sriastradh * the rights to use, copy, modify, merge, publish, distribute, sublicense, 103464ebd5Sriastradh * and/or sell copies of the Software, and to permit persons to whom the 113464ebd5Sriastradh * Software is furnished to do so, subject to the following conditions: 123464ebd5Sriastradh * 133464ebd5Sriastradh * The above copyright notice and this permission notice shall be included 143464ebd5Sriastradh * in all copies or substantial portions of the Software. 153464ebd5Sriastradh * 163464ebd5Sriastradh * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 173464ebd5Sriastradh * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 183464ebd5Sriastradh * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20af69d88dSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21af69d88dSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22af69d88dSmrg * OTHER DEALINGS IN THE SOFTWARE. 233464ebd5Sriastradh */ 243464ebd5Sriastradh 253464ebd5Sriastradh 263464ebd5Sriastradh#ifndef PROG_PRINT_H 273464ebd5Sriastradh#define PROG_PRINT_H 283464ebd5Sriastradh 293464ebd5Sriastradh#include <stdio.h> 303464ebd5Sriastradh 313464ebd5Sriastradh#include "main/glheader.h" 3201e04c3fSmrg#include "prog_parameter.h" 3301e04c3fSmrg 3401e04c3fSmrg 3501e04c3fSmrg#ifdef __cplusplus 3601e04c3fSmrgextern "C" { 3701e04c3fSmrg#endif 3801e04c3fSmrg 393464ebd5Sriastradh 403464ebd5Sriastradhstruct gl_program; 413464ebd5Sriastradhstruct gl_program_parameter_list; 423464ebd5Sriastradhstruct gl_shader; 433464ebd5Sriastradhstruct prog_instruction; 443464ebd5Sriastradh 453464ebd5Sriastradh 463464ebd5Sriastradh/** 473464ebd5Sriastradh * The output style to use when printing programs. 483464ebd5Sriastradh */ 493464ebd5Sriastradhtypedef enum { 503464ebd5Sriastradh PROG_PRINT_ARB, 513464ebd5Sriastradh PROG_PRINT_DEBUG 523464ebd5Sriastradh} gl_prog_print_mode; 533464ebd5Sriastradh 543464ebd5Sriastradh 553464ebd5Sriastradhextern const char * 563464ebd5Sriastradh_mesa_register_file_name(gl_register_file f); 573464ebd5Sriastradh 583464ebd5Sriastradhextern void 593464ebd5Sriastradh_mesa_print_vp_inputs(GLbitfield inputs); 603464ebd5Sriastradh 613464ebd5Sriastradhextern void 623464ebd5Sriastradh_mesa_print_fp_inputs(GLbitfield inputs); 633464ebd5Sriastradh 643464ebd5Sriastradhextern const char * 653464ebd5Sriastradh_mesa_condcode_string(GLuint condcode); 663464ebd5Sriastradh 673464ebd5Sriastradhextern const char * 683464ebd5Sriastradh_mesa_swizzle_string(GLuint swizzle, GLuint negateBase, GLboolean extended); 693464ebd5Sriastradh 703464ebd5Sriastradhconst char * 713464ebd5Sriastradh_mesa_writemask_string(GLuint writeMask); 723464ebd5Sriastradh 733464ebd5Sriastradhextern void 743464ebd5Sriastradh_mesa_print_swizzle(GLuint swizzle); 753464ebd5Sriastradh 763464ebd5Sriastradhextern void 773464ebd5Sriastradh_mesa_fprint_alu_instruction(FILE *f, 783464ebd5Sriastradh const struct prog_instruction *inst, 793464ebd5Sriastradh const char *opcode_string, GLuint numRegs, 803464ebd5Sriastradh gl_prog_print_mode mode, 813464ebd5Sriastradh const struct gl_program *prog); 823464ebd5Sriastradh 833464ebd5Sriastradhextern void 843464ebd5Sriastradh_mesa_print_alu_instruction(const struct prog_instruction *inst, 853464ebd5Sriastradh const char *opcode_string, GLuint numRegs); 863464ebd5Sriastradh 873464ebd5Sriastradhextern void 883464ebd5Sriastradh_mesa_print_instruction(const struct prog_instruction *inst); 893464ebd5Sriastradh 903464ebd5Sriastradhextern GLint 913464ebd5Sriastradh_mesa_fprint_instruction_opt(FILE *f, 923464ebd5Sriastradh const struct prog_instruction *inst, 933464ebd5Sriastradh GLint indent, 943464ebd5Sriastradh gl_prog_print_mode mode, 953464ebd5Sriastradh const struct gl_program *prog); 963464ebd5Sriastradh 973464ebd5Sriastradhextern GLint 983464ebd5Sriastradh_mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent, 993464ebd5Sriastradh gl_prog_print_mode mode, 1003464ebd5Sriastradh const struct gl_program *prog); 1013464ebd5Sriastradh 1023464ebd5Sriastradhextern void 1033464ebd5Sriastradh_mesa_print_program(const struct gl_program *prog); 1043464ebd5Sriastradh 1053464ebd5Sriastradhextern void 1063464ebd5Sriastradh_mesa_fprint_program_opt(FILE *f, 1073464ebd5Sriastradh const struct gl_program *prog, gl_prog_print_mode mode, 1083464ebd5Sriastradh GLboolean lineNumbers); 1093464ebd5Sriastradh 1103464ebd5Sriastradhextern void 1113464ebd5Sriastradh_mesa_print_program_parameters(struct gl_context *ctx, const struct gl_program *prog); 1123464ebd5Sriastradh 1133464ebd5Sriastradhextern void 1143464ebd5Sriastradh_mesa_print_parameter_list(const struct gl_program_parameter_list *list); 1153464ebd5Sriastradh 1163464ebd5Sriastradh 1173464ebd5Sriastradhextern void 1183464ebd5Sriastradh_mesa_write_shader_to_file(const struct gl_shader *shader); 1193464ebd5Sriastradh 1203464ebd5Sriastradhextern void 12101e04c3fSmrg_mesa_append_uniforms_to_file(const struct gl_program *prog); 12201e04c3fSmrg 12301e04c3fSmrg 12401e04c3fSmrg#ifdef __cplusplus 12501e04c3fSmrg} 12601e04c3fSmrg#endif 1273464ebd5Sriastradh 1283464ebd5Sriastradh 1293464ebd5Sriastradh#endif /* PROG_PRINT_H */ 130