Changeset 21308 in vbox for trunk/src/VBox/Additions/common/crOpenGL
- Timestamp:
- Jul 7, 2009 10:49:52 AM (16 years ago)
- Location:
- trunk/src/VBox/Additions/common/crOpenGL
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/array/arrayspu.c
r20970 r21308 478 478 } 479 479 #endif 480 //crDebug("arrayspu_DrawElements mode:0x%x, count:%d, type:0x%x", mode, count, type); 481 480 482 481 483 array_spu.self.Begin(mode); … … 521 523 static void ARRAYSPU_APIENTRY arrayspu_ColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) 522 524 { 523 crStateColorPointer( size, type, stride, pointer ); 525 crStateColorPointer(size, type, stride, pointer); 526 array_spu.child.ColorPointer(size, type, stride, pointer); 524 527 } 525 528 526 529 static void ARRAYSPU_APIENTRY arrayspu_SecondaryColorPointerEXT( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) 527 530 { 528 crStateSecondaryColorPointerEXT( size, type, stride, pointer ); 531 crStateSecondaryColorPointerEXT(size, type, stride, pointer); 532 array_spu.child.SecondaryColorPointerEXT(size, type, stride, pointer); 529 533 } 530 534 531 535 static void ARRAYSPU_APIENTRY arrayspu_VertexPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) 532 536 { 533 crStateVertexPointer( size, type, stride, pointer ); 537 crStateVertexPointer(size, type, stride, pointer); 538 array_spu.child.VertexPointer(size, type, stride, pointer); 534 539 } 535 540 536 541 static void ARRAYSPU_APIENTRY arrayspu_TexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) 537 542 { 538 crStateTexCoordPointer( size, type, stride, pointer ); 543 crStateTexCoordPointer(size, type, stride, pointer); 544 array_spu.child.TexCoordPointer(size, type, stride, pointer); 539 545 } 540 546 541 547 static void ARRAYSPU_APIENTRY arrayspu_NormalPointer( GLenum type, GLsizei stride, const GLvoid *pointer ) 542 548 { 543 crStateNormalPointer( type, stride, pointer ); 549 crStateNormalPointer(type, stride, pointer); 550 array_spu.child.NormalPointer(type, stride, pointer); 544 551 } 545 552 546 553 static void ARRAYSPU_APIENTRY arrayspu_IndexPointer( GLenum type, GLsizei stride, const GLvoid *pointer ) 547 554 { 548 crStateIndexPointer( type, stride, pointer ); 555 crStateIndexPointer(type, stride, pointer); 556 array_spu.child.IndexPointer(type, stride, pointer); 549 557 } 550 558 551 559 static void ARRAYSPU_APIENTRY arrayspu_EdgeFlagPointer( GLsizei stride, const GLvoid *pointer ) 552 560 { 553 crStateEdgeFlagPointer( stride, pointer ); 561 crStateEdgeFlagPointer(stride, pointer); 562 array_spu.child.EdgeFlagPointer(stride, pointer); 554 563 } 555 564 556 565 static void ARRAYSPU_APIENTRY arrayspu_VertexAttribPointerNV( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer ) 557 566 { 558 crStateVertexAttribPointerNV( index, size, type, stride, pointer ); 567 crStateVertexAttribPointerNV(index, size, type, stride, pointer); 568 array_spu.child.VertexAttribPointerNV(index, size, type, stride, pointer); 559 569 } 560 570 561 571 static void ARRAYSPU_APIENTRY arrayspu_FogCoordPointerEXT( GLenum type, GLsizei stride, const GLvoid *pointer ) 562 572 { 563 crStateFogCoordPointerEXT( type, stride, pointer ); 573 crStateFogCoordPointerEXT(type, stride, pointer); 574 array_spu.child.FogCoordPointerEXT(type, stride, pointer); 564 575 } 565 576 566 577 static void ARRAYSPU_APIENTRY arrayspu_GetPointerv( GLenum pname, GLvoid **params ) 567 578 { 568 crStateGetPointerv( pname, params);579 crStateGetPointerv(pname, params); 569 580 } 570 581 571 582 static void ARRAYSPU_APIENTRY arrayspu_EnableClientState( GLenum array ) 572 583 { 573 crStateEnableClientState( array ); 584 crStateEnableClientState(array); 585 array_spu.child.EnableClientState(array); 574 586 } 575 587 576 588 static void ARRAYSPU_APIENTRY arrayspu_DisableClientState( GLenum array ) 577 589 { 578 crStateDisableClientState( array ); 590 crStateDisableClientState(array); 591 array_spu.child.DisableClientState(array); 579 592 } 580 593 581 594 static void ARRAYSPU_APIENTRY arrayspu_ClientActiveTextureARB( GLenum texture ) 582 595 { 583 crStateClientActiveTextureARB( texture ); 596 crStateClientActiveTextureARB(texture); 597 array_spu.child.ClientActiveTextureARB(texture); 584 598 } 585 599 … … 662 676 const GLvoid *pointer) 663 677 { 664 crStateVertexAttribPointerARB( index, size, type, normalized, stride, pointer ); 678 crStateVertexAttribPointerARB(index, size, type, normalized, stride, pointer); 679 array_spu.child.VertexAttribPointerARB(index, size, type, normalized, stride, pointer); 665 680 } 666 681 … … 703 718 arrayspu_GenBuffersARB( GLsizei n, GLuint * buffers ) 704 719 { 705 crStateGenBuffersARB(n, buffers);720 array_spu.child.GenBuffersARB(n, buffers); 706 721 } 707 722 … … 710 725 { 711 726 crStateDeleteBuffersARB(n, buffers); 727 array_spu.child.DeleteBuffersARB(n, buffers); 712 728 } 713 729 … … 716 732 { 717 733 crStateBindBufferARB(target, buffer); 734 array_spu.child.BindBufferARB(target, buffer); 718 735 } 719 736 … … 721 738 arrayspu_IsBufferARB (GLuint buffer) 722 739 { 723 return crStateIsBufferARB(buffer);740 return array_spu.child.IsBufferARB(buffer); 724 741 } 725 742 … … 728 745 { 729 746 crStateBufferDataARB(target, size, data, usage); 747 array_spu.child.BufferDataARB(target, size, data, usage); 730 748 } 731 749 … … 735 753 { 736 754 crStateBufferSubDataARB(target, offset, size, data); 755 array_spu.child.BufferSubDataARB(target, offset, size, data); 737 756 } 738 757 … … 752 771 arrayspu_UnmapBufferARB(GLenum target) 753 772 { 754 return crStateUnmapBufferARB(target); 773 crStateUnmapBufferARB(target); 774 return array_spu.child.UnmapBufferARB(target); 755 775 } 756 776 -
trunk/src/VBox/Additions/common/crOpenGL/load.c
r20616 r21308 589 589 #endif 590 590 591 strcpy(response, " 3 0 array 1 feedback 2pack");591 strcpy(response, "2 0 feedback 1 pack"); 592 592 spuchain = crStrSplit( response, " " ); 593 593 num_spus = crStrToInt( spuchain[0] ); -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_bufferobject.c
r20083 r21308 15 15 packspu_MapBufferARB( GLenum target, GLenum access ) 16 16 { 17 GLint size = -1;18 17 GET_CONTEXT(ctx); 19 18 void *buffer; 19 #if 0 20 20 CRBufferObject *bufObj; 21 GLint size = -1; 21 22 22 23 (void) crStateMapBufferARB( target, access ); … … 52 53 */ 53 54 packspu_GetBufferSubDataARB(target, 0, bufObj->size, buffer); 55 #else 56 CRASSERT(GL_TRUE == ctx->clientState->bufferobject.retainBufferData); 57 buffer = crStateMapBufferARB(target, access); 58 #endif 54 59 55 60 return buffer; 61 } 62 63 void PACKSPU_APIENTRY packspu_GetBufferSubDataARB( GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data ) 64 { 65 crStateGetBufferSubDataARB(target, offset, size, data); 56 66 } 57 67 … … 60 70 packspu_UnmapBufferARB( GLenum target ) 61 71 { 72 GET_CONTEXT(ctx); 73 74 #if 0 62 75 CRBufferObject *bufObj; 63 GET_CONTEXT(ctx);64 76 65 77 if (target == GL_ARRAY_BUFFER_ARB) { … … 76 88 /* free the buffer / unmap it */ 77 89 crFree(bufObj->pointer); 90 #endif 78 91 79 92 crStateUnmapBufferARB( target ); … … 84 97 85 98 void PACKSPU_APIENTRY 86 packspu_BufferDataARB( GLenum target, GLsizeiptrARB size, 87 const GLvoid * data, GLenum usage ) 99 packspu_BufferDataARB(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage) 88 100 { 101 /*crDebug("packspu_BufferDataARB size:%d", size);*/ 89 102 crStateBufferDataARB(target, size, data, usage); 90 103 crPackBufferDataARB(target, size, data, usage); 104 } 105 106 void PACKSPU_APIENTRY 107 packspu_BufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data) 108 { 109 /*crDebug("packspu_BufferSubDataARB size:%d", size);*/ 110 crStateBufferSubDataARB(target, offset, size, data); 111 crPackBufferSubDataARB(target, offset, size, data); 91 112 } 92 113 -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_client.c
r20083 r21308 153 153 } 154 154 #endif 155 156 /*crDebug("packspu_InterleavedArrays");*/ 157 155 158 crStateInterleavedArrays( format, stride, pointer ); 156 159 } … … 160 163 packspu_ArrayElement( GLint index ) 161 164 { 165 #if 0 162 166 GLboolean serverArrays = GL_FALSE; 163 167 164 168 #if CR_ARB_vertex_buffer_object 165 169 GET_CONTEXT(ctx); 170 /*crDebug("packspu_ArrayElement index:%i", index);*/ 166 171 if (ctx->clientState->extensions.ARB_vertex_buffer_object) 167 172 serverArrays = crStateUseServerArrays(); … … 184 189 crPackExpandArrayElement( index, clientState ); 185 190 } 191 #else 192 GET_CONTEXT(ctx); 193 CRClientState *clientState = &(ctx->clientState->client); 194 crPackExpandArrayElement(index, clientState); 195 #endif 186 196 } 187 197 … … 194 204 #if CR_ARB_vertex_buffer_object 195 205 GET_CONTEXT(ctx); 206 /*crDebug("DrawElements count=%d, indices=%p", count, indices);*/ 196 207 if (ctx->clientState->extensions.ARB_vertex_buffer_object) 197 208 serverArrays = crStateUseServerArrays(); … … 212 223 crPackExpandDrawElementsSWAP( mode, count, type, indices, clientState ); 213 224 else 225 { 226 //packspu_Begin(mode); 214 227 crPackExpandDrawElements( mode, count, type, indices, clientState ); 228 //packspu_End(); 229 } 215 230 } 216 231 } … … 224 239 #if CR_ARB_vertex_buffer_object 225 240 GET_CONTEXT(ctx); 241 /*crDebug("DrawRangeElements count=%d", count);*/ 226 242 if (ctx->clientState->extensions.ARB_vertex_buffer_object) 227 243 serverArrays = crStateUseServerArrays(); … … 242 258 crPackExpandDrawRangeElementsSWAP( mode, start, end, count, type, indices, clientState ); 243 259 else 260 { 244 261 crPackExpandDrawRangeElements( mode, start, end, count, type, indices, clientState ); 262 } 245 263 } 246 264 } … … 254 272 #if CR_ARB_vertex_buffer_object 255 273 GET_CONTEXT(ctx); 274 /*crDebug("DrawArrays count=%d", count);*/ 256 275 if (ctx->clientState->extensions.ARB_vertex_buffer_object) 257 276 serverArrays = crStateUseServerArrays(); … … 302 321 void PACKSPU_APIENTRY packspu_EnableClientState( GLenum array ) 303 322 { 304 crStateEnableClientState( array ); 323 crStateEnableClientState(array); 324 crPackEnableClientState(array); 305 325 } 306 326 307 327 void PACKSPU_APIENTRY packspu_DisableClientState( GLenum array ) 308 328 { 309 crStateDisableClientState( array ); 329 crStateDisableClientState(array); 330 crPackDisableClientState(array); 310 331 } 311 332 312 333 void PACKSPU_APIENTRY packspu_ClientActiveTextureARB( GLenum texUnit ) 313 334 { 314 crStateClientActiveTextureARB( texUnit ); 315 /* XXX also send to server for texcoord arrays? */ 316 } 317 335 crStateClientActiveTextureARB(texUnit); 336 crPackClientActiveTextureARB(texUnit); 337 } 338 339 void PACKSPU_APIENTRY packspu_EnableVertexAttribArrayARB(GLuint index) 340 { 341 crStateEnableVertexAttribArrayARB(index); 342 crPackEnableVertexAttribArrayARB(index); 343 } 344 345 346 void PACKSPU_APIENTRY packspu_DisableVertexAttribArrayARB(GLuint index) 347 { 348 crStateDisableVertexAttribArrayARB(index); 349 crPackDisableVertexAttribArrayARB(index); 350 } 318 351 319 352 void PACKSPU_APIENTRY packspu_Enable( GLenum cap ) 320 353 { 321 switch (cap) { 322 case GL_VERTEX_ARRAY: 323 case GL_NORMAL_ARRAY: 324 case GL_COLOR_ARRAY: 325 case GL_INDEX_ARRAY: 326 case GL_TEXTURE_COORD_ARRAY: 327 case GL_EDGE_FLAG_ARRAY: 328 case GL_FOG_COORDINATE_ARRAY_EXT: 329 case GL_SECONDARY_COLOR_ARRAY_EXT: 330 #if CR_NV_vertex_program 331 case GL_VERTEX_ATTRIB_ARRAY0_NV: 332 case GL_VERTEX_ATTRIB_ARRAY1_NV: 333 case GL_VERTEX_ATTRIB_ARRAY2_NV: 334 case GL_VERTEX_ATTRIB_ARRAY3_NV: 335 case GL_VERTEX_ATTRIB_ARRAY4_NV: 336 case GL_VERTEX_ATTRIB_ARRAY5_NV: 337 case GL_VERTEX_ATTRIB_ARRAY6_NV: 338 case GL_VERTEX_ATTRIB_ARRAY7_NV: 339 case GL_VERTEX_ATTRIB_ARRAY8_NV: 340 case GL_VERTEX_ATTRIB_ARRAY9_NV: 341 case GL_VERTEX_ATTRIB_ARRAY10_NV: 342 case GL_VERTEX_ATTRIB_ARRAY11_NV: 343 case GL_VERTEX_ATTRIB_ARRAY12_NV: 344 case GL_VERTEX_ATTRIB_ARRAY13_NV: 345 case GL_VERTEX_ATTRIB_ARRAY14_NV: 346 case GL_VERTEX_ATTRIB_ARRAY15_NV: 347 #endif /* CR_NV_vertex_program */ 348 crStateEnableClientState(cap); 349 break; 350 default: 351 ; 352 } 354 crStateEnable(cap); 353 355 354 356 if (pack_spu.swap) … … 361 363 void PACKSPU_APIENTRY packspu_Disable( GLenum cap ) 362 364 { 363 switch (cap) { 364 case GL_VERTEX_ARRAY: 365 case GL_NORMAL_ARRAY: 366 case GL_COLOR_ARRAY: 367 case GL_INDEX_ARRAY: 368 case GL_TEXTURE_COORD_ARRAY: 369 case GL_EDGE_FLAG_ARRAY: 370 case GL_FOG_COORDINATE_ARRAY_EXT: 371 case GL_SECONDARY_COLOR_ARRAY_EXT: 372 #if CR_NV_vertex_program 373 case GL_VERTEX_ATTRIB_ARRAY0_NV: 374 case GL_VERTEX_ATTRIB_ARRAY1_NV: 375 case GL_VERTEX_ATTRIB_ARRAY2_NV: 376 case GL_VERTEX_ATTRIB_ARRAY3_NV: 377 case GL_VERTEX_ATTRIB_ARRAY4_NV: 378 case GL_VERTEX_ATTRIB_ARRAY5_NV: 379 case GL_VERTEX_ATTRIB_ARRAY6_NV: 380 case GL_VERTEX_ATTRIB_ARRAY7_NV: 381 case GL_VERTEX_ATTRIB_ARRAY8_NV: 382 case GL_VERTEX_ATTRIB_ARRAY9_NV: 383 case GL_VERTEX_ATTRIB_ARRAY10_NV: 384 case GL_VERTEX_ATTRIB_ARRAY11_NV: 385 case GL_VERTEX_ATTRIB_ARRAY12_NV: 386 case GL_VERTEX_ATTRIB_ARRAY13_NV: 387 case GL_VERTEX_ATTRIB_ARRAY14_NV: 388 case GL_VERTEX_ATTRIB_ARRAY15_NV: 389 #endif /* CR_NV_vertex_program */ 390 crStateDisableClientState(cap); 391 break; 392 default: 393 ; 394 } 365 crStateDisable(cap); 395 366 396 367 if (pack_spu.swap) … … 400 371 } 401 372 373 GLboolean PACKSPU_APIENTRY packspu_IsEnabled(GLenum cap) 374 { 375 GLboolean res = crStateIsEnabled(cap); 376 #ifdef DEBUG 377 { 378 GET_THREAD(thread); 379 int writeback = 1; 380 GLboolean return_val = (GLboolean) 0; 381 crPackIsEnabled(cap, &return_val, &writeback); 382 packspuFlush( (void *) thread ); 383 while (writeback) 384 crNetRecv(); 385 CRASSERT(return_val==res); 386 } 387 #endif 388 389 return res; 390 } 402 391 403 392 void PACKSPU_APIENTRY packspu_PushClientAttrib( GLbitfield mask ) 404 393 { 405 394 crStatePushClientAttrib(mask); 395 crPackPushClientAttrib(mask); 406 396 } 407 397 … … 409 399 { 410 400 crStatePopClientAttrib(); 411 } 401 crPackPopClientAttrib(); 402 } -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c
r21127 r21308 163 163 /* XXX fix-up sharedCtx param here */ 164 164 pack_spu.context[slot].clientState = crStateCreateContext(NULL, visual, NULL); 165 pack_spu.context[slot].clientState->bufferobject.retainBufferData = GL_TRUE; 165 166 pack_spu.context[slot].serverCtx = serverCtx; 166 167 … … 227 228 crPackSetContext( thread->packer ); 228 229 crStateMakeCurrent( newCtx->clientState ); 230 //crStateSetCurrentPointers(newCtx->clientState, &thread->packer->current); 229 231 serverCtx = pack_spu.context[slot].serverCtx; 230 232 } -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_get.py
r20084 r21308 69 69 print '\t}' 70 70 if func_name in simple_funcs: 71 print '\tif (pname == GL_UNPACK_ALIGNMENT ||' 72 print '\t\tpname == GL_UNPACK_ROW_LENGTH ||' 73 print '\t\tpname == GL_UNPACK_SKIP_PIXELS ||' 74 print '\t\tpname == GL_UNPACK_LSB_FIRST ||' 75 print '\t\tpname == GL_UNPACK_SWAP_BYTES ||' 76 print '#ifdef CR_OPENGL_VERSION_1_2' 77 print '\t\tpname == GL_UNPACK_IMAGE_HEIGHT ||' 78 print '#endif' 79 print '\t\tpname == GL_UNPACK_SKIP_ROWS ||' 80 print '\t\tpname == GL_PACK_ALIGNMENT ||' 81 print '\t\tpname == GL_PACK_ROW_LENGTH ||' 82 print '\t\tpname == GL_PACK_SKIP_PIXELS ||' 83 print '\t\tpname == GL_PACK_LSB_FIRST ||' 84 print '\t\tpname == GL_PACK_SWAP_BYTES ||' 85 print '#ifdef CR_OPENGL_VERSION_1_2' 86 print '\t\tpname == GL_PACK_IMAGE_HEIGHT ||' 87 print '#endif' 88 print '\t\tpname == GL_PACK_SKIP_ROWS' 89 print '\t\t|| pname == GL_DRAW_BUFFER' 90 print '#ifdef CR_OPENGL_VERSION_1_3' 91 print '\t\t|| pname == GL_ACTIVE_TEXTURE' 92 print '#endif' 93 print '#ifdef CR_ARB_multitexture' 94 print '\t\t|| pname == GL_ACTIVE_TEXTURE_ARB' 95 print '#endif' 96 print ') {' 97 print '\t\t\tcrState%s( pname, params );' % func_name 98 print '\t\t\treturn;' 99 print '\t}' 71 print """ 72 if (pname == GL_UNPACK_ALIGNMENT 73 || pname == GL_UNPACK_ROW_LENGTH 74 || pname == GL_UNPACK_SKIP_PIXELS 75 || pname == GL_UNPACK_LSB_FIRST 76 || pname == GL_UNPACK_SWAP_BYTES 77 #ifdef CR_OPENGL_VERSION_1_2 78 || pname == GL_UNPACK_IMAGE_HEIGHT 79 #endif 80 || pname == GL_UNPACK_SKIP_ROWS 81 || pname == GL_PACK_ALIGNMENT 82 || pname == GL_PACK_ROW_LENGTH 83 || pname == GL_PACK_SKIP_PIXELS 84 || pname == GL_PACK_LSB_FIRST 85 || pname == GL_PACK_SWAP_BYTES 86 #ifdef CR_OPENGL_VERSION_1_2 87 || pname == GL_PACK_IMAGE_HEIGHT 88 #endif 89 || pname == GL_PACK_SKIP_ROWS 90 || pname == GL_DRAW_BUFFER 91 #ifdef CR_OPENGL_VERSION_1_3 92 || pname == GL_ACTIVE_TEXTURE 93 #endif 94 #ifdef CR_ARB_multitexture 95 || pname == GL_ACTIVE_TEXTURE_ARB 96 #endif 97 ) 98 { 99 crState%s( pname, params ); 100 return; 101 } 102 """ % func_name 100 103 params.append( ("&writeback", "foo", 0) ) 101 104 print '\tif (pack_spu.swap)' -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_special
r20467 r21308 72 72 GetAttachedObjectsARB 73 73 GetInfoLogARB 74 BufferSubDataARB 75 EnableVertexAttribArrayARB 76 DisableVertexAttribArrayARB 77 GetBufferSubDataARB 78 IsEnabled
Note:
See TracChangeset
for help on using the changeset viewer.