Changeset 3598 for trunk/src/opengl/mesa/vbindirect.c
- Timestamp:
- May 23, 2000, 10:41:28 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/vbindirect.c
r2938 r3598 1 /* $Id: vbindirect.c,v 1. 1 2000-02-29 00:50:14 sandervlExp $ */1 /* $Id: vbindirect.c,v 1.2 2000-05-23 20:41:02 jeroen Exp $ */ 2 2 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. … … 30 30 31 31 32 #include "glheader.h" 32 33 #include "vb.h" 33 34 #include "vbcull.h" … … 115 116 const struct gl_prim_state *state, 116 117 const GLuint *elt, 117 118 118 GLuint start, 119 GLuint count ) 119 120 { 120 121 GLcontext *ctx = VB->ctx; … … 126 127 const GLubyte *clip = VB->ClipMask; 127 128 for (i = start ; i < count ; i++) 128 129 129 if (!clip[elt[i]]) 130 ctx->Driver.PointsFunc( ctx, elt[i], elt[i] ); 130 131 } else { 131 132 for (i = start ; i < count ; i++) 132 133 ctx->Driver.PointsFunc( ctx, elt[i], elt[i] ); 133 134 } 134 135 } … … 136 137 static void 137 138 indexed_render_lines( struct vertex_buffer *VB, 138 139 140 141 139 const struct gl_prim_state *state, 140 const GLuint *elt, 141 GLuint start, 142 GLuint count ) 142 143 { 143 144 GLcontext *ctx = VB->ctx; … … 151 152 152 153 for (i = start ; i < count ; i++) { 153 154 155 156 157 158 ctx->Driver.LineFunc( ctx, prev, curr, curr ); 154 GLuint curr = elt[i]; 155 if (state->draw) { 156 if (clip[curr] | clip[prev]) 157 gl_render_clipped_line( ctx, prev, curr ); 158 else 159 ctx->Driver.LineFunc( ctx, prev, curr, curr ); 159 160 } 160 prev = curr; 161 161 prev = curr; 162 state = state->next; 162 163 } 163 164 if (state->finish_loop) { 164 165 166 167 168 165 GLuint curr = elt[start]; 166 if (clip[curr] | clip[prev]) 167 gl_render_clipped_line( ctx, prev, curr ); 168 else 169 ctx->Driver.LineFunc( ctx, prev, curr, curr ); 169 170 } 170 171 } else { 171 172 GLuint prev = 0; 172 173 for (i = start ; i < count ; i++) { 173 174 175 176 174 GLuint curr = elt[i]; 175 if (state->draw) ctx->Driver.LineFunc( ctx, prev, curr, curr ); 176 prev = curr; 177 state = state->next; 177 178 } 178 179 if (state->finish_loop) { 179 180 180 GLuint curr = elt[start]; 181 ctx->Driver.LineFunc( ctx, prev, curr, curr ); 181 182 } 182 183 } … … 187 188 static void 188 189 indexed_render_tris( struct vertex_buffer *VB, 189 190 191 192 190 const struct gl_prim_state *state, 191 const GLuint *elt, 192 GLuint start, 193 GLuint count ) 193 194 { 194 195 GLcontext *ctx = VB->ctx; … … 203 204 const GLubyte *clip = VB->ClipMask; 204 205 for (i = start ; i < count ; i++) { 205 206 207 208 209 210 211 212 213 214 215 216 217 218 206 v[2] = elt[i]; 207 if (state->draw) { 208 if (clip[v[0]] | clip[v[1]] | clip[v[2]]) { 209 if (!(clip[v[0]] & clip[v[1]] & clip[v[2]] & CLIP_ALL_BITS)) { 210 COPY_3V(vlist, v); 211 gl_render_clipped_triangle( ctx, 3, vlist, vlist[2] ); 212 } 213 } 214 else 215 ctx->TriangleFunc( ctx, v[0], v[1], v[2], v[2] ); 216 } 217 v[0] = v[state->v0]; 218 v[1] = v[state->v1]; 219 state = state->next; 219 220 } 220 221 } else { … … 223 224 224 225 for (i = start ; i < count ; i++) { 225 226 227 228 229 230 226 v[2] = elt[i]; 227 if (state->draw) 228 tf( ctx, v[0], v[1], v[2], v[2] ); 229 v[0] = v[state->v0]; 230 v[1] = v[state->v1]; 231 state = state->next; 231 232 } 232 233 } … … 236 237 static void 237 238 indexed_render_noop( struct vertex_buffer *VB, 238 239 240 241 242 { 243 244 245 246 247 239 const struct gl_prim_state *state, 240 const GLuint *elt, 241 GLuint start, 242 GLuint count ) 243 { 244 (void) VB; 245 (void) state; 246 (void) elt; 247 (void) start; 248 (void) count; 248 249 } 249 250 250 251 251 252 typedef void (*indexed_render_func)( struct vertex_buffer *VB, 252 253 254 255 253 const struct gl_prim_state *state, 254 const GLuint *elt, 255 GLuint start, 256 GLuint count ); 256 257 257 258 … … 297 298 298 299 gl_import_client_data( VB, ctx->RenderFlags, 299 300 301 300 (VB->ClipOrMask 301 ? VEC_WRITABLE|VEC_GOOD_STRIDE 302 : VEC_GOOD_STRIDE)); 302 303 303 304 ctx->VB = VB; … … 313 314 314 315 if (ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { 315 316 317 316 VB->Specular = VB->Spec[0]; 317 VB->ColorPtr = VB->Color[0]; 318 VB->IndexPtr = VB->Index[0]; 318 319 } 319 320 320 321 } while (ctx->Driver.MultipassFunc && 321 322 ctx->Driver.MultipassFunc( VB, ++p )); 322 323 323 324 … … 346 347 347 348 gl_import_client_data( cvaVB, ctx->RenderFlags, 348 349 350 349 (VB->ClipOrMask 350 ? VEC_WRITABLE|VEC_GOOD_STRIDE 351 : VEC_GOOD_STRIDE)); 351 352 352 353 ctx->VB = cvaVB; … … 360 361 do { 361 362 for (i = VB->CopyStart ; i < count ; parity = 0, i = next ) { 362 363 364 365 366 367 368 369 370 371 372 373 374 363 prim = VB->Primitive[i]; 364 next = VB->NextPrimitive[i]; 365 366 state = gl_prim_state_machine[prim][parity]; 367 func = prim_func[prim]; 368 369 func( cvaVB, state, VB->EltPtr->data, i, next ); 370 371 if (ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { 372 cvaVB->Specular = cvaVB->Spec[0]; 373 cvaVB->ColorPtr = cvaVB->Color[0]; 374 cvaVB->IndexPtr = cvaVB->Index[0]; 375 } 375 376 } 376 377 377 378 } while (ctx->Driver.MultipassFunc && 378 379 ctx->Driver.MultipassFunc( VB, ++p )); 379 380 380 381
Note:
See TracChangeset
for help on using the changeset viewer.