Changeset 78190 in vbox for trunk/src/VBox/Additions/common/crOpenGL
- Timestamp:
- Apr 18, 2019 12:07:07 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo
-
old new 9 9 /branches/VBox-5.1:112367,115992,116543,116550,116568,116573 10 10 /branches/VBox-5.2:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124260,124263,124271,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812 11 /branches/aeichner/vbox-chromium-cleanup:129816,129818-129851,129853-129861,129871-129872,129876,129880,129882,130013-130015,130036,130094-130095 11 12 /branches/andy/draganddrop:90781-91268 12 13 /branches/andy/guestctrl20:78916,78930
-
- Property svn:mergeinfo
-
trunk/src/VBox
- Property svn:mergeinfo
-
old new 9 9 /branches/VBox-5.1/src/VBox:112367,116543,116550,116568,116573 10 10 /branches/VBox-5.2/src/VBox:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124263,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812,127158-127159,127162-127167,127180 11 /branches/aeichner/vbox-chromium-cleanup/src/VBox:129818-129851,129853-129861,129871-129872,129876,129880,129882,130013-130015,130094-130095 11 12 /branches/andy/draganddrop/src/VBox:90781-91268 12 13 /branches/andy/guestctrl20/src/VBox:78916,78930
-
- Property svn:mergeinfo
-
trunk/src/VBox/Additions/common/crOpenGL/array/arrayspu_config.c
r69310 r78190 15 15 } 16 16 17 /* No SPU options yet.18 */19 SPUOptions arraySPUOptions[] = {20 { NULL, CR_BOOL, 0, NULL, NULL, NULL, NULL, NULL },21 };22 23 24 17 void arrayspuSetVBoxConfiguration( void ) 25 18 { -
trunk/src/VBox/Additions/common/crOpenGL/array/arrayspu_init.c
r69310 r78190 11 11 12 12 extern SPUNamedFunctionTable _cr_array_table[]; 13 14 extern SPUOptions arraySPUOptions[];15 13 16 14 static SPUFunctions array_functions = { … … 73 71 int SPULoad( char **name, char **super, SPUInitFuncPtr *init, 74 72 SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup, 75 SPUOptionsPtr *options,int *flags )73 int *flags ) 76 74 { 77 75 *name = "array"; … … 80 78 *self = arraySPUSelfDispatch; 81 79 *cleanup = arraySPUCleanup; 82 *options = arraySPUOptions;83 80 *flags = (SPU_NO_PACKER|SPU_NOT_TERMINAL|SPU_MAX_SERVERS_ZERO); 84 81 -
trunk/src/VBox/Additions/common/crOpenGL/context.c
r69310 r78190 29 29 #include "cr_mem.h" 30 30 #include "cr_string.h" 31 #include "cr_environment.h"32 31 #include "stub.h" 33 32 -
trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu.h
r76563 r78190 18 18 19 19 #include "cr_spu.h" 20 #include "cr_timer.h"21 20 #include "cr_glstate.h" 22 21 … … 52 51 extern SPUNamedFunctionTable _cr_feedback_table[]; 53 52 54 extern SPUOptions feedbackSPUOptions[];55 56 53 extern void feedbackspuGatherConfiguration( void ); 57 54 -
trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu_config.c
r63206 r78190 6 6 7 7 #include "cr_string.h" 8 #include "cr_environment.h"9 8 #include "cr_error.h" 10 9 #include "cr_mem.h" … … 21 20 } 22 21 23 static void set_default_viewport( void *foo, const char *response )24 {25 (void) foo;26 sscanf( response, "%d", &(feedback_spu.default_viewport) );27 }28 29 /* option, type, nr, default, min, max, title, callback30 */31 SPUOptions feedbackSPUOptions[] = {32 33 { "default_viewport", CR_BOOL, 1, "0", "0", "1",34 "Return default viewport parameters", (SPUOptionCB)set_default_viewport },35 36 { NULL, CR_BOOL, 0, NULL, NULL, NULL, NULL, NULL },37 38 };39 40 22 41 23 void feedbackspuGatherConfiguration( void ) -
trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu_init.c
r69310 r78190 6 6 7 7 #include "cr_spu.h" 8 #include "cr_environment.h"9 8 #include "cr_string.h" 10 9 #include "cr_error.h" … … 73 72 int SPULoad( char **name, char **super, SPUInitFuncPtr *init, 74 73 SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup, 75 SPUOptionsPtr *options,int *flags )74 int *flags ) 76 75 { 77 76 *name = "feedback"; … … 80 79 *self = feedbackSPUSelfDispatch; 81 80 *cleanup = feedbackSPUCleanup; 82 *options = feedbackSPUOptions;83 81 *flags = (SPU_NO_PACKER|SPU_NOT_TERMINAL|SPU_MAX_SERVERS_ZERO); 84 82 -
trunk/src/VBox/Additions/common/crOpenGL/icd_drv.c
r76553 r78190 28 28 29 29 #include <iprt/win/windows.h> 30 31 #include <stdio.h> /*sprintf*/ 30 32 31 33 /// @todo consider -
trunk/src/VBox/Additions/common/crOpenGL/load.c
r76474 r78190 11 11 #include "cr_string.h" 12 12 #include "cr_net.h" 13 #include "cr_environment.h"14 13 #include "cr_process.h" 15 #include "cr_rand.h"16 14 #include "cr_netserver.h" 17 15 #include "stub.h" … … 19 17 #include <string.h> 20 18 #include <signal.h> 19 #include <stdio.h> /*swprintf*/ 21 20 #include <iprt/initterm.h> 22 21 #include <iprt/thread.h> 23 22 #include <iprt/errcore.h> 24 23 #include <iprt/asm.h> 24 #include <iprt/env.h> 25 25 #ifndef WINDOWS 26 26 # include <sys/types.h> … … 601 601 602 602 603 #if 0 /* unused */604 605 /**606 * Return a free port number for the mothership to use, or -1 if we607 * can't find one.608 */609 static int610 GenerateMothershipPort(void)611 {612 const int MAX_PORT = 10100;613 unsigned short port;614 615 /* generate initial port number randomly */616 crRandAutoSeed();617 port = (unsigned short) crRandInt(10001, MAX_PORT);618 619 #ifdef WINDOWS620 /* XXX should implement a free port check here */621 return port;622 #else623 /*624 * See if this port number really is free, try another if needed.625 */626 {627 struct sockaddr_in servaddr;628 int so_reuseaddr = 1;629 int sock, k;630 631 /* create socket */632 sock = socket(AF_INET, SOCK_STREAM, 0);633 CRASSERT(sock > 2);634 635 /* deallocate socket/port when we exit */636 k = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,637 (char *) &so_reuseaddr, sizeof(so_reuseaddr));638 CRASSERT(k == 0);639 640 /* initialize the servaddr struct */641 crMemset(&servaddr, 0, sizeof(servaddr) );642 servaddr.sin_family = AF_INET;643 servaddr.sin_addr.s_addr = htonl(INADDR_ANY);644 645 while (port < MAX_PORT) {646 /* Bind to the given port number, return -1 if we fail */647 servaddr.sin_port = htons((unsigned short) port);648 k = bind(sock, (struct sockaddr *) &servaddr, sizeof(servaddr));649 if (k) {650 /* failed to create port. try next one. */651 port++;652 }653 else {654 /* free the socket/port now so mothership can make it */655 close(sock);656 return port;657 }658 }659 }660 #endif /* WINDOWS */661 return -1;662 }663 664 665 /**666 * Try to determine which mothership configuration to use for this program.667 */668 static char **669 LookupMothershipConfig(const char *procName)670 {671 const int procNameLen = crStrlen(procName);672 FILE *f;673 const char *home;674 char configPath[1000];675 676 /* first, check if the CR_CONFIG env var is set */677 {678 const char *conf = crGetenv("CR_CONFIG");679 if (conf && crStrlen(conf) > 0)680 return crStrSplit(conf, " ");681 }682 683 /* second, look up config name from config file */684 home = crGetenv("HOME");685 if (home)686 sprintf(configPath, "%s/%s", home, CONFIG_LOOKUP_FILE);687 else688 crStrcpy(configPath, CONFIG_LOOKUP_FILE); /* from current dir */689 /* Check if the CR_CONFIG_PATH env var is set. */690 {691 const char *conf = crGetenv("CR_CONFIG_PATH");692 if (conf)693 crStrcpy(configPath, conf); /* from env var */694 }695 696 f = fopen(configPath, "r");697 if (!f) {698 return NULL;699 }700 701 while (!feof(f)) {702 char line[1000];703 char **args;704 fgets(line, 999, f);705 line[crStrlen(line) - 1] = 0; /* remove trailing newline */706 if (crStrncmp(line, procName, procNameLen) == 0 &&707 (line[procNameLen] == ' ' || line[procNameLen] == '\t'))708 {709 crWarning("Using Chromium configuration for %s from %s",710 procName, configPath);711 args = crStrSplit(line + procNameLen + 1, " ");712 return args;713 }714 }715 fclose(f);716 return NULL;717 }718 719 720 static int Mothership_Awake = 0;721 722 723 /**724 * Signal handler to determine when mothership is ready.725 */726 static void727 MothershipPhoneHome(int signo)728 {729 crDebug("Got signal %d: mothership is awake!", signo);730 Mothership_Awake = 1;731 }732 733 #endif /* 0 */734 735 603 static void stubSetDefaultConfigurationOptions(void) 736 604 { 737 unsigned char key[16]= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};738 739 605 stub.appDrawCursor = 0; 740 606 stub.minChromiumWindowWidth = 0; … … 752 618 stub.matchChromiumWindowCount = 0; 753 619 stub.spu_dir = NULL; 754 crNetSetRank(0);755 crNetSetContextRange(32, 35);756 crNetSetNodeRange("iam0", "iamvis20");757 crNetSetKey(key,sizeof(key));758 620 stub.force_pbuffers = 0; 759 621 … … 963 825 964 826 /** @todo check if it'd be of any use on other than guests, no use for windows */ 965 app_id = crGetenv( "CR_APPLICATION_ID_NUMBER" );827 app_id = RTEnvGet( "CR_APPLICATION_ID_NUMBER" ); 966 828 967 829 crNetInit( NULL, NULL ); … … 1347 1209 1348 1210 #ifdef VDBG_VEHANDLER 1349 env = crGetenv("CR_DBG_VEH_ENABLE");1211 env = RTEnvGet("CR_DBG_VEH_ENABLE"); 1350 1212 g_VBoxVehEnable = crStrParseI32(env, 1351 1213 # ifdef DEBUG_misha … … 1362 1224 size_t cChars; 1363 1225 1364 env = crGetenv("CR_DBG_VEH_FLAGS");1226 env = RTEnvGet("CR_DBG_VEH_FLAGS"); 1365 1227 g_VBoxVehFlags = crStrParseI32(env, 1366 1228 0 … … 1372 1234 ); 1373 1235 1374 env = crGetenv("CR_DBG_VEH_DUMP_DIR");1236 env = RTEnvGet("CR_DBG_VEH_DUMP_DIR"); 1375 1237 if (!env) 1376 1238 env = VBOXMD_DUMP_DIR_DEFAULT; … … 1410 1272 g_aszwVBoxMdFilePrefix[g_cVBoxMdFilePrefixLen] = L'\0'; 1411 1273 1412 env = crGetenv("CR_DBG_VEH_DUMP_TYPE");1274 env = RTEnvGet("CR_DBG_VEH_DUMP_TYPE"); 1413 1275 1414 1276 g_enmVBoxMdDumpType = crStrParseI32(env, -
trunk/src/VBox/Additions/common/crOpenGL/pack/pack.py
r69310 r78190 53 53 print('\t__fillin(%3d, "%s", (SPUGenericFunction) packspu_%s);' % (index, func_name, func_name )) 54 54 else: 55 print('\t__fillin(%3d, "%s", (SPUGenericFunction) ( pack_spu.swap ? crPack%sSWAP : crPack%s));' % (index, func_name, func_name, func_name ))55 print('\t__fillin(%3d, "%s", (SPUGenericFunction) (crPack%s));' % (index, func_name, func_name )) 56 56 print('\t__fillin(%3d, NULL, NULL);' % num_funcs) 57 57 print('}') -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu.h
r76563 r78190 82 82 typedef struct { 83 83 int id; 84 int swap;85 84 86 85 /* config options */ -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_beginend.py
r69310 r78190 48 48 #endif 49 49 50 if (pack_spu.swap) 51 { 52 crPackBeginSWAP( mode ); 53 } 54 else 55 { 56 crPackBegin( mode ); 57 } 58 50 crPackBegin( mode ); 59 51 if ( thread->netServer.conn->Barf ) { 60 52 thread->BeginEndMode = mode; … … 99 91 } 100 92 101 if (pack_spu.swap) 102 { 103 crPackEndSWAP(); 104 } 105 else 106 { 107 crPackEnd(); 108 } 93 crPackEnd(); 109 94 } 110 95 … … 166 151 print('void PACKSPU_APIENTRY packspu_%s(%s)' % ( func_name, apiutil.MakeDeclarationString(params) )) 167 152 print('{') 168 print('\tif (pack_spu.swap)') 169 print('\t{') 170 print('\t\tcrPack%sSWAP(%s);' % ( func_name, apiutil.MakeCallString( params ) )) 171 print('\t}') 172 print('\telse') 173 print('\t{') 174 print('\t\tcrPack%s(%s);' % ( func_name, apiutil.MakeCallString( params ) )) 175 print('\t}') 153 print('\tcrPack%s(%s);' % ( func_name, apiutil.MakeCallString( params ) )) 176 154 print('\tRunState();') 177 155 print('}') -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_bufferobject.c
r69310 r78190 140 140 crError( "packspu_GenBuffersARB doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!" ); 141 141 } 142 if (pack_spu.swap) 143 { 144 crPackGenBuffersARBSWAP( n, buffer, &writeback ); 145 } 146 else 147 { 148 crPackGenBuffersARB( n, buffer, &writeback ); 149 } 142 143 crPackGenBuffersARB( n, buffer, &writeback ); 150 144 packspuFlush( (void *) thread ); 151 145 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_client.c
r69310 r78190 15 15 #if CR_ARB_vertex_buffer_object 16 16 GET_CONTEXT(ctx); 17 if (ctx->clientState->extensions.ARB_vertex_buffer_object) { 18 if (pack_spu.swap) 19 crPackFogCoordPointerEXTSWAP( type, stride, pointer ); 20 else 21 crPackFogCoordPointerEXT( type, stride, pointer ); 17 if (ctx->clientState->extensions.ARB_vertex_buffer_object) { 18 crPackFogCoordPointerEXT( type, stride, pointer ); 22 19 } 23 20 #endif … … 30 27 GET_CONTEXT(ctx); 31 28 if (ctx->clientState->extensions.ARB_vertex_buffer_object) { 32 if (pack_spu.swap) 33 crPackColorPointerSWAP( size, type, stride, pointer ); 34 else 35 crPackColorPointer( size, type, stride, pointer ); 29 crPackColorPointer( size, type, stride, pointer ); 36 30 } 37 31 #endif … … 44 38 GET_CONTEXT(ctx); 45 39 if (ctx->clientState->extensions.ARB_vertex_buffer_object) { 46 if (pack_spu.swap) 47 crPackSecondaryColorPointerEXTSWAP( size, type, stride, pointer ); 48 else 49 crPackSecondaryColorPointerEXT( size, type, stride, pointer ); 40 crPackSecondaryColorPointerEXT( size, type, stride, pointer ); 50 41 } 51 42 #endif … … 59 50 CRASSERT(ctx->clientState->extensions.ARB_vertex_buffer_object); 60 51 if (ctx->clientState->extensions.ARB_vertex_buffer_object) { 61 if (pack_spu.swap) 62 crPackVertexPointerSWAP( size, type, stride, pointer ); 63 else 64 crPackVertexPointer( size, type, stride, pointer ); 52 crPackVertexPointer( size, type, stride, pointer ); 65 53 } 66 54 #endif … … 73 61 GET_CONTEXT(ctx); 74 62 if (ctx->clientState->extensions.ARB_vertex_buffer_object) { 75 if (pack_spu.swap) 76 crPackTexCoordPointerSWAP( size, type, stride, pointer ); 77 else 78 crPackTexCoordPointer( size, type, stride, pointer ); 63 crPackTexCoordPointer( size, type, stride, pointer ); 79 64 } 80 65 #endif … … 87 72 GET_CONTEXT(ctx); 88 73 if (ctx->clientState->extensions.ARB_vertex_buffer_object) { 89 if (pack_spu.swap) 90 crPackNormalPointerSWAP( type, stride, pointer ); 91 else 92 crPackNormalPointer( type, stride, pointer ); 74 crPackNormalPointer( type, stride, pointer ); 93 75 } 94 76 #endif … … 101 83 GET_CONTEXT(ctx); 102 84 if (ctx->clientState->extensions.ARB_vertex_buffer_object) { 103 if (pack_spu.swap) 104 crPackEdgeFlagPointerSWAP( stride, pointer ); 105 else 106 crPackEdgeFlagPointer( stride, pointer ); 85 crPackEdgeFlagPointer( stride, pointer ); 107 86 } 108 87 #endif … … 115 94 GET_CONTEXT(ctx); 116 95 if (ctx->clientState->extensions.ARB_vertex_buffer_object) { 117 if (pack_spu.swap) 118 crPackVertexAttribPointerARBSWAP( index, size, type, normalized, stride, pointer ); 119 else 120 crPackVertexAttribPointerARB( index, size, type, normalized, stride, pointer ); 96 crPackVertexAttribPointerARB( index, size, type, normalized, stride, pointer ); 121 97 } 122 98 #endif … … 129 105 GET_CONTEXT(ctx); 130 106 if (ctx->clientState->extensions.ARB_vertex_buffer_object) { 131 if (pack_spu.swap) 132 crPackVertexAttribPointerNVSWAP( index, size, type, stride, pointer ); 133 else 134 crPackVertexAttribPointerNV( index, size, type, stride, pointer ); 107 crPackVertexAttribPointerNV( index, size, type, stride, pointer ); 135 108 } 136 109 #endif … … 143 116 GET_CONTEXT(ctx); 144 117 if (ctx->clientState->extensions.ARB_vertex_buffer_object) { 145 if (pack_spu.swap) 146 crPackIndexPointerSWAP( type, stride, pointer ); 147 else 148 crPackIndexPointer( type, stride, pointer ); 118 crPackIndexPointer( type, stride, pointer ); 149 119 } 150 120 #endif … … 162 132 GET_CONTEXT(ctx); 163 133 if (ctx->clientState->extensions.ARB_vertex_buffer_object) { 164 if (pack_spu.swap) 165 crPackInterleavedArraysSWAP( format, stride, pointer ); 166 else 167 crPackInterleavedArrays( format, stride, pointer ); 134 crPackInterleavedArrays( format, stride, pointer ); 168 135 } 169 136 #endif … … 380 347 381 348 /* Send the DrawArrays command over the wire */ 382 if (pack_spu.swap) 383 crPackArrayElementSWAP( index ); 384 else 385 crPackArrayElement( index ); 349 crPackArrayElement( index ); 386 350 387 351 if (cZvaValues) … … 400 364 #endif 401 365 402 if (pack_spu.swap) 403 crPackExpandArrayElementSWAP( index, clientState, cZvaValues ? aAttrib : NULL ); 404 else 405 crPackExpandArrayElement( index, clientState, cZvaValues ? aAttrib : NULL ); 366 crPackExpandArrayElement( index, clientState, cZvaValues ? aAttrib : NULL ); 406 367 407 368 #ifdef CR_FORCE_ZVA_SERVER_ARRAY … … 529 490 530 491 /* Send the DrawArrays command over the wire */ 531 if (pack_spu.swap) 532 crPackDrawElementsSWAP( mode, count, type, indices ); 533 else 534 crPackDrawElements( mode, count, type, indices ); 492 crPackDrawElements( mode, count, type, indices ); 535 493 536 494 if (cZvaValues) … … 549 507 #endif 550 508 551 if (pack_spu.swap) 552 crPackExpandDrawElementsSWAP( mode, count, type, indices, clientState, cZvaValues ? aAttrib : NULL ); 553 else 554 { 555 //packspu_Begin(mode); 556 crPackExpandDrawElements( mode, count, type, indices, clientState, cZvaValues ? aAttrib : NULL ); 557 //packspu_End(); 558 } 509 //packspu_Begin(mode); 510 crPackExpandDrawElements( mode, count, type, indices, clientState, cZvaValues ? aAttrib : NULL ); 511 //packspu_End(); 559 512 560 513 #ifdef CR_FORCE_ZVA_SERVER_ARRAY … … 615 568 616 569 /* Send the DrawRangeElements command over the wire */ 617 if (pack_spu.swap) 618 crPackDrawRangeElementsSWAP( mode, start, end, count, type, indices ); 619 else 620 crPackDrawRangeElements( mode, start, end, count, type, indices ); 570 crPackDrawRangeElements( mode, start, end, count, type, indices ); 621 571 622 572 if (cZvaValues) … … 634 584 #endif 635 585 636 if (pack_spu.swap) 637 crPackExpandDrawRangeElementsSWAP( mode, start, end, count, type, indices, clientState, cZvaValues ? aAttrib : NULL ); 638 else 639 { 640 crPackExpandDrawRangeElements( mode, start, end, count, type, indices, clientState, cZvaValues ? aAttrib : NULL ); 641 } 586 crPackExpandDrawRangeElements( mode, start, end, count, type, indices, clientState, cZvaValues ? aAttrib : NULL ); 642 587 643 588 #ifdef CR_FORCE_ZVA_SERVER_ARRAY … … 709 654 710 655 /* Send the DrawArrays command over the wire */ 711 if (pack_spu.swap) 712 crPackDrawArraysSWAP( mode, first, count ); 713 else 714 crPackDrawArrays( mode, first, count ); 656 crPackDrawArrays( mode, first, count ); 715 657 716 658 if (cZvaValues) … … 729 671 #endif 730 672 731 if (pack_spu.swap) 732 crPackExpandDrawArraysSWAP( mode, first, count, clientState, cZvaValues ? aAttrib : NULL ); 733 else 734 crPackExpandDrawArrays( mode, first, count, clientState, cZvaValues ? aAttrib : NULL ); 673 crPackExpandDrawArrays( mode, first, count, clientState, cZvaValues ? aAttrib : NULL ); 735 674 736 675 #ifdef CR_FORCE_ZVA_SERVER_ARRAY … … 809 748 { 810 749 crStateEnable(cap); 811 812 if (pack_spu.swap) 813 crPackEnableSWAP(cap); 814 else 815 crPackEnable(cap); 750 crPackEnable(cap); 816 751 } 817 752 else … … 834 769 { 835 770 crStateDisable(cap); 836 837 if (pack_spu.swap) 838 crPackDisableSWAP(cap); 839 else 840 crPackDisable(cap); 771 crPackDisable(cap); 841 772 } 842 773 else -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_config.c
r69310 r78190 23 23 24 24 25 static void set_emit( void *foo, const char *response )26 {27 RT_NOREF(foo);28 sscanf( response, "%d", &(pack_spu.emit_GATHER_POST_SWAPBUFFERS) );29 }30 31 static void set_swapbuffer_sync( void *foo, const char *response )32 {33 RT_NOREF(foo);34 sscanf( response, "%d", &(pack_spu.swapbuffer_sync) );35 }36 37 38 39 /* No SPU options yet. Well.. not really..40 */41 SPUOptions packSPUOptions[] = {42 { "emit_GATHER_POST_SWAPBUFFERS", CR_BOOL, 1, "0", NULL, NULL,43 "Emit a parameter after SwapBuffers", (SPUOptionCB)set_emit },44 45 { "swapbuffer_sync", CR_BOOL, 1, "1", NULL, NULL,46 "Sync on SwapBuffers", (SPUOptionCB) set_swapbuffer_sync },47 48 { NULL, CR_BOOL, 0, NULL, NULL, NULL, NULL, NULL },49 };50 51 52 25 void packspuSetVBoxConfiguration( const SPU *child_spu ) 53 26 { -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c
r69310 r78190 69 69 /* packer setup */ 70 70 CRASSERT(thread->packer == NULL); 71 thread->packer = crPackNewContext( pack_spu.swap);71 thread->packer = crPackNewContext(); 72 72 CRASSERT(thread->packer); 73 73 crPackInitBuffer( &(thread->buffer), crNetAlloc(thread->netServer.conn), … … 357 357 358 358 /* Pack the command */ 359 if (pack_spu.swap) 360 crPackCreateContextSWAP( dpyName, visual, shareCtx, &serverCtx, &writeback ); 361 else 362 crPackCreateContext( dpyName, visual, shareCtx, &serverCtx, &writeback ); 359 crPackCreateContext( dpyName, visual, shareCtx, &serverCtx, &writeback ); 363 360 364 361 /* Flush buffer and get return value */ … … 385 382 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); 386 383 387 if (pack_spu.swap) {388 serverCtx = (GLint) SWAP32(serverCtx);389 }390 384 if (serverCtx < 0) { 391 385 #ifdef CHROMIUM_THREADSAFE … … 472 466 } 473 467 474 if (pack_spu.swap) 475 crPackDestroyContextSWAP( context->serverCtx ); 476 else 477 crPackDestroyContext( context->serverCtx ); 478 468 crPackDestroyContext( context->serverCtx ); 479 469 crStateDestroyContext( context->clientState ); 480 470 … … 600 590 } 601 591 602 if (pack_spu.swap) 603 crPackMakeCurrentSWAP( window, nativeWindow, serverCtx ); 604 else 605 crPackMakeCurrent( window, nativeWindow, serverCtx ); 606 592 crPackMakeCurrent( window, nativeWindow, serverCtx ); 607 593 if (serverCtx) 608 594 { -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_flush.py
r69310 r78190 31 31 print('{') 32 32 print('\tGET_THREAD(thread);') 33 print('\tif (pack_spu.swap)') 34 print('\t{') 35 print('\t\tcrPack%sSWAP(%s);' % ( func_name, apiutil.MakeCallString( params ) )) 36 print('\t}') 37 print('\telse') 38 print('\t{') 39 print('\t\tcrPack%s(%s);' % ( func_name, apiutil.MakeCallString( params ) )) 40 print('\t}') 33 print('\tcrPack%s(%s);' % ( func_name, apiutil.MakeCallString( params ) )) 41 34 print('\tpackspuFlush( (void *) thread );') 42 35 print('}\n') -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_framebuffer.c
r76553 r78190 107 107 crError( "packspu_GenFramebuffersEXT doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!" ); 108 108 } 109 if (pack_spu.swap) 110 { 111 crPackGenFramebuffersEXTSWAP( n, framebuffers, &writeback ); 112 } 113 else 114 { 115 crPackGenFramebuffersEXT( n, framebuffers, &writeback ); 116 } 109 110 crPackGenFramebuffersEXT( n, framebuffers, &writeback ); 117 111 packspuFlush( (void *) thread ); 118 112 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); … … 129 123 crError( "packspu_GenRenderbuffersEXT doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!" ); 130 124 } 131 if (pack_spu.swap) 132 { 133 crPackGenRenderbuffersEXTSWAP( n, renderbuffers, &writeback ); 134 } 135 else 136 { 137 crPackGenRenderbuffersEXT( n, renderbuffers, &writeback ); 138 } 125 126 crPackGenRenderbuffersEXT( n, renderbuffers, &writeback ); 139 127 packspuFlush( (void *) thread ); 140 128 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_get.py
r69310 r78190 49 49 """) 50 50 51 print('#ifdef DEBUG'); 51 52 from get_sizes import * 52 53 easy_swaps = { 54 'GenTextures': '(unsigned int) n', 55 'GetClipPlane': '4', 56 'GetPolygonStipple': '0' 57 } 53 print('#endif'); 58 54 59 55 simple_funcs = [ 'GetIntegerv', 'GetFloatv', 'GetDoublev', 'GetBooleanv' ] 60 simple_swaps = [ 'SWAP32', 'SWAPFLOAT', 'SWAPDOUBLE', '(GLboolean) SWAP32' ]61 62 56 vertattr_get_funcs = [ 'GetVertexAttribdv' 'GetVertexAttribfv' 'GetVertexAttribiv' ] 63 64 hard_funcs = {65 'GetLightfv': 'SWAPFLOAT',66 'GetLightiv': 'SWAP32',67 'GetMaterialfv': 'SWAPFLOAT',68 'GetMaterialiv': 'SWAP32',69 'GetTexEnvfv': 'SWAPFLOAT',70 'GetTexEnviv': 'SWAP32',71 'GetTexGendv': 'SWAPDOUBLE',72 'GetTexGenfv': 'SWAPFLOAT',73 'GetTexGeniv': 'SWAP32',74 'GetTexLevelParameterfv': 'SWAPFLOAT',75 'GetTexLevelParameteriv': 'SWAP32',76 'GetTexParameterfv': 'SWAPFLOAT',77 'GetTexParameteriv': 'SWAP32' }78 57 79 58 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 93 72 print('\t%s return_val = (%s) 0;' % (return_type, return_type)) 94 73 params.append( ("&return_val", "foo", 0) ) 95 if (func_name in easy_swaps and easy_swaps[func_name] != '0') or func_name in simple_funcs or func_name in hard_funcs:96 print('\tunsigned int i;')97 74 print('\tif (!CRPACKSPU_IS_WDDM_CRHGSMI() && !(pack_spu.thread[pack_spu.idxThreadInUse].netServer.conn->actual_network))') 98 75 print('\t{') … … 138 115 ) 139 116 { 117 unsigned int i = 0; 140 118 %s localparams; 141 119 localparams = (%s) crAlloc(__numValues(pname) * sizeof(*localparams)); … … 193 171 194 172 params.append( ("&writeback", "foo", 0) ) 195 print('\tif (pack_spu.swap)') 196 print('\t{') 197 print('\t\tcrPack%sSWAP(%s);' % (func_name, apiutil.MakeCallString( params ) )) 198 print('\t}') 199 print('\telse') 200 print('\t{') 201 print('\t\tcrPack%s(%s);' % (func_name, apiutil.MakeCallString( params ) )) 202 print('\t}') 173 print('\tcrPack%s(%s);' % (func_name, apiutil.MakeCallString( params ) )) 203 174 print('\tpackspuFlush( (void *) thread );') 204 175 print('\tCRPACKSPU_WRITEBACK_WAIT(thread, writeback);') … … 208 179 lastParamName = params[-2][0] 209 180 if return_type != 'void': 210 print('\tif (pack_spu.swap)')211 print('\t{')212 print('\t\treturn_val = (%s) SWAP32(return_val);' % return_type)213 print('\t}')214 181 print('\treturn return_val;') 215 if func_name in easy_swaps and easy_swaps[func_name] != '0':216 limit = easy_swaps[func_name]217 print('\tif (pack_spu.swap)')218 print('\t{')219 print('\t\tfor (i = 0; i < %s; i++)' % limit)220 print('\t\t{')221 if params[-2][1].find( "double" ) > -1:222 print('\t\t\t%s[i] = SWAPDOUBLE(%s[i]);' % (lastParamName, lastParamName))223 else:224 print('\t\t\t%s[i] = SWAP32(%s[i]);' % (lastParamName, lastParamName))225 print('\t\t}')226 print('\t}')227 for index in range(len(simple_funcs)):228 if simple_funcs[index] == func_name:229 print('\tif (pack_spu.swap)')230 print('\t{')231 print('\t\tfor (i = 0; i < __numValues(pname); i++)')232 print('\t\t{')233 if simple_swaps[index] == 'SWAPDOUBLE':234 print('\t\t\t%s[i] = %s(%s[i]);' % (lastParamName, simple_swaps[index], lastParamName))235 else:236 print('\t\t\t((GLuint *) %s)[i] = %s(%s[i]);' % (lastParamName, simple_swaps[index], lastParamName))237 print('\t\t}')238 print('\t}')239 if func_name in hard_funcs:240 print('\tif (pack_spu.swap)')241 print('\t{')242 print('\t\tfor (i = 0; i < crStateHlpComponentsCount(pname); i++)')243 print('\t\t{')244 if hard_funcs[func_name] == 'SWAPDOUBLE':245 print('\t\t\t%s[i] = %s(%s[i]);' % (lastParamName, hard_funcs[func_name], lastParamName))246 else:247 print('\t\t\t((GLuint *) %s)[i] = %s(%s[i]);' % (lastParamName, hard_funcs[func_name], lastParamName))248 print('\t\t}')249 print('\t}')250 182 print('}\n') -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_getstring.c
r69310 r78190 17 17 static GLubyte gpszShadingVersion[255]=""; 18 18 #endif 19 static uint32_t g_uOpenGlVersMaj = 0; 20 static uint32_t g_uOpenGlVersMin = 0; 21 19 22 20 23 static void GetString(GLenum name, GLubyte *pszStr) … … 23 26 int writeback = 1; 24 27 25 if (pack_spu.swap) 26 crPackGetStringSWAP(name, pszStr, &writeback); 27 else 28 crPackGetString(name, pszStr, &writeback); 28 crPackGetString(name, pszStr, &writeback); 29 29 packspuFlush( (void *) thread ); 30 30 … … 32 32 } 33 33 34 static GLfloat34 static void 35 35 GetVersionString(void) 36 36 { … … 40 40 if (!fInitialized) 41 41 { 42 int iGlVersion = 0; 42 43 GLubyte return_value[100]; 43 44 … … 45 46 CRASSERT(crStrlen((char *)return_value) < 100); 46 47 47 version = crStrToFloat((char *) return_value); 48 version = crStateComputeVersion(version); 48 iGlVersion = crStrParseGlVersion((const char *) return_value); 49 g_uOpenGlVersMaj = CR_GLVERSION_GET_MAJOR(iGlVersion); 50 g_uOpenGlVersMin = CR_GLVERSION_GET_MINOR(iGlVersion); 51 crStateComputeVersion(&g_uOpenGlVersMaj, &g_uOpenGlVersMin); 49 52 50 53 fInitialized = GL_TRUE; 51 54 } 52 53 return version;54 55 } 55 56 … … 65 66 int writeback = 1; 66 67 67 if (pack_spu.swap) 68 { 69 crPackGetStringSWAP( GL_EXTENSIONS, return_value, &writeback ); 70 } 71 else 72 { 73 crPackGetString( GL_EXTENSIONS, return_value, &writeback ); 74 } 68 crPackGetString( GL_EXTENSIONS, return_value, &writeback ); 75 69 packspuFlush( (void *) thread ); 76 70 … … 129 123 { 130 124 char *oldlocale; 131 float version;132 125 133 126 oldlocale = setlocale(LC_NUMERIC, NULL); … … 135 128 setlocale(LC_NUMERIC, "C"); 136 129 137 version =GetVersionString();138 sprintf((char*)ctx->glVersion, "% .1f Chromium %s", version, CR_VERSION_STRING);130 GetVersionString(); 131 sprintf((char*)ctx->glVersion, "%u.%u Chromium %s", g_uOpenGlVersMaj, g_uOpenGlVersMin, CR_VERSION_STRING); 139 132 140 133 if (oldlocale) -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_glsl.c
r76553 r78190 33 33 crError("packspu_CreateProgram doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!"); 34 34 } 35 if (pack_spu.swap) 36 { 37 crPackCreateProgramSWAP(&return_val, &writeback); 38 } 39 else 40 { 41 crPackCreateProgram(&return_val, &writeback); 42 } 35 crPackCreateProgram(&return_val, &writeback); 43 36 packspuFlush((void *) thread); 44 37 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); 45 if (pack_spu.swap)46 {47 return_val = (GLuint) SWAP32(return_val);48 }49 50 38 crStateCreateProgram(return_val); 51 39 … … 62 50 crError("packspu_GetUniformLocation doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!"); 63 51 } 64 if (pack_spu.swap) 65 { 66 crPackGetUniformLocationSWAP(program, name, &return_val, &writeback); 67 } 68 else 69 { 70 crPackGetUniformLocation(program, name, &return_val, &writeback); 71 } 52 53 crPackGetUniformLocation(program, name, &return_val, &writeback); 72 54 packspuFlush((void *) thread); 73 55 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); 74 if (pack_spu.swap)75 {76 return_val = (GLint) SWAP32(return_val);77 }78 56 return return_val; 79 57 } … … 124 102 crError( "packspu_GetAttribLocation doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!" ); 125 103 } 126 if (pack_spu.swap) 127 { 128 crPackGetAttribLocationSWAP( program, name, &return_val, &writeback ); 129 } 130 else 131 { 132 crPackGetAttribLocation( program, name, &return_val, &writeback ); 133 } 104 105 crPackGetAttribLocation( program, name, &return_val, &writeback ); 134 106 packspuFlush( (void *) thread ); 135 107 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); 136 if (pack_spu.swap)137 {138 return_val = (GLint) SWAP32(return_val);139 }140 108 return return_val; 141 109 } -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_init.c
r69310 r78190 135 135 } 136 136 137 extern SPUOptions packSPUOptions[];138 139 137 int SPULoad( char **name, char **super, SPUInitFuncPtr *init, 140 138 SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup, 141 SPUOptionsPtr *options,int *flags )139 int *flags ) 142 140 { 143 141 *name = "pack"; … … 146 144 *self = packSPUSelfDispatch; 147 145 *cleanup = packSPUCleanup; 148 *options = packSPUOptions;149 146 *flags = (SPU_HAS_PACKER|SPU_IS_TERMINAL|SPU_MAX_SERVERS_ONE); 150 147 -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c
r69310 r78190 85 85 } 86 86 87 if (pack_spu.swap) 88 crPackChromiumParametervCRSWAP(target, type, count, values); 89 else 90 crPackChromiumParametervCR(target, type, count, values); 87 crPackChromiumParametervCR(target, type, count, values); 91 88 92 89 if (fFlush) … … 131 128 GLint writeback = CRPACKSPU_IS_WDDM_CRHGSMI() ? 1 : pack_spu.thread[pack_spu.idxThreadInUse].netServer.conn->actual_network; 132 129 133 if (pack_spu.swap) 134 { 135 crPackFinishSWAP(); 136 } 137 else 138 { 139 crPackFinish(); 140 } 141 130 crPackFinish(); 142 131 if (packspuSyncOnFlushes()) 143 132 { 144 133 if (writeback) 145 134 { 146 if (pack_spu.swap) 147 crPackWritebackSWAP(&writeback); 148 else 149 crPackWriteback(&writeback); 135 crPackWriteback(&writeback); 150 136 151 137 packspuFlush( (void *) thread ); … … 277 263 278 264 crPackSetContext(thread->packer); 279 280 if (pack_spu.swap) 281 { 282 crPackWindowCreateSWAP( dpyName, visBits, &return_val, &writeback ); 283 } 284 else 285 { 286 crPackWindowCreate( dpyName, visBits, &return_val, &writeback ); 287 } 265 crPackWindowCreate( dpyName, visBits, &return_val, &writeback ); 288 266 packspuFlush(thread); 289 267 if (!(thread->netServer.conn->actual_network)) … … 294 272 { 295 273 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); 296 if (pack_spu.swap)297 {298 return_val = (GLint) SWAP32(return_val);299 }300 274 retVal = return_val; 301 275 } … … 334 308 } 335 309 336 if (pack_spu.swap) 337 { 338 crPackAreTexturesResidentSWAP( n, textures, residences, &return_val, &writeback ); 339 } 340 else 341 { 342 crPackAreTexturesResident( n, textures, residences, &return_val, &writeback ); 343 } 310 crPackAreTexturesResident( n, textures, residences, &return_val, &writeback ); 344 311 packspuFlush( (void *) thread ); 345 312 … … 373 340 crError( "packspu_AreProgramsResidentNV doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!" ); 374 341 } 375 if (pack_spu.swap) 376 { 377 crPackAreProgramsResidentNVSWAP( n, ids, residences, &return_val, &writeback ); 378 } 379 else 380 { 381 crPackAreProgramsResidentNV( n, ids, residences, &return_val, &writeback ); 382 } 342 343 crPackAreProgramsResidentNV( n, ids, residences, &return_val, &writeback ); 383 344 packspuFlush( (void *) thread ); 384 345 … … 403 364 int writeback = 1; 404 365 405 if (pack_spu.swap) 406 { 407 crPackGetPolygonStippleSWAP( mask, &writeback ); 408 } 409 else 410 { 411 crPackGetPolygonStipple( mask, &writeback ); 412 } 413 366 crPackGetPolygonStipple( mask, &writeback ); 414 367 #ifdef CR_ARB_pixel_buffer_object 415 368 if (!crStateIsBufferBound(GL_PIXEL_PACK_BUFFER_ARB)) … … 426 379 int writeback = 1; 427 380 428 if (pack_spu.swap) 429 { 430 crPackGetPixelMapfvSWAP( map, values, &writeback ); 431 } 432 else 433 { 434 crPackGetPixelMapfv( map, values, &writeback ); 435 } 436 381 crPackGetPixelMapfv( map, values, &writeback ); 437 382 #ifdef CR_ARB_pixel_buffer_object 438 383 if (!crStateIsBufferBound(GL_PIXEL_PACK_BUFFER_ARB)) … … 449 394 int writeback = 1; 450 395 451 if (pack_spu.swap) 452 { 453 crPackGetPixelMapuivSWAP( map, values, &writeback ); 454 } 455 else 456 { 457 crPackGetPixelMapuiv( map, values, &writeback ); 458 } 396 crPackGetPixelMapuiv( map, values, &writeback ); 459 397 460 398 #ifdef CR_ARB_pixel_buffer_object … … 472 410 int writeback = 1; 473 411 474 if (pack_spu.swap) 475 { 476 crPackGetPixelMapusvSWAP( map, values, &writeback ); 477 } 478 else 479 { 480 crPackGetPixelMapusv( map, values, &writeback ); 481 } 482 412 crPackGetPixelMapusv( map, values, &writeback ); 483 413 #ifdef CR_ARB_pixel_buffer_object 484 414 if (!crStateIsBufferBound(GL_PIXEL_PACK_BUFFER_ARB)) … … 558 488 crError( "packspu_GetError doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!" ); 559 489 } 560 if (pack_spu.swap) 561 { 562 crPackGetErrorSWAP( &return_val, &writeback ); 563 } 564 else 565 { 566 crPackGetError( &return_val, &writeback ); 567 } 568 490 491 crPackGetError( &return_val, &writeback ); 569 492 packspuFlush( (void *) thread ); 570 493 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); 571 572 if (pack_spu.swap)573 {574 return_val = (GLenum) SWAP32(return_val);575 }576 577 494 return return_val; 578 495 } … … 619 536 620 537 CRASSERT(thread->packer == NULL); 621 thread->packer = crPackNewContext( pack_spu.swap);538 thread->packer = crPackNewContext(); 622 539 CRASSERT(thread->packer); 623 540 crPackInitBuffer(&(thread->buffer), crNetAlloc(thread->netServer.conn), -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_net.c
r69310 r78190 95 95 CRASSERT( (void *) hdr >= buf->pack ); 96 96 97 if (pack_spu.swap) 98 { 99 hdr->header.type = (CRMessageType) SWAP32(CR_MESSAGE_OPCODES); 100 hdr->numOpcodes = SWAP32(num_opcodes); 101 } 102 else 103 { 104 hdr->header.type = CR_MESSAGE_OPCODES; 105 hdr->numOpcodes = num_opcodes; 106 } 97 hdr->header.type = CR_MESSAGE_OPCODES; 98 hdr->numOpcodes = num_opcodes; 107 99 108 100 *len = buf->data_current - (unsigned char *) hdr; … … 206 198 a header */ 207 199 len = ((unsigned int *) buf)[-1]; 208 if (pack_spu.swap)209 {210 /* It's already been swapped, swap it back. */211 len = SWAP32(len);212 }213 200 len += 4 + sizeof(CRMessageOpcodes); 214 201 … … 221 208 222 209 msg = (CRMessageOpcodes *) src; 223 224 if (pack_spu.swap) 225 { 226 msg->header.type = (CRMessageType) SWAP32(CR_MESSAGE_OPCODES); 227 msg->numOpcodes = SWAP32(1); 228 } 229 else 230 { 231 msg->header.type = CR_MESSAGE_OPCODES; 232 msg->numOpcodes = 1; 233 } 210 msg->header.type = CR_MESSAGE_OPCODES; 211 msg->numOpcodes = 1; 234 212 235 213 CRASSERT( thread->netServer.conn ); … … 272 250 return; 273 251 } 274 pack_spu.swap = server->conn->swap;275 252 } 276 253 else { -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_pixel.c
r69310 r78190 330 330 { 331 331 GET_THREAD(thread); 332 if (pack_spu.swap) 333 crPackCopyPixelsSWAP( x, y, width, height, type ); 334 else 335 crPackCopyPixels( x, y, width, height, type ); 332 crPackCopyPixels( x, y, width, height, type ); 336 333 /* XXX why flush here? */ 337 334 packspuFlush( (void *) thread ); … … 378 375 } 379 376 380 if (pack_spu.swap) 381 crPackTexImage1DSWAP( target, level, internalformat, width, border, format, type, pixels, &(clientState->unpack) ); 382 else 383 crPackTexImage1D( target, level, internalformat, width, border, format, type, pixels, &(clientState->unpack) ); 384 377 crPackTexImage1D( target, level, internalformat, width, border, format, type, pixels, &(clientState->unpack) ); 385 378 if (crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB)) 386 379 { … … 411 404 } 412 405 413 if (pack_spu.swap) 414 crPackTexImage2DSWAP( target, level, internalformat, width, height, border, format, type, pixels, &(clientState->unpack) ); 415 else 416 crPackTexImage2D( target, level, internalformat, width, height, border, format, type, pixels, &(clientState->unpack) ); 417 406 crPackTexImage2D( target, level, internalformat, width, height, border, format, type, pixels, &(clientState->unpack) ); 418 407 if (crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB)) 419 408 { … … 433 422 } 434 423 435 if (pack_spu.swap) 436 crPackTexImage3DEXTSWAP( target, level, internalformat, width, height, depth, border, format, type, pixels, &(clientState->unpack) ); 437 else 438 crPackTexImage3DEXT( target, level, internalformat, width, height, depth, border, format, type, pixels, &(clientState->unpack) ); 439 424 crPackTexImage3DEXT( target, level, internalformat, width, height, depth, border, format, type, pixels, &(clientState->unpack) ); 440 425 if (crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB)) 441 426 { … … 456 441 } 457 442 458 if (pack_spu.swap) 459 crPackTexImage3DSWAP( target, level, internalformat, width, height, depth, border, format, type, pixels, &(clientState->unpack) ); 460 else 461 crPackTexImage3D( target, level, internalformat, width, height, depth, border, format, type, pixels, &(clientState->unpack) ); 462 443 crPackTexImage3D( target, level, internalformat, width, height, depth, border, format, type, pixels, &(clientState->unpack) ); 463 444 if (crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB)) 464 445 { … … 484 465 } 485 466 486 if (pack_spu.swap) 487 crPackTexSubImage1DSWAP( target, level, xoffset, width, format, type, pixels, &(clientState->unpack) ); 488 else 489 crPackTexSubImage1D( target, level, xoffset, width, format, type, pixels, &(clientState->unpack) ); 490 467 crPackTexSubImage1D( target, level, xoffset, width, format, type, pixels, &(clientState->unpack) ); 491 468 if (crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB)) 492 469 { … … 511 488 } 512 489 513 if (pack_spu.swap) 514 crPackTexSubImage2DSWAP( target, level, xoffset, yoffset, width, height, format, type, pixels, &(clientState->unpack) ); 515 else 516 crPackTexSubImage2D( target, level, xoffset, yoffset, width, height, format, type, pixels, &(clientState->unpack) ); 517 490 crPackTexSubImage2D( target, level, xoffset, yoffset, width, height, format, type, pixels, &(clientState->unpack) ); 518 491 if (crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB)) 519 492 { … … 533 506 } 534 507 535 if (pack_spu.swap) 536 crPackTexSubImage3DSWAP( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, &(clientState->unpack) ); 537 else 538 crPackTexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, &(clientState->unpack) ); 539 508 crPackTexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, &(clientState->unpack) ); 540 509 if (crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB)) 541 510 { … … 549 518 GET_CONTEXT(ctx); 550 519 CRClientState *clientState = &(ctx->clientState->client); 551 if (pack_spu.swap) 552 crPackZPixCRSWAP( width, height, format, type, ztype, zparm, length, pixels, &(clientState->unpack) ); 553 else 554 crPackZPixCR( width, height, format, type, ztype, zparm, length, pixels, &(clientState->unpack) ); 520 crPackZPixCR( width, height, format, type, ztype, zparm, length, pixels, &(clientState->unpack) ); 555 521 } 556 522 … … 572 538 } 573 539 574 if (pack_spu.swap) 575 crPackGetTexImageSWAP( target, level, format, type, pixels, &(clientState->pack), &writeback ); 576 else 577 crPackGetTexImage( target, level, format, type, pixels, &(clientState->pack), &writeback ); 578 540 crPackGetTexImage( target, level, format, type, pixels, &(clientState->pack), &writeback ); 579 541 if (crStateIsBufferBound(GL_PIXEL_PACK_BUFFER_ARB)) 580 542 { … … 601 563 } 602 564 603 if (pack_spu.swap) 604 { 605 crPackGetCompressedTexImageARBSWAP( target, level, img, &writeback ); 606 } 607 else 608 { 609 crPackGetCompressedTexImageARB( target, level, img, &writeback ); 610 } 611 565 crPackGetCompressedTexImageARB( target, level, img, &writeback ); 612 566 if (crStateIsBufferBound(GL_PIXEL_PACK_BUFFER_ARB)) 613 567 { -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_swapbuf.c
r69310 r78190 11 11 #include "packspu_proto.h" 12 12 13 #if 014 15 void PACKSPU_APIENTRY packspu_SwapBuffers( GLint window, GLint flags )16 {17 GET_THREAD(thread);18 if (pack_spu.swap)19 {20 crPackSwapBuffersSWAP( window, flags );21 }22 else23 {24 crPackSwapBuffers( window, flags );25 }26 packspuFlush( (void *) thread );27 }28 29 30 #else31 13 32 14 void PACKSPU_APIENTRY packspu_SwapBuffers( GLint window, GLint flags ) … … 34 16 GET_THREAD(thread); 35 17 36 if (pack_spu.swap) 37 { 38 crPackSwapBuffersSWAP( window, flags ); 39 } 40 else 41 { 42 crPackSwapBuffers( window, flags ); 43 } 18 crPackSwapBuffers( window, flags ); 44 19 packspuFlush( (void *) thread ); 45 20 … … 73 48 */ 74 49 thread->writeback = 1; 75 if (pack_spu.swap) 76 { 77 crPackWritebackSWAP( (GLint *) &thread->writeback ); 78 } 79 else 80 { 81 crPackWriteback( (GLint *) &thread->writeback ); 82 } 50 crPackWriteback( (GLint *) &thread->writeback ); 83 51 break; 84 52 case 1: … … 92 60 /* want to emit a parameter here */ 93 61 if (pack_spu.emit_GATHER_POST_SWAPBUFFERS) 94 { 95 if (pack_spu.swap) 96 crPackChromiumParameteriCRSWAP(GL_GATHER_POST_SWAPBUFFERS_CR, 1); 97 else 98 crPackChromiumParameteriCR(GL_GATHER_POST_SWAPBUFFERS_CR, 1); 99 } 62 crPackChromiumParameteriCR(GL_GATHER_POST_SWAPBUFFERS_CR, 1); 100 63 } 101 64 102 #endif -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_texture.c
r76553 r78190 44 44 GET_THREAD(thread); 45 45 int writeback = 1; 46 unsigned int i;47 46 if (!CRPACKSPU_IS_WDDM_CRHGSMI() && !(pack_spu.thread[pack_spu.idxThreadInUse].netServer.conn->actual_network)) 48 47 { 49 48 crError( "packspu_GenTextures doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!" ); 50 49 } 51 if (pack_spu.swap) 52 { 53 crPackGenTexturesSWAP( n, textures, &writeback ); 54 } 55 else 56 { 57 crPackGenTextures( n, textures, &writeback ); 58 } 50 51 crPackGenTextures( n, textures, &writeback ); 59 52 packspuFlush( (void *) thread ); 60 53 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); 61 if (pack_spu.swap)62 {63 for (i = 0 ; i < (unsigned int) n ; i++)64 {65 textures[i] = SWAP32(textures[i]);66 }67 }68 69 54 crStateRegTextures(n, textures); 70 55 } -
trunk/src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu_init.c
r69310 r78190 44 44 } 45 45 46 static SPUOptions passthroughSPUOptions[] = {47 { NULL, CR_BOOL, 0, NULL, NULL, NULL, NULL, NULL },48 };49 50 46 51 47 int SPULoad( char **name, char **super, SPUInitFuncPtr *init, 52 48 SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup, 53 SPUOptionsPtr *options,int *flags )49 int *flags ) 54 50 { 55 51 *name = "passthrough"; … … 58 54 *self = passthroughSPUSelfDispatch; 59 55 *cleanup = passthroughSPUCleanup; 60 *options = passthroughSPUOptions;61 56 *flags = (SPU_NO_PACKER|SPU_NOT_TERMINAL|SPU_MAX_SERVERS_ZERO); 62 57 -
trunk/src/VBox/Additions/common/crOpenGL/wgl.c
r69310 r78190 7 7 #include "cr_error.h" 8 8 #include "cr_spu.h" 9 #include "cr_environment.h"10 9 #include "cr_mem.h" 11 10 #include "stub.h" … … 19 18 20 19 #include <iprt/cdefs.h> 20 #include <iprt/env.h> 21 21 22 22 /* Currently host part will misbehave re-creating context with proper visual bits … … 83 83 * There are subtle differences in the use of these calls. 84 84 */ 85 crSetenv("CR_WGL_DO_NOT_USE_GDI", "yes");85 RTEnvSet("CR_WGL_DO_NOT_USE_GDI", "yes"); 86 86 87 87 if ( pfd->nSize != sizeof(*pfd) || pfd->nVersion != 1 ) {
Note:
See TracChangeset
for help on using the changeset viewer.