Changeset 3598 for trunk/src/opengl/mesa/3dfx/fxvsetup.h
- Timestamp:
- May 23, 2000, 10:41:28 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/3dfx/fxvsetup.h
r2938 r3598 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 48 48 49 49 50 #define VARS_W 50 #define VARS_W 51 51 52 52 #define VARS_Z 53 53 54 #define VARS_TMU0 55 GLuint tmu0_source = fxMesa->tmu_source[0]; 56 GLfloat *tmu0_data = VEC_ELT(VB->TexCoordPtr[tmu0_source], 57 GLfloat, start);\58 GLuint tmu0_stride = VB->TexCoordPtr[tmu0_source]->stride; 59 GLuint tmu0_sz = VB->TexCoordPtr[tmu0_source]->size; 60 struct gl_texture_unit *t0 = &ctx->Texture.Unit[tmu0_source]; 61 GLfloat sscale0 = FX_TEXTURE_DATA(t0)->sScale; 54 #define VARS_TMU0 \ 55 GLuint tmu0_source = fxMesa->tmu_source[0]; \ 56 GLfloat *tmu0_data = VEC_ELT(VB->TexCoordPtr[tmu0_source], \ 57 GLfloat, start); \ 58 GLuint tmu0_stride = VB->TexCoordPtr[tmu0_source]->stride; \ 59 GLuint tmu0_sz = VB->TexCoordPtr[tmu0_source]->size; \ 60 struct gl_texture_unit *t0 = &ctx->Texture.Unit[tmu0_source]; \ 61 GLfloat sscale0 = FX_TEXTURE_DATA(t0)->sScale; \ 62 62 GLfloat tscale0 = FX_TEXTURE_DATA(t0)->tScale; 63 63 64 #define VARS_TMU1 65 GLuint tmu1_source = fxMesa->tmu_source[1]; 66 GLfloat *tmu1_data = VEC_ELT(VB->TexCoordPtr[tmu1_source], 67 GLfloat, start);\68 GLuint tmu1_stride = VB->TexCoordPtr[tmu1_source]->stride; 69 GLuint tmu1_sz = VB->TexCoordPtr[tmu1_source]->size; 70 struct gl_texture_unit *t1 = &ctx->Texture.Unit[tmu1_source]; 71 GLfloat sscale1 = FX_TEXTURE_DATA(t1)->sScale; 64 #define VARS_TMU1 \ 65 GLuint tmu1_source = fxMesa->tmu_source[1]; \ 66 GLfloat *tmu1_data = VEC_ELT(VB->TexCoordPtr[tmu1_source], \ 67 GLfloat, start); \ 68 GLuint tmu1_stride = VB->TexCoordPtr[tmu1_source]->stride; \ 69 GLuint tmu1_sz = VB->TexCoordPtr[tmu1_source]->size; \ 70 struct gl_texture_unit *t1 = &ctx->Texture.Unit[tmu1_source]; \ 71 GLfloat sscale1 = FX_TEXTURE_DATA(t1)->sScale; \ 72 72 GLfloat tscale1 = FX_TEXTURE_DATA(t1)->tScale; 73 73 74 #define VARS_RGBA 75 GLubyte *color = VEC_ELT(VB->ColorPtr, GLubyte, start); 76 GLuint col_stride = VB->ColorPtr->stride; 74 #define VARS_RGBA \ 75 GLubyte *color = VEC_ELT(VB->ColorPtr, GLubyte, start); \ 76 GLuint col_stride = VB->ColorPtr->stride; 77 77 78 #define VARS_XY GLfloat *win = VB->Win.data[start]; 78 #define VARS_XY GLfloat *win = VB->Win.data[start]; 79 79 80 80 #define INCR_XY win += 4 … … 82 82 83 83 #ifdef FX_V2 84 # define DO_SETUP_XY 85 v[XCOORD]=win[0]; 86 v[YCOORD]=win[1]; 84 # define DO_SETUP_XY \ 85 v[XCOORD]=win[0]; \ 86 v[YCOORD]=win[1]; 87 87 #else 88 88 #ifdef DRIVERTS 89 # define DO_SETUP_XY 90 v[XCOORD]=win[0]+fxMesa->x_offset; 91 v[YCOORD]=win[1]+fxMesa->y_delta; 89 # define DO_SETUP_XY \ 90 v[XCOORD]=win[0]+fxMesa->x_offset; \ 91 v[YCOORD]=win[1]+fxMesa->y_delta; 92 92 #else 93 93 # if (defined(__linux__) && defined(__i386__)) || defined(macintosh) 94 # define DO_SETUP_XY { 95 GLfloat t1 = win[0] + snapper; 96 GLfloat t2 = win[1] + snapper; 97 v[XCOORD] = t1 - snapper; 98 v[YCOORD] = t2 - snapper; 94 # define DO_SETUP_XY { \ 95 GLfloat t1 = win[0] + snapper; \ 96 GLfloat t2 = win[1] + snapper; \ 97 v[XCOORD] = t1 - snapper; \ 98 v[YCOORD] = t2 - snapper; \ 99 99 } 100 100 # else 101 # define DO_SETUP_XY { 102 /* trunc (x,y) to multiple of 1/16 */ 103 v[XCOORD]=((int)(win[0]*16.0f))*(1.0f/16.0f); 104 v[YCOORD]=((int)(win[1]*16.0f))*(1.0f/16.0f); 101 # define DO_SETUP_XY { \ 102 /* trunc (x,y) to multiple of 1/16 */ \ 103 v[XCOORD]=((int)(win[0]*16.0f))*(1.0f/16.0f); \ 104 v[YCOORD]=((int)(win[1]*16.0f))*(1.0f/16.0f); \ 105 105 } 106 106 # endif … … 109 109 110 110 111 #define DO_SETUP_W { 112 v[OOWCOORD]=win[3]; 111 #define DO_SETUP_W { \ 112 v[OOWCOORD]=win[3]; \ 113 113 } 114 114 115 115 #define DO_SETUP_Z v[ZCOORD]=win[2]; 116 116 117 #define DO_SETUP_TMU0 118 { 119 v[S0COORD]=sscale0*tmu0_data[0]*v[OOWCOORD]; 120 v[T0COORD]=tscale0*tmu0_data[1]*v[OOWCOORD]; 121 } 117 #define DO_SETUP_TMU0 \ 118 { \ 119 v[S0COORD]=sscale0*tmu0_data[0]*v[OOWCOORD]; \ 120 v[T0COORD]=tscale0*tmu0_data[1]*v[OOWCOORD]; \ 121 } 122 122 123 123 #define INCR_TMU0 STRIDE_F(tmu0_data, tmu0_stride) 124 124 125 #define DO_SETUP_TMU1 126 { 127 v[S1COORD]=sscale1*tmu1_data[0]*v[OOWCOORD]; 128 v[T1COORD]=tscale1*tmu1_data[1]*v[OOWCOORD]; 125 #define DO_SETUP_TMU1 \ 126 { \ 127 v[S1COORD]=sscale1*tmu1_data[0]*v[OOWCOORD]; \ 128 v[T1COORD]=tscale1*tmu1_data[1]*v[OOWCOORD]; \ 129 129 } 130 130 … … 132 132 133 133 #if FX_USE_PARGB 134 #define DO_SETUP_RGBA 134 #define DO_SETUP_RGBA \ 135 135 { GET_PARGB(v) = color[ACOMP] << 24 | color[RCOMP] << 16 | color[GCOMP] << 8 | color[BCOMP];} 136 136 137 137 #else 138 #define DO_SETUP_RGBA 139 { 140 UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[RCOORD], color[0]); 141 UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[GCOORD], color[1]); 142 UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[BCOORD], color[2]); 143 UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[ACOORD], color[3]); 138 #define DO_SETUP_RGBA \ 139 { \ 140 UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[RCOORD], color[0]); \ 141 UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[GCOORD], color[1]); \ 142 UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[BCOORD], color[2]); \ 143 UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[ACOORD], color[3]); \ 144 144 } 145 145 #endif … … 148 148 149 149 150 #define _FIXUP_PRE 151 GLuint hs = fxMesa->stw_hint_state & ~(GR_STWHINT_W_DIFF_TMU0 | 152 150 #define _FIXUP_PRE \ 151 GLuint hs = fxMesa->stw_hint_state & ~(GR_STWHINT_W_DIFF_TMU0 | \ 152 GR_STWHINT_W_DIFF_TMU1); 153 153 154 #define _FIXUP_TMU0 155 if (tmu0_sz == 4) { 156 project_texcoords( VB, 0, tmu0_source, start, end ); 157 hs |= GR_STWHINT_W_DIFF_TMU0; 158 } 154 #define _FIXUP_TMU0 \ 155 if (tmu0_sz == 4) { \ 156 project_texcoords( VB, 0, tmu0_source, start, end ); \ 157 hs |= GR_STWHINT_W_DIFF_TMU0; \ 158 } 159 159 160 160 161 #define _FIXUP_TMU1 162 if (tmu1_sz == 4) { 163 project_texcoords( VB, 1, tmu1_source, start, end ); 164 hs |= GR_STWHINT_W_DIFF_TMU1; 165 } 161 #define _FIXUP_TMU1 \ 162 if (tmu1_sz == 4) { \ 163 project_texcoords( VB, 1, tmu1_source, start, end ); \ 164 hs |= GR_STWHINT_W_DIFF_TMU1; \ 165 } 166 166 167 167 168 #define _FIXUP_TMU01 169 if (tmu0_sz == 4) { 170 project_texcoords( VB, 0, tmu0_source, start, end ); 171 if (tmu1_sz == 4) 172 project_texcoords( VB, 1, tmu1_source, start, end );\173 else 174 copy_w( VB, 1, start, end );\175 hs |= (GR_STWHINT_W_DIFF_TMU0|GR_STWHINT_W_DIFF_TMU1); 176 } else if (tmu1_sz == 4) { 177 project_texcoords( VB, 1, tmu1_source, start, end ); 178 hs |= GR_STWHINT_W_DIFF_TMU1; 168 #define _FIXUP_TMU01 \ 169 if (tmu0_sz == 4) { \ 170 project_texcoords( VB, 0, tmu0_source, start, end ); \ 171 if (tmu1_sz == 4) \ 172 project_texcoords( VB, 1, tmu1_source, start, end ); \ 173 else \ 174 copy_w( VB, 1, start, end ); \ 175 hs |= (GR_STWHINT_W_DIFF_TMU0|GR_STWHINT_W_DIFF_TMU1); \ 176 } else if (tmu1_sz == 4) { \ 177 project_texcoords( VB, 1, tmu1_source, start, end ); \ 178 hs |= GR_STWHINT_W_DIFF_TMU1; \ 179 179 } 180 180 181 #define _FIXUP_POST 182 if (hs != fxMesa->stw_hint_state) { 183 fxMesa->stw_hint_state = hs; 184 FX_grHints(GR_HINT_STWHINT, hs); 181 #define _FIXUP_POST \ 182 if (hs != fxMesa->stw_hint_state) { \ 183 fxMesa->stw_hint_state = hs; \ 184 FX_grHints(GR_HINT_STWHINT, hs); \ 185 185 } 186 186
Note:
See TracChangeset
for help on using the changeset viewer.