Merge remote branch 'origin/master' into libdrm
authorKristian Høgsberg <krh@bitplanet.net>
Fri, 20 Nov 2009 22:09:03 +0000 (17:09 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 20 Nov 2009 22:09:03 +0000 (17:09 -0500)
1  2 
intel/intel_bufmgr.c
intel/intel_bufmgr.h
intel/intel_bufmgr_gem.c
intel/intel_bufmgr_priv.h
nouveau/nouveau_class.h
radeon/radeon_bo.h

diff --combined intel/intel_bufmgr.c
index 2469cd840c65bd65df718bc2a23520e7827442a4,618177392f95a7aecf69dbfc2b7116626202be2d..618177392f95a7aecf69dbfc2b7116626202be2d
@@@ -224,6 -224,13 +224,13 @@@ int drm_intel_bo_busy(drm_intel_bo *bo
        return 0;
  }
  
+ int drm_intel_bo_madvise(drm_intel_bo *bo, int madv)
+ {
+       if (bo->bufmgr->bo_madvise)
+               return bo->bufmgr->bo_madvise(bo, madv);
+       return -1;
+ }
  int drm_intel_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo)
  {
        return bo->bufmgr->bo_references(bo, target_bo);
diff --combined intel/intel_bufmgr.h
index 3801ff31a7f26448323ce070ee9bc40515f2444d,40984d32fcd88de5393bcf58f5751abd11a86ccb..40984d32fcd88de5393bcf58f5751abd11a86ccb
@@@ -119,6 -119,7 +119,7 @@@ int drm_intel_bo_get_tiling(drm_intel_b
                            uint32_t * swizzle_mode);
  int drm_intel_bo_flink(drm_intel_bo *bo, uint32_t * name);
  int drm_intel_bo_busy(drm_intel_bo *bo);
+ int drm_intel_bo_madvise(drm_intel_bo *bo, int madv);
  
  int drm_intel_bo_disable_reuse(drm_intel_bo *bo);
  int drm_intel_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo);
diff --combined intel/intel_bufmgr_gem.c
index 87795f33f7ecfb28025e0e2fe62cc44126b0ff21,9db7bfeb971f50778a341885830eaeee36c7d04e..9db7bfeb971f50778a341885830eaeee36c7d04e
@@@ -398,8 -398,8 +398,8 @@@ drm_intel_gem_bo_busy(drm_intel_bo *bo
  }
  
  static int
- drm_intel_gem_bo_madvise(drm_intel_bufmgr_gem *bufmgr_gem,
-                        drm_intel_bo_gem *bo_gem, int state)
+ drm_intel_gem_bo_madvise_internal(drm_intel_bufmgr_gem *bufmgr_gem,
+                                 drm_intel_bo_gem *bo_gem, int state)
  {
        struct drm_i915_gem_madvise madv;
  
        return madv.retained;
  }
  
+ static int
+ drm_intel_gem_bo_madvise(drm_intel_bo *bo, int madv)
+ {
+       return drm_intel_gem_bo_madvise_internal
+               ((drm_intel_bufmgr_gem *) bo->bufmgr,
+                (drm_intel_bo_gem *) bo,
+                madv);
+ }
  /* drop the oldest entries that have been purged by the kernel */
  static void
  drm_intel_gem_bo_cache_purge_bucket(drm_intel_bufmgr_gem *bufmgr_gem,
  
                bo_gem = DRMLISTENTRY(drm_intel_bo_gem,
                                      bucket->head.next, head);
-               if (drm_intel_gem_bo_madvise
+               if (drm_intel_gem_bo_madvise_internal
                    (bufmgr_gem, bo_gem, I915_MADV_DONTNEED))
                        break;
  
@@@ -493,7 -502,7 +502,7 @@@ retry
                }
  
                if (alloc_from_cache) {
-                       if (!drm_intel_gem_bo_madvise
+                       if (!drm_intel_gem_bo_madvise_internal
                            (bufmgr_gem, bo_gem, I915_MADV_WILLNEED)) {
                                drm_intel_gem_bo_free(&bo_gem->bo);
                                drm_intel_gem_bo_cache_purge_bucket(bufmgr_gem,
@@@ -742,8 -751,8 +751,8 @@@ drm_intel_gem_bo_unreference_final(drm_
  
                DRMLISTADDTAIL(&bo_gem->head, &bucket->head);
  
-               drm_intel_gem_bo_madvise(bufmgr_gem, bo_gem,
-                                        I915_MADV_DONTNEED);
+               drm_intel_gem_bo_madvise_internal(bufmgr_gem, bo_gem,
+                                                 I915_MADV_DONTNEED);
                drm_intel_gem_cleanup_bo_cache(bufmgr_gem, time);
        } else {
                drm_intel_gem_bo_free(bo);
@@@ -1703,6 -1712,7 +1712,7 @@@ drm_intel_bufmgr_gem_init(int fd, int b
        bufmgr_gem->bufmgr.bo_flink = drm_intel_gem_bo_flink;
        bufmgr_gem->bufmgr.bo_exec = drm_intel_gem_bo_exec;
        bufmgr_gem->bufmgr.bo_busy = drm_intel_gem_bo_busy;
+       bufmgr_gem->bufmgr.bo_madvise = drm_intel_gem_bo_madvise;
        bufmgr_gem->bufmgr.destroy = drm_intel_bufmgr_gem_destroy;
        bufmgr_gem->bufmgr.debug = 0;
        bufmgr_gem->bufmgr.check_aperture_space =
index 475c402fbaeb4bb540497bf6b0550b087bd9c5dd,febee0f7267267f441a1285ef2cbf08a131f1129..febee0f7267267f441a1285ef2cbf08a131f1129
@@@ -216,6 -216,20 +216,20 @@@ struct _drm_intel_bufmgr 
         */
        int (*bo_busy) (drm_intel_bo *bo);
  
+       /**
+        * Specify the volatility of the buffer.
+        * \param bo Buffer to create a name for
+        * \param madv The purgeable status
+        *
+        * Use I915_MADV_DONTNEED to mark the buffer as purgeable, and it will be
+        * reclaimed under memory pressure. If you subsequently require the buffer,
+        * then you must pass I915_MADV_WILLNEED to mark the buffer as required.
+        *
+        * Returns 1 if the buffer was retained, or 0 if it was discarded whilst
+        * marked as I915_MADV_DONTNEED.
+        */
+       int (*bo_madvise) (drm_intel_bo *bo, int madv);
        int (*check_aperture_space) (drm_intel_bo ** bo_array, int count);
  
        /**
diff --combined nouveau/nouveau_class.h
index c7dda02e248892a438b7fd0e11bb9d564ea2a9de,0b8a6f0198750bd49a7a66d41c18dced7b2ba6e5..0b8a6f0198750bd49a7a66d41c18dced7b2ba6e5
@@@ -1740,10 -1740,6 +1740,6 @@@ WITH THE SOFTWARE OR THE USE OR OTHER D
  #define   NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I5_MASK                 0x00f00000
  
  
- #define NV10_DX5_TEXTURED_TRIANGLE                                                    0x00000094
  #define NV10TCL                                                                               0x00000056
  
  #define  NV10TCL_NOP                                                                  0x00000100
  #define    NV10TCL_RC_IN_ALPHA_D_INPUT_SPARE1_NV                                      0x0000000d
  #define    NV10TCL_RC_IN_ALPHA_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                 0x0000000e
  #define    NV10TCL_RC_IN_ALPHA_D_INPUT_E_TIMES_F_NV                                   0x0000000f
+ #define    NV10TCL_RC_IN_ALPHA_D_INPUT_TEXTURE2_ARB                                   0x0000000a
+ #define    NV10TCL_RC_IN_ALPHA_D_INPUT_TEXTURE3_ARB                                   0x0000000b
  #define   NV10TCL_RC_IN_ALPHA_D_COMPONENT_USAGE                                               (1 <<  4)
  #define    NV10TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_BLUE                                 0x00000000
  #define    NV10TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_ALPHA                                        0x00000010
  #define    NV10TCL_RC_IN_ALPHA_C_INPUT_SPARE1_NV                                      0x00000d00
  #define    NV10TCL_RC_IN_ALPHA_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                 0x00000e00
  #define    NV10TCL_RC_IN_ALPHA_C_INPUT_E_TIMES_F_NV                                   0x00000f00
+ #define    NV10TCL_RC_IN_ALPHA_C_INPUT_TEXTURE2_ARB                                   0x00000a00
+ #define    NV10TCL_RC_IN_ALPHA_C_INPUT_TEXTURE3_ARB                                   0x00000b00
  #define   NV10TCL_RC_IN_ALPHA_C_COMPONENT_USAGE                                               (1 << 12)
  #define    NV10TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_BLUE                                 0x00000000
  #define    NV10TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_ALPHA                                        0x00001000
  #define    NV10TCL_RC_IN_ALPHA_B_INPUT_SPARE1_NV                                      0x000d0000
  #define    NV10TCL_RC_IN_ALPHA_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                 0x000e0000
  #define    NV10TCL_RC_IN_ALPHA_B_INPUT_E_TIMES_F_NV                                   0x000f0000
+ #define    NV10TCL_RC_IN_ALPHA_B_INPUT_TEXTURE2_ARB                                   0x000a0000
+ #define    NV10TCL_RC_IN_ALPHA_B_INPUT_TEXTURE3_ARB                                   0x000b0000
  #define   NV10TCL_RC_IN_ALPHA_B_COMPONENT_USAGE                                               (1 << 20)
  #define    NV10TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_BLUE                                 0x00000000
  #define    NV10TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_ALPHA                                        0x00100000
  #define    NV10TCL_RC_IN_ALPHA_A_INPUT_SPARE1_NV                                      0x0d000000
  #define    NV10TCL_RC_IN_ALPHA_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                 0x0e000000
  #define    NV10TCL_RC_IN_ALPHA_A_INPUT_E_TIMES_F_NV                                   0x0f000000
+ #define    NV10TCL_RC_IN_ALPHA_A_INPUT_TEXTURE2_ARB                                   0x0a000000
+ #define    NV10TCL_RC_IN_ALPHA_A_INPUT_TEXTURE3_ARB                                   0x0b000000
  #define   NV10TCL_RC_IN_ALPHA_A_COMPONENT_USAGE                                               (1 << 28)
  #define    NV10TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_BLUE                                 0x00000000
  #define    NV10TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_ALPHA                                        0x10000000
  #define    NV10TCL_RC_IN_RGB_D_INPUT_SPARE1_NV                                                0x0000000d
  #define    NV10TCL_RC_IN_RGB_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0000000e
  #define    NV10TCL_RC_IN_RGB_D_INPUT_E_TIMES_F_NV                                     0x0000000f
+ #define    NV10TCL_RC_IN_RGB_D_INPUT_TEXTURE2_ARB                                     0x0000000a
+ #define    NV10TCL_RC_IN_RGB_D_INPUT_TEXTURE3_ARB                                     0x0000000b
  #define   NV10TCL_RC_IN_RGB_D_COMPONENT_USAGE                                         (1 <<  4)
  #define    NV10TCL_RC_IN_RGB_D_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV10TCL_RC_IN_RGB_D_COMPONENT_USAGE_ALPHA                                  0x00000010
  #define    NV10TCL_RC_IN_RGB_C_INPUT_SPARE1_NV                                                0x00000d00
  #define    NV10TCL_RC_IN_RGB_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x00000e00
  #define    NV10TCL_RC_IN_RGB_C_INPUT_E_TIMES_F_NV                                     0x00000f00
+ #define    NV10TCL_RC_IN_RGB_C_INPUT_TEXTURE2_ARB                                     0x00000a00
+ #define    NV10TCL_RC_IN_RGB_C_INPUT_TEXTURE3_ARB                                     0x00000b00
  #define   NV10TCL_RC_IN_RGB_C_COMPONENT_USAGE                                         (1 << 12)
  #define    NV10TCL_RC_IN_RGB_C_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV10TCL_RC_IN_RGB_C_COMPONENT_USAGE_ALPHA                                  0x00001000
  #define    NV10TCL_RC_IN_RGB_B_INPUT_SPARE1_NV                                                0x000d0000
  #define    NV10TCL_RC_IN_RGB_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x000e0000
  #define    NV10TCL_RC_IN_RGB_B_INPUT_E_TIMES_F_NV                                     0x000f0000
+ #define    NV10TCL_RC_IN_RGB_B_INPUT_TEXTURE2_ARB                                     0x000a0000
+ #define    NV10TCL_RC_IN_RGB_B_INPUT_TEXTURE3_ARB                                     0x000b0000
  #define   NV10TCL_RC_IN_RGB_B_COMPONENT_USAGE                                         (1 << 20)
  #define    NV10TCL_RC_IN_RGB_B_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV10TCL_RC_IN_RGB_B_COMPONENT_USAGE_ALPHA                                  0x00100000
  #define    NV10TCL_RC_IN_RGB_A_INPUT_SPARE1_NV                                                0x0d000000
  #define    NV10TCL_RC_IN_RGB_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0e000000
  #define    NV10TCL_RC_IN_RGB_A_INPUT_E_TIMES_F_NV                                     0x0f000000
+ #define    NV10TCL_RC_IN_RGB_A_INPUT_TEXTURE2_ARB                                     0x0a000000
+ #define    NV10TCL_RC_IN_RGB_A_INPUT_TEXTURE3_ARB                                     0x0b000000
  #define   NV10TCL_RC_IN_RGB_A_COMPONENT_USAGE                                         (1 << 28)
  #define    NV10TCL_RC_IN_RGB_A_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV10TCL_RC_IN_RGB_A_COMPONENT_USAGE_ALPHA                                  0x10000000
  #define    NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE1_NV                                   0x0000000d
  #define    NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV              0x0000000e
  #define    NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_E_TIMES_F_NV                                        0x0000000f
+ #define    NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE2_ARB                                        0x0000000a
+ #define    NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE3_ARB                                        0x0000000b
  #define   NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SHIFT                                                4
  #define   NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_MASK                                         0x000000f0
  #define    NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_ZERO                                                0x00000000
  #define    NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE1_NV                                   0x000000d0
  #define    NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV              0x000000e0
  #define    NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_E_TIMES_F_NV                                        0x000000f0
+ #define    NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE2_ARB                                        0x000000a0
+ #define    NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE3_ARB                                        0x000000b0
  #define   NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SHIFT                                               8
  #define   NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_MASK                                                0x00000f00
  #define    NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_ZERO                                               0x00000000
  #define    NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE1_NV                                  0x00000d00
  #define    NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV             0x00000e00
  #define    NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_E_TIMES_F_NV                                       0x00000f00
+ #define    NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE2_ARB                                       0x00000a00
+ #define    NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE3_ARB                                       0x00000b00
  #define   NV10TCL_RC_OUT_ALPHA_CD_DOT_PRODUCT                                         (1 << 12)
  #define   NV10TCL_RC_OUT_ALPHA_AB_DOT_PRODUCT                                         (1 << 13)
  #define   NV10TCL_RC_OUT_ALPHA_MUX_SUM                                                        (1 << 14)
  #define    NV10TCL_RC_OUT_RGB_CD_OUTPUT_SPARE1_NV                                     0x0000000d
  #define    NV10TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                        0x0000000e
  #define    NV10TCL_RC_OUT_RGB_CD_OUTPUT_E_TIMES_F_NV                                  0x0000000f
+ #define    NV10TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE2_ARB                                  0x0000000a
+ #define    NV10TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE3_ARB                                  0x0000000b
  #define   NV10TCL_RC_OUT_RGB_AB_OUTPUT_SHIFT                                          4
  #define   NV10TCL_RC_OUT_RGB_AB_OUTPUT_MASK                                           0x000000f0
  #define    NV10TCL_RC_OUT_RGB_AB_OUTPUT_ZERO                                          0x00000000
  #define    NV10TCL_RC_OUT_RGB_AB_OUTPUT_SPARE1_NV                                     0x000000d0
  #define    NV10TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                        0x000000e0
  #define    NV10TCL_RC_OUT_RGB_AB_OUTPUT_E_TIMES_F_NV                                  0x000000f0
+ #define    NV10TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE2_ARB                                  0x000000a0
+ #define    NV10TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE3_ARB                                  0x000000b0
  #define   NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SHIFT                                         8
  #define   NV10TCL_RC_OUT_RGB_SUM_OUTPUT_MASK                                          0x00000f00
  #define    NV10TCL_RC_OUT_RGB_SUM_OUTPUT_ZERO                                         0x00000000
  #define    NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE1_NV                                    0x00000d00
  #define    NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                       0x00000e00
  #define    NV10TCL_RC_OUT_RGB_SUM_OUTPUT_E_TIMES_F_NV                                 0x00000f00
+ #define    NV10TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE2_ARB                                 0x00000a00
+ #define    NV10TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE3_ARB                                 0x00000b00
  #define   NV10TCL_RC_OUT_RGB_CD_DOT_PRODUCT                                           (1 << 12)
  #define   NV10TCL_RC_OUT_RGB_AB_DOT_PRODUCT                                           (1 << 13)
  #define   NV10TCL_RC_OUT_RGB_MUX_SUM                                                  (1 << 14)
  #define    NV10TCL_RC_FINAL0_D_INPUT_SPARE1_NV                                                0x0000000d
  #define    NV10TCL_RC_FINAL0_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0000000e
  #define    NV10TCL_RC_FINAL0_D_INPUT_E_TIMES_F_NV                                     0x0000000f
+ #define    NV10TCL_RC_FINAL0_D_INPUT_TEXTURE2_ARB                                     0x0000000a
+ #define    NV10TCL_RC_FINAL0_D_INPUT_TEXTURE3_ARB                                     0x0000000b
  #define   NV10TCL_RC_FINAL0_D_COMPONENT_USAGE                                         (1 <<  4)
  #define    NV10TCL_RC_FINAL0_D_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV10TCL_RC_FINAL0_D_COMPONENT_USAGE_ALPHA                                  0x00000010
  #define    NV10TCL_RC_FINAL0_C_INPUT_SPARE1_NV                                                0x00000d00
  #define    NV10TCL_RC_FINAL0_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x00000e00
  #define    NV10TCL_RC_FINAL0_C_INPUT_E_TIMES_F_NV                                     0x00000f00
+ #define    NV10TCL_RC_FINAL0_C_INPUT_TEXTURE2_ARB                                     0x00000a00
+ #define    NV10TCL_RC_FINAL0_C_INPUT_TEXTURE3_ARB                                     0x00000b00
  #define   NV10TCL_RC_FINAL0_C_COMPONENT_USAGE                                         (1 << 12)
  #define    NV10TCL_RC_FINAL0_C_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV10TCL_RC_FINAL0_C_COMPONENT_USAGE_ALPHA                                  0x00001000
  #define    NV10TCL_RC_FINAL0_B_INPUT_SPARE1_NV                                                0x000d0000
  #define    NV10TCL_RC_FINAL0_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x000e0000
  #define    NV10TCL_RC_FINAL0_B_INPUT_E_TIMES_F_NV                                     0x000f0000
+ #define    NV10TCL_RC_FINAL0_B_INPUT_TEXTURE2_ARB                                     0x000a0000
+ #define    NV10TCL_RC_FINAL0_B_INPUT_TEXTURE3_ARB                                     0x000b0000
  #define   NV10TCL_RC_FINAL0_B_COMPONENT_USAGE                                         (1 << 20)
  #define    NV10TCL_RC_FINAL0_B_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV10TCL_RC_FINAL0_B_COMPONENT_USAGE_ALPHA                                  0x00100000
  #define    NV10TCL_RC_FINAL0_A_INPUT_SPARE1_NV                                                0x0d000000
  #define    NV10TCL_RC_FINAL0_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0e000000
  #define    NV10TCL_RC_FINAL0_A_INPUT_E_TIMES_F_NV                                     0x0f000000
+ #define    NV10TCL_RC_FINAL0_A_INPUT_TEXTURE2_ARB                                     0x0a000000
+ #define    NV10TCL_RC_FINAL0_A_INPUT_TEXTURE3_ARB                                     0x0b000000
  #define   NV10TCL_RC_FINAL0_A_COMPONENT_USAGE                                         (1 << 28)
  #define    NV10TCL_RC_FINAL0_A_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV10TCL_RC_FINAL0_A_COMPONENT_USAGE_ALPHA                                  0x10000000
  #define    NV10TCL_RC_FINAL1_G_INPUT_SPARE1_NV                                                0x00000d00
  #define    NV10TCL_RC_FINAL1_G_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x00000e00
  #define    NV10TCL_RC_FINAL1_G_INPUT_E_TIMES_F_NV                                     0x00000f00
+ #define    NV10TCL_RC_FINAL1_G_INPUT_TEXTURE2_ARB                                     0x00000a00
+ #define    NV10TCL_RC_FINAL1_G_INPUT_TEXTURE3_ARB                                     0x00000b00
  #define   NV10TCL_RC_FINAL1_G_COMPONENT_USAGE                                         (1 << 12)
  #define    NV10TCL_RC_FINAL1_G_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV10TCL_RC_FINAL1_G_COMPONENT_USAGE_ALPHA                                  0x00001000
  #define    NV10TCL_RC_FINAL1_F_INPUT_SPARE1_NV                                                0x000d0000
  #define    NV10TCL_RC_FINAL1_F_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x000e0000
  #define    NV10TCL_RC_FINAL1_F_INPUT_E_TIMES_F_NV                                     0x000f0000
+ #define    NV10TCL_RC_FINAL1_F_INPUT_TEXTURE2_ARB                                     0x000a0000
+ #define    NV10TCL_RC_FINAL1_F_INPUT_TEXTURE3_ARB                                     0x000b0000
  #define   NV10TCL_RC_FINAL1_F_COMPONENT_USAGE                                         (1 << 20)
  #define    NV10TCL_RC_FINAL1_F_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV10TCL_RC_FINAL1_F_COMPONENT_USAGE_ALPHA                                  0x00100000
  #define    NV10TCL_RC_FINAL1_E_INPUT_SPARE1_NV                                                0x0d000000
  #define    NV10TCL_RC_FINAL1_E_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0e000000
  #define    NV10TCL_RC_FINAL1_E_INPUT_E_TIMES_F_NV                                     0x0f000000
+ #define    NV10TCL_RC_FINAL1_E_INPUT_TEXTURE2_ARB                                     0x0a000000
+ #define    NV10TCL_RC_FINAL1_E_INPUT_TEXTURE3_ARB                                     0x0b000000
  #define   NV10TCL_RC_FINAL1_E_COMPONENT_USAGE                                         (1 << 28)
  #define    NV10TCL_RC_FINAL1_E_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV10TCL_RC_FINAL1_E_COMPONENT_USAGE_ALPHA                                  0x10000000
  #define  NV10TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R                       0x000006c4
  #define  NV10TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G                       0x000006c8
  #define  NV10TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B                       0x000006cc
- #define  NV10TCL_VIEWPORT_SCALE_X                                                     0x000006e8
- #define  NV10TCL_VIEWPORT_SCALE_Y                                                     0x000006ec
- #define  NV10TCL_VIEWPORT_SCALE_Z                                                     0x000006f0
- #define  NV10TCL_VIEWPORT_SCALE_W                                                     0x000006f4
+ #define  NV10TCL_VIEWPORT_TRANSLATE_X                                                 0x000006e8
+ #define  NV10TCL_VIEWPORT_TRANSLATE_Y                                                 0x000006ec
+ #define  NV10TCL_VIEWPORT_TRANSLATE_Z                                                 0x000006f0
+ #define  NV10TCL_VIEWPORT_TRANSLATE_W                                                 0x000006f4
  #define  NV10TCL_POINT_PARAMETER(x)                                                   (0x000006f8+((x)*4))
  #define  NV10TCL_POINT_PARAMETER__SIZE                                                        0x00000008
  #define  NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(x)                                        (0x00000800+((x)*128))
  #define  NV10TCL_VERTEX_WGH_1F                                                                0x00000ce4
  #define  NV10TCL_EDGEFLAG_ENABLE                                                      0x00000cec
  #define  NV10TCL_VERTEX_ARRAY_VALIDATE                                                        0x00000cf0
- #define  NV10TCL_VERTEX_ARRAY_ATTRIB_OFFSET(x)                                                (0x00000d00+((x)*8))
- #define  NV10TCL_VERTEX_ARRAY_ATTRIB_OFFSET__SIZE                                     0x00000008
- #define  NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT(x)                                                (0x00000d04+((x)*8))
- #define  NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT__SIZE                                     0x00000008
- #define   NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_TYPE_SHIFT                                       0
- #define   NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_TYPE_MASK                                        0x0000000f
- #define   NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_FIELDS_SHIFT                             4
- #define   NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_FIELDS_MASK                              0x000000f0
- #define   NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_STRIDE_SHIFT                             8
- #define   NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_STRIDE_MASK                              0x0000ff00
+ #define  NV10TCL_VTXBUF_ADDRESS(x)                                                    (0x00000d00+((x)*8))
+ #define  NV10TCL_VTXBUF_ADDRESS__SIZE                                                 0x00000008
+ #define  NV10TCL_VTXFMT(x)                                                            (0x00000d04+((x)*8))
+ #define  NV10TCL_VTXFMT__SIZE                                                         0x00000008
+ #define   NV10TCL_VTXFMT_TYPE_SHIFT                                                   0
+ #define   NV10TCL_VTXFMT_TYPE_MASK                                                    0x0000000f
+ #define    NV10TCL_VTXFMT_TYPE_UBYTE                                                  0x00000000
+ #define    NV10TCL_VTXFMT_TYPE_USHORT                                                 0x00000001
+ #define    NV10TCL_VTXFMT_TYPE_FLOAT                                                  0x00000002
+ #define   NV10TCL_VTXFMT_FIELDS_SHIFT                                                 4
+ #define   NV10TCL_VTXFMT_FIELDS_MASK                                                  0x000000f0
+ #define   NV10TCL_VTXFMT_STRIDE_SHIFT                                                 8
+ #define   NV10TCL_VTXFMT_STRIDE_MASK                                                  0x0000ff00
  #define  NV10TCL_VERTEX_ARRAY_OFFSET_POS                                              0x00000d00
  #define  NV10TCL_VERTEX_ARRAY_FORMAT_POS                                              0x00000d04
  #define   NV10TCL_VERTEX_ARRAY_FORMAT_POS_TYPE_SHIFT                                  0
  
  
  
- #define NV10_DX5_TEXTURE_TRIANGLE                                                     0x00000094
+ #define NV10_DX5_TEXTURED_TRIANGLE                                                    0x00000094
  
  
  
- #define NV10_DX6_MULTI_TEXTURE_TRIANGLE                                                       0x00000095
+ #define NV10_DX6_MULTITEX_TRIANGLE                                                    0x00000095
  
  
  
  #define    NV20TCL_RC_IN_ALPHA_D_INPUT_SPARE1_NV                                      0x0000000d
  #define    NV20TCL_RC_IN_ALPHA_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                 0x0000000e
  #define    NV20TCL_RC_IN_ALPHA_D_INPUT_E_TIMES_F_NV                                   0x0000000f
+ #define    NV20TCL_RC_IN_ALPHA_D_INPUT_TEXTURE2_ARB                                   0x0000000a
+ #define    NV20TCL_RC_IN_ALPHA_D_INPUT_TEXTURE3_ARB                                   0x0000000b
  #define   NV20TCL_RC_IN_ALPHA_D_COMPONENT_USAGE                                               (1 <<  4)
  #define    NV20TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_BLUE                                 0x00000000
  #define    NV20TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_ALPHA                                        0x00000010
  #define    NV20TCL_RC_IN_ALPHA_C_INPUT_SPARE1_NV                                      0x00000d00
  #define    NV20TCL_RC_IN_ALPHA_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                 0x00000e00
  #define    NV20TCL_RC_IN_ALPHA_C_INPUT_E_TIMES_F_NV                                   0x00000f00
+ #define    NV20TCL_RC_IN_ALPHA_C_INPUT_TEXTURE2_ARB                                   0x00000a00
+ #define    NV20TCL_RC_IN_ALPHA_C_INPUT_TEXTURE3_ARB                                   0x00000b00
  #define   NV20TCL_RC_IN_ALPHA_C_COMPONENT_USAGE                                               (1 << 12)
  #define    NV20TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_BLUE                                 0x00000000
  #define    NV20TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_ALPHA                                        0x00001000
  #define    NV20TCL_RC_IN_ALPHA_B_INPUT_SPARE1_NV                                      0x000d0000
  #define    NV20TCL_RC_IN_ALPHA_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                 0x000e0000
  #define    NV20TCL_RC_IN_ALPHA_B_INPUT_E_TIMES_F_NV                                   0x000f0000
+ #define    NV20TCL_RC_IN_ALPHA_B_INPUT_TEXTURE2_ARB                                   0x000a0000
+ #define    NV20TCL_RC_IN_ALPHA_B_INPUT_TEXTURE3_ARB                                   0x000b0000
  #define   NV20TCL_RC_IN_ALPHA_B_COMPONENT_USAGE                                               (1 << 20)
  #define    NV20TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_BLUE                                 0x00000000
  #define    NV20TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_ALPHA                                        0x00100000
  #define    NV20TCL_RC_IN_ALPHA_A_INPUT_SPARE1_NV                                      0x0d000000
  #define    NV20TCL_RC_IN_ALPHA_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                 0x0e000000
  #define    NV20TCL_RC_IN_ALPHA_A_INPUT_E_TIMES_F_NV                                   0x0f000000
+ #define    NV20TCL_RC_IN_ALPHA_A_INPUT_TEXTURE2_ARB                                   0x0a000000
+ #define    NV20TCL_RC_IN_ALPHA_A_INPUT_TEXTURE3_ARB                                   0x0b000000
  #define   NV20TCL_RC_IN_ALPHA_A_COMPONENT_USAGE                                               (1 << 28)
  #define    NV20TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_BLUE                                 0x00000000
  #define    NV20TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_ALPHA                                        0x10000000
  #define    NV20TCL_RC_FINAL0_D_INPUT_SPARE1_NV                                                0x0000000d
  #define    NV20TCL_RC_FINAL0_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0000000e
  #define    NV20TCL_RC_FINAL0_D_INPUT_E_TIMES_F_NV                                     0x0000000f
+ #define    NV20TCL_RC_FINAL0_D_INPUT_TEXTURE2_ARB                                     0x0000000a
+ #define    NV20TCL_RC_FINAL0_D_INPUT_TEXTURE3_ARB                                     0x0000000b
  #define   NV20TCL_RC_FINAL0_D_COMPONENT_USAGE                                         (1 <<  4)
  #define    NV20TCL_RC_FINAL0_D_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV20TCL_RC_FINAL0_D_COMPONENT_USAGE_ALPHA                                  0x00000010
  #define    NV20TCL_RC_FINAL0_C_INPUT_SPARE1_NV                                                0x00000d00
  #define    NV20TCL_RC_FINAL0_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x00000e00
  #define    NV20TCL_RC_FINAL0_C_INPUT_E_TIMES_F_NV                                     0x00000f00
+ #define    NV20TCL_RC_FINAL0_C_INPUT_TEXTURE2_ARB                                     0x00000a00
+ #define    NV20TCL_RC_FINAL0_C_INPUT_TEXTURE3_ARB                                     0x00000b00
  #define   NV20TCL_RC_FINAL0_C_COMPONENT_USAGE                                         (1 << 12)
  #define    NV20TCL_RC_FINAL0_C_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV20TCL_RC_FINAL0_C_COMPONENT_USAGE_ALPHA                                  0x00001000
  #define    NV20TCL_RC_FINAL0_B_INPUT_SPARE1_NV                                                0x000d0000
  #define    NV20TCL_RC_FINAL0_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x000e0000
  #define    NV20TCL_RC_FINAL0_B_INPUT_E_TIMES_F_NV                                     0x000f0000
+ #define    NV20TCL_RC_FINAL0_B_INPUT_TEXTURE2_ARB                                     0x000a0000
+ #define    NV20TCL_RC_FINAL0_B_INPUT_TEXTURE3_ARB                                     0x000b0000
  #define   NV20TCL_RC_FINAL0_B_COMPONENT_USAGE                                         (1 << 20)
  #define    NV20TCL_RC_FINAL0_B_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV20TCL_RC_FINAL0_B_COMPONENT_USAGE_ALPHA                                  0x00100000
  #define    NV20TCL_RC_FINAL0_A_INPUT_SPARE1_NV                                                0x0d000000
  #define    NV20TCL_RC_FINAL0_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0e000000
  #define    NV20TCL_RC_FINAL0_A_INPUT_E_TIMES_F_NV                                     0x0f000000
+ #define    NV20TCL_RC_FINAL0_A_INPUT_TEXTURE2_ARB                                     0x0a000000
+ #define    NV20TCL_RC_FINAL0_A_INPUT_TEXTURE3_ARB                                     0x0b000000
  #define   NV20TCL_RC_FINAL0_A_COMPONENT_USAGE                                         (1 << 28)
  #define    NV20TCL_RC_FINAL0_A_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV20TCL_RC_FINAL0_A_COMPONENT_USAGE_ALPHA                                  0x10000000
  #define    NV20TCL_RC_FINAL1_G_INPUT_SPARE1_NV                                                0x00000d00
  #define    NV20TCL_RC_FINAL1_G_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x00000e00
  #define    NV20TCL_RC_FINAL1_G_INPUT_E_TIMES_F_NV                                     0x00000f00
+ #define    NV20TCL_RC_FINAL1_G_INPUT_TEXTURE2_ARB                                     0x00000a00
+ #define    NV20TCL_RC_FINAL1_G_INPUT_TEXTURE3_ARB                                     0x00000b00
  #define   NV20TCL_RC_FINAL1_G_COMPONENT_USAGE                                         (1 << 12)
  #define    NV20TCL_RC_FINAL1_G_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV20TCL_RC_FINAL1_G_COMPONENT_USAGE_ALPHA                                  0x00001000
  #define    NV20TCL_RC_FINAL1_F_INPUT_SPARE1_NV                                                0x000d0000
  #define    NV20TCL_RC_FINAL1_F_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x000e0000
  #define    NV20TCL_RC_FINAL1_F_INPUT_E_TIMES_F_NV                                     0x000f0000
+ #define    NV20TCL_RC_FINAL1_F_INPUT_TEXTURE2_ARB                                     0x000a0000
+ #define    NV20TCL_RC_FINAL1_F_INPUT_TEXTURE3_ARB                                     0x000b0000
  #define   NV20TCL_RC_FINAL1_F_COMPONENT_USAGE                                         (1 << 20)
  #define    NV20TCL_RC_FINAL1_F_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV20TCL_RC_FINAL1_F_COMPONENT_USAGE_ALPHA                                  0x00100000
  #define    NV20TCL_RC_FINAL1_E_INPUT_SPARE1_NV                                                0x0d000000
  #define    NV20TCL_RC_FINAL1_E_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0e000000
  #define    NV20TCL_RC_FINAL1_E_INPUT_E_TIMES_F_NV                                     0x0f000000
+ #define    NV20TCL_RC_FINAL1_E_INPUT_TEXTURE2_ARB                                     0x0a000000
+ #define    NV20TCL_RC_FINAL1_E_INPUT_TEXTURE3_ARB                                     0x0b000000
  #define   NV20TCL_RC_FINAL1_E_COMPONENT_USAGE                                         (1 << 28)
  #define    NV20TCL_RC_FINAL1_E_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV20TCL_RC_FINAL1_E_COMPONENT_USAGE_ALPHA                                  0x10000000
  #define  NV20TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R                       0x00000a10
  #define  NV20TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G                       0x00000a14
  #define  NV20TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B                       0x00000a18
- #define  NV20TCL_VIEWPORT_SCALE0_X                                                    0x00000a20
- #define  NV20TCL_VIEWPORT_SCALE0_Y                                                    0x00000a24
- #define  NV20TCL_VIEWPORT_SCALE0_Z                                                    0x00000a28
- #define  NV20TCL_VIEWPORT_SCALE0_W                                                    0x00000a2c
+ #define  NV20TCL_VIEWPORT_TRANSLATE_X                                                 0x00000a20
+ #define  NV20TCL_VIEWPORT_TRANSLATE_Y                                                 0x00000a24
+ #define  NV20TCL_VIEWPORT_TRANSLATE_Z                                                 0x00000a28
+ #define  NV20TCL_VIEWPORT_TRANSLATE_W                                                 0x00000a2c
  #define  NV20TCL_POINT_PARAMETER(x)                                                   (0x00000a30+((x)*4))
  #define  NV20TCL_POINT_PARAMETER__SIZE                                                        0x00000008
  #define  NV20TCL_RC_CONSTANT_COLOR0(x)                                                        (0x00000a60+((x)*4))
  #define    NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE1_NV                                   0x0000000d
  #define    NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV              0x0000000e
  #define    NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_E_TIMES_F_NV                                        0x0000000f
+ #define    NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE2_ARB                                        0x0000000a
+ #define    NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE3_ARB                                        0x0000000b
  #define   NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SHIFT                                                4
  #define   NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_MASK                                         0x000000f0
  #define    NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_ZERO                                                0x00000000
  #define    NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE1_NV                                   0x000000d0
  #define    NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV              0x000000e0
  #define    NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_E_TIMES_F_NV                                        0x000000f0
+ #define    NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE2_ARB                                        0x000000a0
+ #define    NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE3_ARB                                        0x000000b0
  #define   NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SHIFT                                               8
  #define   NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_MASK                                                0x00000f00
  #define    NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_ZERO                                               0x00000000
  #define    NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE1_NV                                  0x00000d00
  #define    NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV             0x00000e00
  #define    NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_E_TIMES_F_NV                                       0x00000f00
+ #define    NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE2_ARB                                       0x00000a00
+ #define    NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE3_ARB                                       0x00000b00
  #define   NV20TCL_RC_OUT_ALPHA_CD_DOT_PRODUCT                                         (1 << 12)
  #define   NV20TCL_RC_OUT_ALPHA_AB_DOT_PRODUCT                                         (1 << 13)
  #define   NV20TCL_RC_OUT_ALPHA_MUX_SUM                                                        (1 << 14)
  #define    NV20TCL_RC_IN_RGB_D_INPUT_SPARE1_NV                                                0x0000000d
  #define    NV20TCL_RC_IN_RGB_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0000000e
  #define    NV20TCL_RC_IN_RGB_D_INPUT_E_TIMES_F_NV                                     0x0000000f
+ #define    NV20TCL_RC_IN_RGB_D_INPUT_TEXTURE2_ARB                                     0x0000000a
+ #define    NV20TCL_RC_IN_RGB_D_INPUT_TEXTURE3_ARB                                     0x0000000b
  #define   NV20TCL_RC_IN_RGB_D_COMPONENT_USAGE                                         (1 <<  4)
  #define    NV20TCL_RC_IN_RGB_D_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV20TCL_RC_IN_RGB_D_COMPONENT_USAGE_ALPHA                                  0x00000010
  #define    NV20TCL_RC_IN_RGB_C_INPUT_SPARE1_NV                                                0x00000d00
  #define    NV20TCL_RC_IN_RGB_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x00000e00
  #define    NV20TCL_RC_IN_RGB_C_INPUT_E_TIMES_F_NV                                     0x00000f00
+ #define    NV20TCL_RC_IN_RGB_C_INPUT_TEXTURE2_ARB                                     0x00000a00
+ #define    NV20TCL_RC_IN_RGB_C_INPUT_TEXTURE3_ARB                                     0x00000b00
  #define   NV20TCL_RC_IN_RGB_C_COMPONENT_USAGE                                         (1 << 12)
  #define    NV20TCL_RC_IN_RGB_C_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV20TCL_RC_IN_RGB_C_COMPONENT_USAGE_ALPHA                                  0x00001000
  #define    NV20TCL_RC_IN_RGB_B_INPUT_SPARE1_NV                                                0x000d0000
  #define    NV20TCL_RC_IN_RGB_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x000e0000
  #define    NV20TCL_RC_IN_RGB_B_INPUT_E_TIMES_F_NV                                     0x000f0000
+ #define    NV20TCL_RC_IN_RGB_B_INPUT_TEXTURE2_ARB                                     0x000a0000
+ #define    NV20TCL_RC_IN_RGB_B_INPUT_TEXTURE3_ARB                                     0x000b0000
  #define   NV20TCL_RC_IN_RGB_B_COMPONENT_USAGE                                         (1 << 20)
  #define    NV20TCL_RC_IN_RGB_B_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV20TCL_RC_IN_RGB_B_COMPONENT_USAGE_ALPHA                                  0x00100000
  #define    NV20TCL_RC_IN_RGB_A_INPUT_SPARE1_NV                                                0x0d000000
  #define    NV20TCL_RC_IN_RGB_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0e000000
  #define    NV20TCL_RC_IN_RGB_A_INPUT_E_TIMES_F_NV                                     0x0f000000
+ #define    NV20TCL_RC_IN_RGB_A_INPUT_TEXTURE2_ARB                                     0x0a000000
+ #define    NV20TCL_RC_IN_RGB_A_INPUT_TEXTURE3_ARB                                     0x0b000000
  #define   NV20TCL_RC_IN_RGB_A_COMPONENT_USAGE                                         (1 << 28)
  #define    NV20TCL_RC_IN_RGB_A_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV20TCL_RC_IN_RGB_A_COMPONENT_USAGE_ALPHA                                  0x10000000
  #define    NV20TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NEGATE_NV                            0xa0000000
  #define    NV20TCL_RC_IN_RGB_A_MAPPING_SIGNED_IDENTITY_NV                             0xc0000000
  #define    NV20TCL_RC_IN_RGB_A_MAPPING_SIGNED_NEGATE_NV                                       0xe0000000
- #define  NV20TCL_VIEWPORT_SCALE1_X                                                    0x00000af0
- #define  NV20TCL_VIEWPORT_SCALE1_Y                                                    0x00000af4
- #define  NV20TCL_VIEWPORT_SCALE1_Z                                                    0x00000af8
- #define  NV20TCL_VIEWPORT_SCALE1_W                                                    0x00000afc
+ #define  NV20TCL_VIEWPORT_SCALE_X                                                     0x00000af0
+ #define  NV20TCL_VIEWPORT_SCALE_Y                                                     0x00000af4
+ #define  NV20TCL_VIEWPORT_SCALE_Z                                                     0x00000af8
+ #define  NV20TCL_VIEWPORT_SCALE_W                                                     0x00000afc
  #define  NV20TCL_VP_UPLOAD_INST(x)                                                    (0x00000b00+((x)*4))
  #define  NV20TCL_VP_UPLOAD_INST__SIZE                                                 0x00000004
  #define  NV20TCL_VP_UPLOAD_CONST(x)                                                   (0x00000b80+((x)*4))
  #define   NV20TCL_VERTEX_TX3_4I_RQ_Q_MASK                                             0xffff0000
  #define  NV20TCL_VERTEX_FOG_1F                                                                0x00001698
  #define  NV20TCL_EDGEFLAG_ENABLE                                                      0x000016bc
+ #define  NV20TCL_VTX_CACHE_INVALIDATE                                                 0x00001710
  #define  NV20TCL_VTXBUF_ADDRESS(x)                                                    (0x00001720+((x)*4))
  #define  NV20TCL_VTXBUF_ADDRESS__SIZE                                                 0x00000010
  #define   NV20TCL_VTXBUF_ADDRESS_DMA1                                                 (1 << 31)
  #define    NV20TCL_RC_OUT_RGB_CD_OUTPUT_SPARE1_NV                                     0x0000000d
  #define    NV20TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                        0x0000000e
  #define    NV20TCL_RC_OUT_RGB_CD_OUTPUT_E_TIMES_F_NV                                  0x0000000f
+ #define    NV20TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE2_ARB                                  0x0000000a
+ #define    NV20TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE3_ARB                                  0x0000000b
  #define   NV20TCL_RC_OUT_RGB_AB_OUTPUT_SHIFT                                          4
  #define   NV20TCL_RC_OUT_RGB_AB_OUTPUT_MASK                                           0x000000f0
  #define    NV20TCL_RC_OUT_RGB_AB_OUTPUT_ZERO                                          0x00000000
  #define    NV20TCL_RC_OUT_RGB_AB_OUTPUT_SPARE1_NV                                     0x000000d0
  #define    NV20TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                        0x000000e0
  #define    NV20TCL_RC_OUT_RGB_AB_OUTPUT_E_TIMES_F_NV                                  0x000000f0
+ #define    NV20TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE2_ARB                                  0x000000a0
+ #define    NV20TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE3_ARB                                  0x000000b0
  #define   NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SHIFT                                         8
  #define   NV20TCL_RC_OUT_RGB_SUM_OUTPUT_MASK                                          0x00000f00
  #define    NV20TCL_RC_OUT_RGB_SUM_OUTPUT_ZERO                                         0x00000000
  #define    NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE1_NV                                    0x00000d00
  #define    NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                       0x00000e00
  #define    NV20TCL_RC_OUT_RGB_SUM_OUTPUT_E_TIMES_F_NV                                 0x00000f00
+ #define    NV20TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE2_ARB                                 0x00000a00
+ #define    NV20TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE3_ARB                                 0x00000b00
  #define   NV20TCL_RC_OUT_RGB_CD_DOT_PRODUCT                                           (1 << 12)
  #define   NV20TCL_RC_OUT_RGB_AB_DOT_PRODUCT                                           (1 << 13)
  #define   NV20TCL_RC_OUT_RGB_MUX_SUM                                                  (1 << 14)
  #define  NV20TCL_VP_UPLOAD_FROM_ID                                                    0x00001e9c
  #define  NV20TCL_VP_START_FROM_ID                                                     0x00001ea0
  #define  NV20TCL_VP_UPLOAD_CONST_ID                                                   0x00001ea4
- #define  NV20TCL_VIEWPORT_TRANSLATE_X                                                 0x00001f00
- #define  NV20TCL_VIEWPORT_TRANSLATE_Y                                                 0x00001f04
- #define  NV20TCL_VIEWPORT_TRANSLATE_Z                                                 0x00001f08
- #define  NV20TCL_VIEWPORT_TRANSLATE_W                                                 0x00001f0c
  
  
  #define NV17TCL                                                                               0x00000099
  #define    NV34TCL_RC_FINAL0_D_INPUT_SPARE1_NV                                                0x0000000d
  #define    NV34TCL_RC_FINAL0_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0000000e
  #define    NV34TCL_RC_FINAL0_D_INPUT_E_TIMES_F_NV                                     0x0000000f
+ #define    NV34TCL_RC_FINAL0_D_INPUT_TEXTURE2_ARB                                     0x0000000a
+ #define    NV34TCL_RC_FINAL0_D_INPUT_TEXTURE3_ARB                                     0x0000000b
  #define   NV34TCL_RC_FINAL0_D_COMPONENT_USAGE                                         (1 <<  4)
  #define    NV34TCL_RC_FINAL0_D_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV34TCL_RC_FINAL0_D_COMPONENT_USAGE_ALPHA                                  0x00000010
  #define    NV34TCL_RC_FINAL0_C_INPUT_SPARE1_NV                                                0x00000d00
  #define    NV34TCL_RC_FINAL0_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x00000e00
  #define    NV34TCL_RC_FINAL0_C_INPUT_E_TIMES_F_NV                                     0x00000f00
+ #define    NV34TCL_RC_FINAL0_C_INPUT_TEXTURE2_ARB                                     0x00000a00
+ #define    NV34TCL_RC_FINAL0_C_INPUT_TEXTURE3_ARB                                     0x00000b00
  #define   NV34TCL_RC_FINAL0_C_COMPONENT_USAGE                                         (1 << 12)
  #define    NV34TCL_RC_FINAL0_C_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV34TCL_RC_FINAL0_C_COMPONENT_USAGE_ALPHA                                  0x00001000
  #define    NV34TCL_RC_FINAL0_B_INPUT_SPARE1_NV                                                0x000d0000
  #define    NV34TCL_RC_FINAL0_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x000e0000
  #define    NV34TCL_RC_FINAL0_B_INPUT_E_TIMES_F_NV                                     0x000f0000
+ #define    NV34TCL_RC_FINAL0_B_INPUT_TEXTURE2_ARB                                     0x000a0000
+ #define    NV34TCL_RC_FINAL0_B_INPUT_TEXTURE3_ARB                                     0x000b0000
  #define   NV34TCL_RC_FINAL0_B_COMPONENT_USAGE                                         (1 << 20)
  #define    NV34TCL_RC_FINAL0_B_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV34TCL_RC_FINAL0_B_COMPONENT_USAGE_ALPHA                                  0x00100000
  #define    NV34TCL_RC_FINAL0_A_INPUT_SPARE1_NV                                                0x0d000000
  #define    NV34TCL_RC_FINAL0_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0e000000
  #define    NV34TCL_RC_FINAL0_A_INPUT_E_TIMES_F_NV                                     0x0f000000
+ #define    NV34TCL_RC_FINAL0_A_INPUT_TEXTURE2_ARB                                     0x0a000000
+ #define    NV34TCL_RC_FINAL0_A_INPUT_TEXTURE3_ARB                                     0x0b000000
  #define   NV34TCL_RC_FINAL0_A_COMPONENT_USAGE                                         (1 << 28)
  #define    NV34TCL_RC_FINAL0_A_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV34TCL_RC_FINAL0_A_COMPONENT_USAGE_ALPHA                                  0x10000000
  #define    NV34TCL_RC_FINAL1_G_INPUT_SPARE1_NV                                                0x00000d00
  #define    NV34TCL_RC_FINAL1_G_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x00000e00
  #define    NV34TCL_RC_FINAL1_G_INPUT_E_TIMES_F_NV                                     0x00000f00
+ #define    NV34TCL_RC_FINAL1_G_INPUT_TEXTURE2_ARB                                     0x00000a00
+ #define    NV34TCL_RC_FINAL1_G_INPUT_TEXTURE3_ARB                                     0x00000b00
  #define   NV34TCL_RC_FINAL1_G_COMPONENT_USAGE                                         (1 << 12)
  #define    NV34TCL_RC_FINAL1_G_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV34TCL_RC_FINAL1_G_COMPONENT_USAGE_ALPHA                                  0x00001000
  #define    NV34TCL_RC_FINAL1_F_INPUT_SPARE1_NV                                                0x000d0000
  #define    NV34TCL_RC_FINAL1_F_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x000e0000
  #define    NV34TCL_RC_FINAL1_F_INPUT_E_TIMES_F_NV                                     0x000f0000
+ #define    NV34TCL_RC_FINAL1_F_INPUT_TEXTURE2_ARB                                     0x000a0000
+ #define    NV34TCL_RC_FINAL1_F_INPUT_TEXTURE3_ARB                                     0x000b0000
  #define   NV34TCL_RC_FINAL1_F_COMPONENT_USAGE                                         (1 << 20)
  #define    NV34TCL_RC_FINAL1_F_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV34TCL_RC_FINAL1_F_COMPONENT_USAGE_ALPHA                                  0x00100000
  #define    NV34TCL_RC_FINAL1_E_INPUT_SPARE1_NV                                                0x0d000000
  #define    NV34TCL_RC_FINAL1_E_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0e000000
  #define    NV34TCL_RC_FINAL1_E_INPUT_E_TIMES_F_NV                                     0x0f000000
+ #define    NV34TCL_RC_FINAL1_E_INPUT_TEXTURE2_ARB                                     0x0a000000
+ #define    NV34TCL_RC_FINAL1_E_INPUT_TEXTURE3_ARB                                     0x0b000000
  #define   NV34TCL_RC_FINAL1_E_COMPONENT_USAGE                                         (1 << 28)
  #define    NV34TCL_RC_FINAL1_E_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV34TCL_RC_FINAL1_E_COMPONENT_USAGE_ALPHA                                  0x10000000
  #define    NV34TCL_RC_IN_ALPHA_D_INPUT_SPARE1_NV                                      0x0000000d
  #define    NV34TCL_RC_IN_ALPHA_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                 0x0000000e
  #define    NV34TCL_RC_IN_ALPHA_D_INPUT_E_TIMES_F_NV                                   0x0000000f
+ #define    NV34TCL_RC_IN_ALPHA_D_INPUT_TEXTURE2_ARB                                   0x0000000a
+ #define    NV34TCL_RC_IN_ALPHA_D_INPUT_TEXTURE3_ARB                                   0x0000000b
  #define   NV34TCL_RC_IN_ALPHA_D_COMPONENT_USAGE                                               (1 <<  4)
  #define    NV34TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_BLUE                                 0x00000000
  #define    NV34TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_ALPHA                                        0x00000010
  #define    NV34TCL_RC_IN_ALPHA_C_INPUT_SPARE1_NV                                      0x00000d00
  #define    NV34TCL_RC_IN_ALPHA_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                 0x00000e00
  #define    NV34TCL_RC_IN_ALPHA_C_INPUT_E_TIMES_F_NV                                   0x00000f00
+ #define    NV34TCL_RC_IN_ALPHA_C_INPUT_TEXTURE2_ARB                                   0x00000a00
+ #define    NV34TCL_RC_IN_ALPHA_C_INPUT_TEXTURE3_ARB                                   0x00000b00
  #define   NV34TCL_RC_IN_ALPHA_C_COMPONENT_USAGE                                               (1 << 12)
  #define    NV34TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_BLUE                                 0x00000000
  #define    NV34TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_ALPHA                                        0x00001000
  #define    NV34TCL_RC_IN_ALPHA_B_INPUT_SPARE1_NV                                      0x000d0000
  #define    NV34TCL_RC_IN_ALPHA_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                 0x000e0000
  #define    NV34TCL_RC_IN_ALPHA_B_INPUT_E_TIMES_F_NV                                   0x000f0000
+ #define    NV34TCL_RC_IN_ALPHA_B_INPUT_TEXTURE2_ARB                                   0x000a0000
+ #define    NV34TCL_RC_IN_ALPHA_B_INPUT_TEXTURE3_ARB                                   0x000b0000
  #define   NV34TCL_RC_IN_ALPHA_B_COMPONENT_USAGE                                               (1 << 20)
  #define    NV34TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_BLUE                                 0x00000000
  #define    NV34TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_ALPHA                                        0x00100000
  #define    NV34TCL_RC_IN_ALPHA_A_INPUT_SPARE1_NV                                      0x0d000000
  #define    NV34TCL_RC_IN_ALPHA_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                 0x0e000000
  #define    NV34TCL_RC_IN_ALPHA_A_INPUT_E_TIMES_F_NV                                   0x0f000000
+ #define    NV34TCL_RC_IN_ALPHA_A_INPUT_TEXTURE2_ARB                                   0x0a000000
+ #define    NV34TCL_RC_IN_ALPHA_A_INPUT_TEXTURE3_ARB                                   0x0b000000
  #define   NV34TCL_RC_IN_ALPHA_A_COMPONENT_USAGE                                               (1 << 28)
  #define    NV34TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_BLUE                                 0x00000000
  #define    NV34TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_ALPHA                                        0x10000000
  #define    NV34TCL_RC_IN_RGB_D_INPUT_SPARE1_NV                                                0x0000000d
  #define    NV34TCL_RC_IN_RGB_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0000000e
  #define    NV34TCL_RC_IN_RGB_D_INPUT_E_TIMES_F_NV                                     0x0000000f
+ #define    NV34TCL_RC_IN_RGB_D_INPUT_TEXTURE2_ARB                                     0x0000000a
+ #define    NV34TCL_RC_IN_RGB_D_INPUT_TEXTURE3_ARB                                     0x0000000b
  #define   NV34TCL_RC_IN_RGB_D_COMPONENT_USAGE                                         (1 <<  4)
  #define    NV34TCL_RC_IN_RGB_D_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV34TCL_RC_IN_RGB_D_COMPONENT_USAGE_ALPHA                                  0x00000010
  #define    NV34TCL_RC_IN_RGB_C_INPUT_SPARE1_NV                                                0x00000d00
  #define    NV34TCL_RC_IN_RGB_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x00000e00
  #define    NV34TCL_RC_IN_RGB_C_INPUT_E_TIMES_F_NV                                     0x00000f00
+ #define    NV34TCL_RC_IN_RGB_C_INPUT_TEXTURE2_ARB                                     0x00000a00
+ #define    NV34TCL_RC_IN_RGB_C_INPUT_TEXTURE3_ARB                                     0x00000b00
  #define   NV34TCL_RC_IN_RGB_C_COMPONENT_USAGE                                         (1 << 12)
  #define    NV34TCL_RC_IN_RGB_C_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV34TCL_RC_IN_RGB_C_COMPONENT_USAGE_ALPHA                                  0x00001000
  #define    NV34TCL_RC_IN_RGB_B_INPUT_SPARE1_NV                                                0x000d0000
  #define    NV34TCL_RC_IN_RGB_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x000e0000
  #define    NV34TCL_RC_IN_RGB_B_INPUT_E_TIMES_F_NV                                     0x000f0000
+ #define    NV34TCL_RC_IN_RGB_B_INPUT_TEXTURE2_ARB                                     0x000a0000
+ #define    NV34TCL_RC_IN_RGB_B_INPUT_TEXTURE3_ARB                                     0x000b0000
  #define   NV34TCL_RC_IN_RGB_B_COMPONENT_USAGE                                         (1 << 20)
  #define    NV34TCL_RC_IN_RGB_B_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV34TCL_RC_IN_RGB_B_COMPONENT_USAGE_ALPHA                                  0x00100000
  #define    NV34TCL_RC_IN_RGB_A_INPUT_SPARE1_NV                                                0x0d000000
  #define    NV34TCL_RC_IN_RGB_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                   0x0e000000
  #define    NV34TCL_RC_IN_RGB_A_INPUT_E_TIMES_F_NV                                     0x0f000000
+ #define    NV34TCL_RC_IN_RGB_A_INPUT_TEXTURE2_ARB                                     0x0a000000
+ #define    NV34TCL_RC_IN_RGB_A_INPUT_TEXTURE3_ARB                                     0x0b000000
  #define   NV34TCL_RC_IN_RGB_A_COMPONENT_USAGE                                         (1 << 28)
  #define    NV34TCL_RC_IN_RGB_A_COMPONENT_USAGE_RGB                                    0x00000000
  #define    NV34TCL_RC_IN_RGB_A_COMPONENT_USAGE_ALPHA                                  0x10000000
  #define    NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE1_NV                                   0x0000000d
  #define    NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV              0x0000000e
  #define    NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_E_TIMES_F_NV                                        0x0000000f
+ #define    NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE2_ARB                                        0x0000000a
+ #define    NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE3_ARB                                        0x0000000b
  #define   NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SHIFT                                                4
  #define   NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_MASK                                         0x000000f0
  #define    NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_ZERO                                                0x00000000
  #define    NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE1_NV                                   0x000000d0
  #define    NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV              0x000000e0
  #define    NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_E_TIMES_F_NV                                        0x000000f0
+ #define    NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE2_ARB                                        0x000000a0
+ #define    NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE3_ARB                                        0x000000b0
  #define   NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SHIFT                                               8
  #define   NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_MASK                                                0x00000f00
  #define    NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_ZERO                                               0x00000000
  #define    NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE1_NV                                  0x00000d00
  #define    NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV             0x00000e00
  #define    NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_E_TIMES_F_NV                                       0x00000f00
+ #define    NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE2_ARB                                       0x00000a00
+ #define    NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE3_ARB                                       0x00000b00
  #define   NV34TCL_RC_OUT_ALPHA_CD_DOT_PRODUCT                                         (1 << 12)
  #define   NV34TCL_RC_OUT_ALPHA_AB_DOT_PRODUCT                                         (1 << 13)
  #define   NV34TCL_RC_OUT_ALPHA_MUX_SUM                                                        (1 << 14)
  #define    NV34TCL_RC_OUT_RGB_CD_OUTPUT_SPARE1_NV                                     0x0000000d
  #define    NV34TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                        0x0000000e
  #define    NV34TCL_RC_OUT_RGB_CD_OUTPUT_E_TIMES_F_NV                                  0x0000000f
+ #define    NV34TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE2_ARB                                  0x0000000a
+ #define    NV34TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE3_ARB                                  0x0000000b
  #define   NV34TCL_RC_OUT_RGB_AB_OUTPUT_SHIFT                                          4
  #define   NV34TCL_RC_OUT_RGB_AB_OUTPUT_MASK                                           0x000000f0
  #define    NV34TCL_RC_OUT_RGB_AB_OUTPUT_ZERO                                          0x00000000
  #define    NV34TCL_RC_OUT_RGB_AB_OUTPUT_SPARE1_NV                                     0x000000d0
  #define    NV34TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                        0x000000e0
  #define    NV34TCL_RC_OUT_RGB_AB_OUTPUT_E_TIMES_F_NV                                  0x000000f0
+ #define    NV34TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE2_ARB                                  0x000000a0
+ #define    NV34TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE3_ARB                                  0x000000b0
  #define   NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SHIFT                                         8
  #define   NV34TCL_RC_OUT_RGB_SUM_OUTPUT_MASK                                          0x00000f00
  #define    NV34TCL_RC_OUT_RGB_SUM_OUTPUT_ZERO                                         0x00000000
  #define    NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE1_NV                                    0x00000d00
  #define    NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV                       0x00000e00
  #define    NV34TCL_RC_OUT_RGB_SUM_OUTPUT_E_TIMES_F_NV                                 0x00000f00
+ #define    NV34TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE2_ARB                                 0x00000a00
+ #define    NV34TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE3_ARB                                 0x00000b00
  #define   NV34TCL_RC_OUT_RGB_CD_DOT_PRODUCT                                           (1 << 12)
  #define   NV34TCL_RC_OUT_RGB_AB_DOT_PRODUCT                                           (1 << 13)
  #define   NV34TCL_RC_OUT_RGB_MUX_SUM                                                  (1 << 14)
diff --combined radeon/radeon_bo.h
index 1e2e6c20be3e3bd61e0bd6e7831b5483d250b72d,72d3520089e0229d73701b3b7ddb0c1935ea50b6..72d3520089e0229d73701b3b7ddb0c1935ea50b6
@@@ -39,6 -39,7 +39,7 @@@
  #define RADEON_BO_FLAGS_MICRO_TILE  2
  
  struct radeon_bo_manager;
+ struct radeon_cs;
  
  struct radeon_bo {
      uint32_t                    alignment;
@@@ -53,6 -54,7 +54,7 @@@
      void                        *ptr;
      struct radeon_bo_manager    *bom;
      uint32_t                    space_accounted;
+     uint32_t                    referenced_in_cs;
  };
  
  /* bo functions */
@@@ -74,6 -76,7 +76,7 @@@ struct radeon_bo_funcs 
      int (*bo_get_tiling)(struct radeon_bo *bo, uint32_t *tiling_flags,
                          uint32_t *pitch);
      int (*bo_is_busy)(struct radeon_bo *bo, uint32_t *domain);
+     int (*bo_is_referenced_by_cs)(struct radeon_bo *bo, struct radeon_cs *cs);
  };
  
  struct radeon_bo_manager {
@@@ -195,6 -198,15 +198,15 @@@ static inline int radeon_bo_is_static(s
      return 0;
  }
  
+ static inline int _radeon_bo_is_referenced_by_cs(struct radeon_bo *bo,
+                                                  struct radeon_cs *cs,
+                                                  const char *file,
+                                                  const char *func,
+                                                  unsigned line)
+ {
+     return bo->cref > 1;
+ }
  #define radeon_bo_open(bom, h, s, a, d, f)\
      _radeon_bo_open(bom, h, s, a, d, f, __FILE__, __FUNCTION__, __LINE__)
  #define radeon_bo_ref(bo)\
      _radeon_bo_wait(bo, __FILE__, __func__, __LINE__)
  #define radeon_bo_is_busy(bo, domain) \
      _radeon_bo_is_busy(bo, domain, __FILE__, __func__, __LINE__)
+ #define radeon_bo_is_referenced_by_cs(bo, cs) \
+     _radeon_bo_is_referenced_by_cs(bo, cs, __FILE__, __FUNCTION__, __LINE__)
  
  #endif