/*
 * Copyright 1993-1998 NVIDIA, Corporation.  All rights reserved.
 * THE INFORMATION CONTAINED HEREIN IS PROPRIETARY AND CONFIDENTIAL TO
 * NVIDIA, CORPORATION.  USE, REPRODUCTION OR DISCLOSURE TO ANY THIRD PARTY
 * IS SUBJECT TO WRITTEN PRE-APPROVAL BY NVIDIA, CORPORATION.
 */
/********************************* Direct 3D *******************************\
*                                                                           *
* Module: NV4DBLND.H                                                        *
*   DX6 Class Blending definitions.                                         *
*                                                                           *
*****************************************************************************
*                                                                           *
* History:                                                                  *
*       Charles Inman (chasi)       09/09/98 - created.                     *
*                                                                           *
\***************************************************************************/

#ifndef _NV4DBLND_H_
#define _NV4DBLND_H_

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Combine1 Pass Thru
 */
#define DX6TRI_COMBINE1ALPHA_PASS_THRU                      \
    (DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_0,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_0, _INPUT)    \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_1,  _INVERSE)  \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_1, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_2,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_2, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_3,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_3, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _OPERATION,  _ADD))


#define DX6TRI_COMBINE1COLOR_PASS_THRU                      \
    (DRF_DEF(055, _COMBINE_1_COLOR, _INVERSE_0,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ALPHA_0,    _COLOR)    \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ARGUMENT_0, _INPUT)    \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _INVERSE_1,  _INVERSE)  \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ALPHA_1,    _COLOR)    \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ARGUMENT_1, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _INVERSE_2,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ALPHA_2,    _COLOR)    \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ARGUMENT_2, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _INVERSE_3,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ALPHA_3,    _COLOR)    \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ARGUMENT_3, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _OPERATION,  _ADD))

/*
 * Combine0 Disable
 */
#define DX6TRI_COMBINE0ALPHA_DISABLE                        \
    (DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_0,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_0, _DIFFUSE)  \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_1,  _INVERSE)  \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_1, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_2,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_2, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_3,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_3, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _OPERATION,  _ADD))

#define DX6TRI_COMBINE0COLOR_DISABLE                        \
    (DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_0,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_0,    _COLOR)    \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_0, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_1,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_1,    _COLOR)    \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_1, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_2,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_2,    _COLOR)    \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_2, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_3,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_3,    _COLOR)    \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_3, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _OPERATION,  _ADD))

/*
 * Combine1 Disable
 */
#define DX6TRI_COMBINE1ALPHA_DISABLE                        \
    (DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_0,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_0, _DIFFUSE)  \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_1,  _INVERSE)  \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_1, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_2,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_2, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_3,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_3, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _OPERATION,  _ADD))

#define DX6TRI_COMBINE1COLOR_DISABLE                        \
    (DRF_DEF(055, _COMBINE_1_COLOR, _INVERSE_0,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ALPHA_0,    _COLOR)    \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ARGUMENT_0, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _INVERSE_1,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ALPHA_1,    _COLOR)    \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ARGUMENT_1, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _INVERSE_2,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ALPHA_2,    _COLOR)    \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ARGUMENT_2, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _INVERSE_3,  _NORMAL)   \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ALPHA_3,    _COLOR)    \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _ARGUMENT_3, _ZERO)     \
  |  DRF_DEF(055, _COMBINE_1_COLOR, _OPERATION,  _ADD))

/*
 * Default Combiner setup.
 */
#define DX6TRI_COMBINE0ALPHA_DEFAULT    DX6TRI_COMBINE0ALPHA_DISABLE

#define DX6TRI_COMBINE0COLOR_DEFAULT                            \
    (DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_0,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_0,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_0, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_1,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_1,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_1, _DIFFUSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_2,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_3,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _OPERATION,  _ADD))

#define DX6TRI_COMBINE1ALPHA_DEFAULT                            \
    (DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_0,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_0, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_1,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_1, _INPUT)        \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _OPERATION,  _ADD))

#define DX6TRI_COMBINE1COLOR_DEFAULT    DX6TRI_COMBINE1COLOR_PASS_THRU

/*
 * Bump Mapping Combiner Setup.
 */
#define DX6TRI_COMBINE0ALPHA_BUMP                               \
    (DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_0,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_0, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_1,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_1, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_2, _TEXTURE1)     \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_3,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _OPERATION,  _ADDSIGNED))

#define DX6TRI_COMBINE0COLOR_BUMP                               \
    (DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_0,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_0,    _ALPHA)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_0, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_1,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_1,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_1, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_2,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_2,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_3,    _ALPHA)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_3, _TEXTURE1)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _OPERATION,  _ADDSIGNED2))

#define DX6TRI_COMBINE1ALPHA_BUMP                               \
    (DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_0,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_0, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_1,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_1, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_1_ALPHA, _OPERATION,  _ADD))

#define DX6TRI_COMBINE1COLOR_BUMP                               \
    (DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_0,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_0,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_0, _INPUT)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_1,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_1,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_1, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_2,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_2, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_3,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_3, _DIFFUSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _OPERATION,  _ADD))

/*
 * DX6 Triangle Class combiner mappings for TEXTUREMAPBLEND_DECAL
 * cPix = cTex
 * aPix = aTex
 */
#define DX6TRI_COMBINE0ALPHA_TBLEND_DECAL                       \
    (DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_0,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_0, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_1,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_1, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _OPERATION,  _ADD))

#define DX6TRI_COMBINE0COLOR_TBLEND_DECAL                       \
    (DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_0,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_0,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_0, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_1,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_1,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_1, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_2,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_3,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _OPERATION,  _ADD))

/*
 * DX6 Triangle Class combiner mappings for TEXTUREMAPBLEND_MODULATE
 * cPix = cTex * cSrc
 * aPix = aTex
 */
#define DX6TRI_COMBINE0ALPHA_TBLEND_MODULATE                    \
    (DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_0,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_0, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_1,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_1, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _OPERATION,  _ADD))

#define DX6TRI_COMBINE0COLOR_TBLEND_MODULATE                    \
    (DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_0,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_0,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_0, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_1,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_1,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_1, _DIFFUSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_2,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_3,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _OPERATION,  _ADD))

/*
 * DX6 Triangle Class combiner mappings for TEXTUREMAPBLEND_DECALALPHA
 * cPix = ((1 - aTex) * cSrc) + (aTex * cTex)
 * aPix = aSrc
 */
#define DX6TRI_COMBINE0ALPHA_TBLEND_DECALALPHA                  \
    (DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_0,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_0, _DIFFUSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_1,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_1, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _OPERATION,  _ADD))

#define DX6TRI_COMBINE0COLOR_TBLEND_DECALALPHA                  \
    (DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_0,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_0,    _ALPHA)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_0, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_1,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_1,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_1, _DIFFUSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_2,    _ALPHA)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_2, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_3,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_3, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _OPERATION,  _ADD))

/*
 * DX6 Triangle Class combiner mappings for TEXTUREMAPBLEND_MODULATEALPHA
 * cPix = cTex * cSrc
 * aPix = aTex * aSrc
 */
#define DX6TRI_COMBINE0ALPHA_TBLEND_MODULATEALPHA               \
    (DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_0,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_0, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_1,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_1, _DIFFUSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _OPERATION,  _ADD))

#define DX6TRI_COMBINE0COLOR_TBLEND_MODULATEALPHA               \
    (DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_0,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_0,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_0, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_1,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_1,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_1, _DIFFUSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_2,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_3,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _OPERATION,  _ADD))

/*
 * DX6 Triangle Class combiner mappings for TEXTUREMAPBLEND_DECALMASK
 * cPix = lsb(aTex) ? cTex : cSrc
 * aPix = aSrc
 */
#if 0
#define DX6TRI_COMBINE0ALPHA_TBLEND_DECALMASK                   \
    (DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_0,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_0, _DIFFUSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_1,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_1, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _OPERATION,  _ADD))
#else
#define DX6TRI_COMBINE0ALPHA_TBLEND_DECALMASK   DX6TRI_COMBINE0ALPHA_TBLEND_DECAL
#endif

#define DX6TRI_COMBINE0COLOR_TBLEND_DECALMASK   DX6TRI_COMBINE0COLOR_TBLEND_DECAL

/*
 * DX6 Triangle Class combiner mappings for TEXTUREMAPBLEND_MODULATEMASK
 * cPix = lsb(aTex) ? cTex * cSrc : cSrc
 * aPix = aSrc
 */
#if 0
#define DX6TRI_COMBINE0ALPHA_TBLEND_MODULATEMASK                \
    (DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_0,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_0, _DIFFUSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_1,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_1, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _OPERATION,  _ADD))
#else
#define DX6TRI_COMBINE0ALPHA_TBLEND_MODULATEMASK    DX6TRI_COMBINE0ALPHA_TBLEND_MODULATE
#endif

#define DX6TRI_COMBINE0COLOR_TBLEND_MODULATEMASK    DX6TRI_COMBINE0COLOR_TBLEND_MODULATE

/*
 * DX6 Triangle Class combiner mappings for TEXTUREMAPBLEND_COPY
 * cPix = cTex
 * aPix = aTex
 */
#define DX6TRI_COMBINE0ALPHA_TBLEND_COPY    DX6TRI_COMBINE0ALPHA_TBLEND_DECAL
#define DX6TRI_COMBINE0COLOR_TBLEND_COPY    DX6TRI_COMBINE0COLOR_TBLEND_DECAL

/*
 * DX6 Triangle Class combiner mappings for TEXTUREMAPBLEND_ADD
 * cPix = cTex + cSrc
 * aPix = aSrc
 */
#define DX6TRI_COMBINE0ALPHA_TBLEND_ADD                         \
    (DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_0,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_0, _DIFFUSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_1,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_1, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_2, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _INVERSE_3,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_ALPHA, _OPERATION,  _ADD))

#define DX6TRI_COMBINE0COLOR_TBLEND_ADD                         \
    (DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_0,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_0,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_0, _TEXTURE0)     \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_1,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_1,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_1, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_2,  _NORMAL)       \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_2,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_2, _DIFFUSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _INVERSE_3,  _INVERSE)      \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ALPHA_3,    _COLOR)        \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _ARGUMENT_3, _ZERO)         \
  |  DRF_DEF(055, _COMBINE_0_COLOR, _OPERATION,  _ADD))

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // _NV4DBLND_H_
