2 * Copyright (C) 2009 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_CONSTANTS_H
29 #define RADEON_PROGRAM_CONSTANTS_H
34 RC_SATURATE_MINUS_PLUS_ONE
49 * Used to indicate unused register descriptions and
50 * source register that use a constant swizzle.
58 * \note The compiler attaches no implicit semantics to input registers.
59 * Fragment/vertex program specific semantics must be defined explicitly
60 * using the appropriate compiler interfaces.
67 * \note The compiler attaches no implicit semantics to input registers.
68 * Fragment/vertex program specific semantics must be defined explicitly
69 * using the appropriate compiler interfaces.
75 * Indicates a constant from the \ref rc_constant_list .
80 * Indicates a special register, see RC_SPECIAL_xxx.
86 /** R500 fragment program ALU result "register" */
87 RC_SPECIAL_ALU_RESULT
= 0,
90 RC_NUM_SPECIAL_REGISTERS
93 #define RC_REGISTER_INDEX_BITS 10
94 #define RC_REGISTER_MAX_INDEX (1 << RC_REGISTER_INDEX_BITS)
107 #define RC_MAKE_SWIZZLE(a,b,c,d) (((a)<<0) | ((b)<<3) | ((c)<<6) | ((d)<<9))
108 #define RC_MAKE_SWIZZLE_SMEAR(a) RC_MAKE_SWIZZLE((a),(a),(a),(a))
109 #define GET_SWZ(swz, idx) (((swz) >> ((idx)*3)) & 0x7)
110 #define GET_BIT(msk, idx) (((msk) >> (idx)) & 0x1)
111 #define SET_SWZ(swz, idx, newv) \
113 (swz) = ((swz) & ~(7 << ((idx)*3))) | ((newv) << ((idx)*3)); \
116 #define RC_SWIZZLE_XYZW RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_W)
117 #define RC_SWIZZLE_XXXX RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_X)
118 #define RC_SWIZZLE_YYYY RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Y)
119 #define RC_SWIZZLE_ZZZZ RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Z)
120 #define RC_SWIZZLE_WWWW RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_W)
121 #define RC_SWIZZLE_0000 RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_ZERO)
122 #define RC_SWIZZLE_1111 RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_ONE)
125 * \name Bitmasks for components of vectors.
127 * Used for write masks, negation masks, etc.
130 #define RC_MASK_NONE 0
135 #define RC_MASK_XY (RC_MASK_X|RC_MASK_Y)
136 #define RC_MASK_XYZ (RC_MASK_X|RC_MASK_Y|RC_MASK_Z)
137 #define RC_MASK_XYW (RC_MASK_X|RC_MASK_Y|RC_MASK_W)
138 #define RC_MASK_XYZW (RC_MASK_X|RC_MASK_Y|RC_MASK_Z|RC_MASK_W)
142 RC_ALURESULT_NONE
= 0,
145 } rc_write_aluresult
;
147 #endif /* RADEON_PROGRAM_CONSTANTS_H */