2 * Copyright (C) 2008 Nicolai Haehnle.
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial
16 * portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 #ifndef __RADEON_PROGRAM_H_
29 #define __RADEON_PROGRAM_H_
34 #include "shader/program.h"
35 #include "shader/prog_instruction.h"
45 * A clause is simply a sequence of instructions that are executed
48 struct radeon_clause
{
50 * Type of this clause, one of CLAUSE_XXX.
55 * Pointer to an array of instructions.
56 * The array is terminated by an OPCODE_END instruction.
58 struct prog_instruction
*Instructions
;
61 * Number of instructions in this clause.
66 * Space reserved for instructions in this clause.
68 int ReservedInstructions
;
72 * A compile object, holding the current intermediate state during compilation.
74 struct radeon_compiler
{
75 struct gl_program
*Source
;
79 * Number of clauses in this program.
84 * Pointer to an array of NumClauses clauses.
86 struct radeon_clause
*Clauses
;
89 * Number of registers in the PROGRAM_TEMPORARIES file.
94 void radeonCompilerInit(
95 struct radeon_compiler
*compiler
,
97 struct gl_program
*source
);
98 void radeonCompilerCleanup(struct radeon_compiler
*compiler
);
99 int radeonCompilerAllocateTemporary(struct radeon_compiler
*compiler
);
101 struct radeon_clause
*radeonCompilerInsertClause(
102 struct radeon_compiler
*compiler
,
105 void radeonCompilerEraseClauses(
106 struct radeon_compiler
*compiler
,