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