14a49301eSmrg/**************************************************************************
24a49301eSmrg *
3af69d88dSmrg * Copyright 2007-2008 VMware, Inc.
44a49301eSmrg * All Rights Reserved.
54a49301eSmrg *
64a49301eSmrg * Permission is hereby granted, free of charge, to any person obtaining a
74a49301eSmrg * copy of this software and associated documentation files (the
84a49301eSmrg * "Software"), to deal in the Software without restriction, including
94a49301eSmrg * without limitation the rights to use, copy, modify, merge, publish,
104a49301eSmrg * distribute, sub license, and/or sell copies of the Software, and to
114a49301eSmrg * permit persons to whom the Software is furnished to do so, subject to
124a49301eSmrg * the following conditions:
134a49301eSmrg *
144a49301eSmrg * The above copyright notice and this permission notice (including the
154a49301eSmrg * next paragraph) shall be included in all copies or substantial portions
164a49301eSmrg * of the Software.
174a49301eSmrg *
184a49301eSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
194a49301eSmrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
204a49301eSmrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21af69d88dSmrg * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
224a49301eSmrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
234a49301eSmrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
244a49301eSmrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
254a49301eSmrg *
264a49301eSmrg **************************************************************************/
274a49301eSmrg
284a49301eSmrg#ifndef TGSI_DUMP_H
294a49301eSmrg#define TGSI_DUMP_H
304a49301eSmrg
313464ebd5Sriastradh#include "pipe/p_compiler.h"
323464ebd5Sriastradh#include "pipe/p_defines.h"
334a49301eSmrg#include "pipe/p_shader_tokens.h"
344a49301eSmrg
3501e04c3fSmrg#include <stdio.h>
3601e04c3fSmrg
374a49301eSmrg#if defined __cplusplus
384a49301eSmrgextern "C" {
394a49301eSmrg#endif
404a49301eSmrg
4101e04c3fSmrg#define TGSI_DUMP_FLOAT_AS_HEX (1 << 0)
4201e04c3fSmrg
4301e04c3fSmrgbool
444a49301eSmrgtgsi_dump_str(
454a49301eSmrg   const struct tgsi_token *tokens,
464a49301eSmrg   uint flags,
474a49301eSmrg   char *str,
484a49301eSmrg   size_t size);
494a49301eSmrg
5001e04c3fSmrgvoid
5101e04c3fSmrgtgsi_dump_to_file(const struct tgsi_token *tokens, uint flags, FILE *file);
5201e04c3fSmrg
534a49301eSmrgvoid
544a49301eSmrgtgsi_dump(
554a49301eSmrg   const struct tgsi_token *tokens,
564a49301eSmrg   uint flags );
574a49301eSmrg
584a49301eSmrgstruct tgsi_full_immediate;
594a49301eSmrgstruct tgsi_full_instruction;
604a49301eSmrgstruct tgsi_full_declaration;
61cdc920a0Smrgstruct tgsi_full_property;
624a49301eSmrg
634a49301eSmrgvoid
644a49301eSmrgtgsi_dump_immediate(
654a49301eSmrg   const struct tgsi_full_immediate *imm );
664a49301eSmrg
67af69d88dSmrgvoid
68af69d88dSmrgtgsi_dump_instruction_str(
69af69d88dSmrg   const struct tgsi_full_instruction *inst,
70af69d88dSmrg   uint instno,
71af69d88dSmrg   char *str,
72af69d88dSmrg   size_t size);
73af69d88dSmrg
744a49301eSmrgvoid
754a49301eSmrgtgsi_dump_instruction(
764a49301eSmrg   const struct tgsi_full_instruction *inst,
774a49301eSmrg   uint instno );
784a49301eSmrg
794a49301eSmrgvoid
804a49301eSmrgtgsi_dump_declaration(
814a49301eSmrg   const struct tgsi_full_declaration *decl );
824a49301eSmrg
83cdc920a0Smrgvoid
84cdc920a0Smrgtgsi_dump_property(
85cdc920a0Smrg   const struct tgsi_full_property *prop );
86cdc920a0Smrg
874a49301eSmrg#if defined __cplusplus
884a49301eSmrg}
894a49301eSmrg#endif
904a49301eSmrg
914a49301eSmrg#endif /* TGSI_DUMP_H */
92