1638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol/**************************************************************************
2638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol *
3638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
4638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * All Rights Reserved.
5638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol *
6638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * Permission is hereby granted, free of charge, to any person obtaining a
7638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * copy of this software and associated documentation files (the
8638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * "Software"), to deal in the Software without restriction, including
9638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * without limitation the rights to use, copy, modify, merge, publish,
10638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * distribute, sub license, and/or sell copies of the Software, and to
11638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * permit persons to whom the Software is furnished to do so, subject to
12638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * the following conditions:
13638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol *
14638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * The above copyright notice and this permission notice (including the
15638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * next paragraph) shall be included in all copies or substantial portions
16638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * of the Software.
17638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol *
18638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol *
26638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol **************************************************************************/
27638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol
28638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol#ifndef TGSI_ITERATE_H
29638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol#define TGSI_ITERATE_H
30638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol
31638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol#include "pipe/p_shader_tokens.h"
32c208a2c791fa24c7c5887fc496738cbddbfafc72José Fonseca#include "tgsi/tgsi_parse.h"
33638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol
34638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol#if defined __cplusplus
35638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krolextern "C" {
36638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol#endif
37638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol
38638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krolstruct tgsi_iterate_context
39638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol{
40638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol   boolean
41638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol   (* prolog)(
42638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol      struct tgsi_iterate_context *ctx );
43638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol
44638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol   boolean
45638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol   (* iterate_instruction)(
46638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol      struct tgsi_iterate_context *ctx,
47638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol      struct tgsi_full_instruction *inst );
48638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol
49638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol   boolean
50638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol   (* iterate_declaration)(
51638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol      struct tgsi_iterate_context *ctx,
52638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol      struct tgsi_full_declaration *decl );
53638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol
54638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol   boolean
55638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol   (* iterate_immediate)(
56638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol      struct tgsi_iterate_context *ctx,
57638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol      struct tgsi_full_immediate *imm );
58638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol
59638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol   boolean
603ff688ea299581e60caf5d6e1a464f68c717fe83Zack Rusin   (* iterate_property)(
613ff688ea299581e60caf5d6e1a464f68c717fe83Zack Rusin      struct tgsi_iterate_context *ctx,
623ff688ea299581e60caf5d6e1a464f68c717fe83Zack Rusin      struct tgsi_full_property *prop );
633ff688ea299581e60caf5d6e1a464f68c717fe83Zack Rusin
643ff688ea299581e60caf5d6e1a464f68c717fe83Zack Rusin   boolean
65638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol   (* epilog)(
66638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol      struct tgsi_iterate_context *ctx );
6757482e1549e131fa1aebd442a677a95909b22508Michal Krol
6857482e1549e131fa1aebd442a677a95909b22508Michal Krol   struct tgsi_processor processor;
69638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol};
70638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol
71638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krolboolean
72638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Kroltgsi_iterate_shader(
73638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol   const struct tgsi_token *tokens,
74638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol   struct tgsi_iterate_context *ctx );
75638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol
76638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol#if defined __cplusplus
77638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol}
78638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol#endif
79638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol
80638ecbda3eed8319ce82be9c119ca1f96f21d976Michal Krol#endif /* TGSI_ITERATE_H */
81