2 Copyright (C) 2002 Rice1964
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef _COMBINER_DEFS_H_
21 #define _COMBINER_DEFS_H_
26 #define MUX_MASK_WITH_ALPHA 0x5F
27 #define MUX_MASK_WITH_NEG 0x3F
28 #define MUX_MASK_WITH_COMP 0x9F
48 MUX_UNK, //Use this if you want to factor to be set to 0
50 // Don't change value of these three flags, then need to be within 1 uint8
51 MUX_NEG = 0x20, //Support by NVidia register combiner
52 MUX_ALPHAREPLICATE = 0x40,
53 MUX_COMPLEMENT = 0x80,
59 enum CombinerFormatType
62 CM_FMT_TYPE_D, // = A can mapped to SEL(arg1)
63 CM_FMT_TYPE_A_MOD_C, // = A*C can mapped to MOD(arg1,arg2)
64 CM_FMT_TYPE_A_ADD_D, // = A+D can mapped to ADD(arg1,arg2)
65 CM_FMT_TYPE_A_SUB_B, // = A-B can mapped to SUB(arg1,arg2)
66 CM_FMT_TYPE_A_MOD_C_ADD_D, // = A*C+D can mapped to MULTIPLYADD(arg1,arg2,arg0)
67 CM_FMT_TYPE_A_LERP_B_C, // = (A-B)*C+B can mapped to LERP(arg1,arg2,arg0)
68 // or mapped to BLENDALPHA(arg1,arg2) if C is
69 // alpha channel or DIF, TEX, FAC, CUR
70 CM_FMT_TYPE_A_SUB_B_ADD_D, // = A-B+C can not map very well in 1 stage
71 CM_FMT_TYPE_A_SUB_B_MOD_C, // = (A-B)*C can not map very well in 1 stage
72 CM_FMT_TYPE_A_ADD_B_MOD_C, // = (A+B)*C can not map very well in 1 stage
73 CM_FMT_TYPE_A_B_C_D, // = (A-B)*C+D can not map very well in 1 stage
74 CM_FMT_TYPE_A_B_C_A, // = (A-B)*C+D can not map very well in 1 stage
76 // Don't use these two types in default functions
77 CM_FMT_TYPE_AB_ADD_CD, // = A*B+C*D Use by nvidia video cards
78 CM_FMT_TYPE_AB_SUB_CD, // = A*B-C*D Use by nvidia video cards
79 CM_FMT_TYPE_AB_ADD_C, // = A*B+C Use by ATI video cards
80 CM_FMT_TYPE_AB_SUB_C, // = A*B-C Use by ATI video cards
81 CM_FMT_TYPE_NOT_CHECKED = 0xFF,
109 #define CONST_FLAG4(a,b,c,d) (a|(b<<8)|(c<<16)|(d<<24)) //(A-B)*C+D
110 #define CONST_MOD(a,b) (a|(b<<16)) //A*B
111 #define CONST_SEL(a) (a<<24) //=D
112 #define CONST_ADD(a,b) (a|b<<24) //A+D
113 #define CONST_SUB(a,b) (a|b<<8) //A-B
114 #define CONST_MULADD(a,b,c) (a|b<<16|c<<24) //A*C+D
116 #define G_CCMUX_TEXEL1 2
117 #define G_ACMUX_TEXEL1 2
119 #define NOTUSED MUX_0
121 enum { TEX_0=0, TEX_1=1};