1 /* $Id: nvfragprog.h,v 1.1 2003/01/14 04:55:46 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 /* Private vertex program types and constants only used by files
29 * related to vertex programs.
39 /* Location of register sets within the whole register file */
40 #define FP_INPUT_REG_START 0
41 #define FP_INPUT_REG_END (FP_INPUT_REG_START + MAX_NV_FRAGMENT_PROGRAM_INPUTS - 1)
42 #define FP_OUTPUT_REG_START (FP_INPUT_REG_END + 1)
43 #define FP_OUTPUT_REG_END (FP_OUTPUT_REG_START + MAX_NV_FRAGMENT_PROGRAM_OUTPUTS - 1)
44 #define FP_TEMP_REG_START (FP_OUTPUT_REG_END + 1)
45 #define FP_TEMP_REG_END (FP_TEMP_REG_START + MAX_NV_FRAGMENT_PROGRAM_TEMPS - 1)
46 #define FP_PROG_REG_START (FP_TEMP_REG_END + 1)
47 #define FP_PROG_REG_END (FP_PROG_REG_START + MAX_NV_FRAGMENT_PROGRAM_PARAMS - 1)
48 #define FP_DUMMY_REG_START (FP_PROG_REG_END + 1)
49 #define FP_DUMMY_REG_END (FP_DUMMY_REG_START + MAX_NV_FRAGMENT_PROGRAM_WRITE_ONLYS - 1)
53 #define COND_GT 1 /* greater than zero */
54 #define COND_EQ 2 /* equal to zero */
55 #define COND_LT 3 /* less than zero */
56 #define COND_UN 4 /* unordered (NaN) */
57 #define COND_GE 5 /* greater then or equal to zero */
58 #define COND_LE 6 /* less then or equal to zero */
59 #define COND_NE 7 /* not equal to zero */
60 #define COND_TR 8 /* always true */
61 #define COND_FL 9 /* always false */
110 FP_OPCODE_END
/* private opcode */
114 struct fp_src_register
116 GLint RegType
; /* constant, param, temp or attribute register */
117 GLint Register
; /* or the offset from the address register */
119 GLboolean NegateBase
; /* negate before absolute value? */
120 GLboolean Abs
; /* take absolute value? */
121 GLboolean NegateAbs
; /* negate after absolute value? */
125 /* Instruction destination register */
126 struct fp_dst_register
129 GLboolean WriteMask
[4];
131 GLuint CondSwizzle
[4];
135 struct fp_instruction
137 enum fp_opcode Opcode
;
138 struct fp_src_register SrcReg
[3];
139 struct fp_dst_register DstReg
;
141 GLboolean UpdateCondRegister
;
142 GLuint Precision
; /* SINGLE, HALF or FIXED */
143 GLuint TexSrcUnit
; /* texture unit for TEX, TXD, TXP instructions */
144 GLenum TexSrcTarget
; /* texture target for TEX, TXD, TXP instructions */