Ticket #13653: vbox-host-AllOpenGL-beta1-v5.0.0-BETA2.patch
| File vbox-host-AllOpenGL-beta1-v5.0.0-BETA2.patch, 140.7 KB (added by , 9 years ago) |
|---|
-
VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/load.c
Binary files vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/entrypoints.pyc and /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/entrypoints.pyc differ diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/load.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/load.c
old new 481 481 } 482 482 483 483 484 484 static void stubExitHandler(void) 485 485 { 486 486 stubSPUSafeTearDown(); 487 signal(SIGTERM, SIG_DFL);488 signal(SIGINT, SIG_DFL);489 487 } 490 488 491 489 /** 492 490 * Called when we receive a SIGTERM signal. 493 491 */ 494 492 static void stubSignalHandler(int signo) … … 1323 1321 switch (fdwReason) 1324 1322 { 1325 1323 case DLL_PROCESS_ATTACH: 1326 1324 { 1327 1325 CRNetServer ns; 1328 1326 const char * env; 1329 #if defined(DEBUG_misha) 1330 HMODULE hCrUtil; 1331 char aName[MAX_PATH]; 1332 1333 GetModuleFileNameA(hDLLInst, aName, RT_ELEMENTS(aName)); 1334 crDbgCmdSymLoadPrint(aName, hDLLInst); 1335 1336 hCrUtil = GetModuleHandleA("VBoxOGLcrutil.dll"); 1337 Assert(hCrUtil); 1338 crDbgCmdSymLoadPrint("VBoxOGLcrutil.dll", hCrUtil); 1339 #endif 1327 1340 1328 #ifdef CHROMIUM_THREADSAFE 1341 1329 crInitTSD(&g_stubCurrentContextTSD); 1342 1330 #endif 1343 1331 1344 1332 crInitMutex(&stub_init_mutex); 1345 1333 -
VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_context.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_context.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_context.c
old new 591 591 592 592 if (pack_spu.swap) 593 593 crPackMakeCurrentSWAP( window, nativeWindow, serverCtx ); 594 594 else 595 595 crPackMakeCurrent( window, nativeWindow, serverCtx ); 596 596 597 if (serverCtx)598 {599 packspuInitStrings();600 }601 602 597 { 603 598 GET_THREAD(t); 604 599 (void) t; 605 600 CRASSERT(t); 606 601 } 607 602 } -
VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_getstring.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_getstring.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_getstring.c
old new 31 31 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); 32 32 } 33 33 34 34 static GLfloat 35 35 GetVersionString(void) 36 36 { 37 static GLboolean fInitialized = GL_FALSE;38 static GLfloat version = 0.;37 GLubyte return_value[100]; 38 GLfloat version; 39 39 40 if (!fInitialized) 41 { 42 GLubyte return_value[100]; 43 44 GetString(GL_VERSION, return_value); 45 CRASSERT(crStrlen((char *)return_value) < 100); 46 47 version = crStrToFloat((char *) return_value); 48 version = crStateComputeVersion(version); 40 GetString(GL_VERSION, return_value); 41 CRASSERT(crStrlen((char *)return_value) < 100); 49 42 50 fInitialized = GL_TRUE;51 }43 version = crStrToFloat((char *) return_value); 44 version = crStateComputeVersion(version); 52 45 53 46 return version; 54 47 } 55 48 56 49 static const GLubyte * 57 50 GetExtensions(void) 58 51 { 59 static GLboolean fInitialized = GL_FALSE; 60 if (!fInitialized) 52 GLubyte return_value[10*1000]; 53 const GLubyte *extensions, *ext; 54 GET_THREAD(thread); 55 int writeback = 1; 56 57 if (pack_spu.swap) 61 58 { 62 GLubyte return_value[10*1000]; 63 const GLubyte *extensions, *ext; 64 GET_THREAD(thread); 65 int writeback = 1; 66 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 } 75 packspuFlush( (void *) thread ); 76 77 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); 78 79 CRASSERT(crStrlen((char *)return_value) < 10*1000); 80 81 /* OK, we got the result from the server. Now we have to 82 * intersect is with the set of extensions that Chromium understands 83 * and tack on the Chromium-specific extensions. 84 */ 85 extensions = return_value; 86 ext = crStateMergeExtensions(1, &extensions); 59 crPackGetStringSWAP( GL_EXTENSIONS, return_value, &writeback ); 60 } 61 else 62 { 63 crPackGetString( GL_EXTENSIONS, return_value, &writeback ); 64 } 65 packspuFlush( (void *) thread ); 66 67 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); 68 69 CRASSERT(crStrlen((char *)return_value) < 10*1000); 70 71 /* OK, we got the result from the server. Now we have to 72 * intersect is with the set of extensions that Chromium understands 73 * and tack on the Chromium-specific extensions. 74 */ 75 extensions = return_value; 76 ext = crStateMergeExtensions(1, &extensions); 87 77 88 78 #ifdef Linux 89 /*@todo90 *That's a hack to allow running Unity, it uses libnux which is calling extension functions91 *without checking if it's being supported/exported.92 *glActiveStencilFaceEXT seems to be actually supported but the extension string isn't exported (for ex. on ATI HD4870),93 *which leads to libglew setting function pointer to NULL and crashing Unity.94 */95 sprintf((char*)gpszExtensions, "%s GL_EXT_stencil_two_side", ext);79 /*@todo 80 *That's a hack to allow running Unity, it uses libnux which is calling extension functions 81 *without checking if it's being supported/exported. 82 *glActiveStencilFaceEXT seems to be actually supported but the extension string isn't exported (for ex. on ATI HD4870), 83 *which leads to libglew setting function pointer to NULL and crashing Unity. 84 */ 85 sprintf((char*)gpszExtensions, "%s GL_EXT_stencil_two_side", ext); 96 86 #else 97 sprintf((char*)gpszExtensions, "%s", ext);87 sprintf((char*)gpszExtensions, "%s", ext); 98 88 #endif 99 fInitialized = GL_TRUE;100 }101 89 102 90 return gpszExtensions; 103 91 } 104 92 105 93 #ifdef WINDOWS 106 94 static bool packspuRunningUnderWine(void) … … 169 157 { 170 158 return crStateGetString(name); 171 159 } 172 160 173 161 #ifdef CR_OPENGL_VERSION_2_0 174 162 case GL_SHADING_LANGUAGE_VERSION: 175 { 176 static GLboolean fInitialized = GL_FALSE; 177 if (!fInitialized) 178 { 179 GetString(GL_SHADING_LANGUAGE_VERSION, gpszShadingVersion); 180 fInitialized = GL_TRUE; 181 } 163 GetString(GL_SHADING_LANGUAGE_VERSION, gpszShadingVersion); 182 164 return gpszShadingVersion; 183 }184 165 #endif 185 166 #ifdef GL_CR_real_vendor_strings 186 167 case GL_REAL_VENDOR: 187 168 GetString(GL_REAL_VENDOR, ctx->pszRealVendor); 188 169 return ctx->pszRealVendor; 189 170 case GL_REAL_VERSION: … … 194 175 return ctx->pszRealRenderer; 195 176 #endif 196 177 default: 197 178 return crStateGetString(name); 198 179 } 199 180 } 200 201 void packspuInitStrings()202 {203 static GLboolean fInitialized = GL_FALSE;204 205 if (!fInitialized)206 {207 packspu_GetString(GL_EXTENSIONS);208 packspu_GetString(GL_VERSION);209 fInitialized = GL_TRUE;210 }211 } -
VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu.h
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu.h
old new 158 158 , struct VBOXUHGSMI *pHgsmi 159 159 #endif 160 160 ); 161 161 extern void packspuFlush( void *arg ); 162 162 extern void packspuHuge( CROpcode opcode, void *buf ); 163 163 164 extern void packspuInitStrings();165 166 164 extern GLboolean packspuSyncOnFlushes(); 167 165 168 166 extern ThreadInfo *packspuNewThread( 169 167 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) 170 168 struct VBOXUHGSMI *pHgsmi 171 169 #endif -
VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_misc.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_misc.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_misc.c
old new 204 204 packspuFlush((void *) thread); 205 205 206 206 crUnlockMutex(&_PackMutex); 207 207 } 208 208 } 209 209 210 void PACKSPU_APIENTRY packspu_NewList(GLuint list, GLenum mode)211 {212 crStateNewList(list, mode);213 crPackNewList(list, mode);214 }215 216 void PACKSPU_APIENTRY packspu_EndList()217 {218 crStateEndList();219 crPackEndList();220 }221 222 210 void PACKSPU_APIENTRY packspu_VBoxWindowDestroy( GLint con, GLint window ) 223 211 { 224 212 if (CRPACKSPU_IS_WDDM_CRHGSMI()) 225 213 { 226 214 GET_THREAD(thread); 227 215 if (con) … … 517 505 packspuCheckZerroVertAttr(value); 518 506 return; 519 507 case GL_SHARE_CONTEXT_RESOURCES_CR: 520 508 crStateShareContext(value); 521 509 break; 522 510 case GL_RCUSAGE_TEXTURE_SET_CR: 523 {524 Assert(value);525 511 crStateSetTextureUsed(value, GL_TRUE); 526 512 break; 527 }528 513 case GL_RCUSAGE_TEXTURE_CLEAR_CR: 529 {530 Assert(value);531 #ifdef DEBUG532 {533 CRContext *pCurState = crStateGetCurrent();534 CRTextureObj *tobj = (CRTextureObj*)crHashtableSearch(pCurState->shared->textureTable, value);535 Assert(tobj);536 }537 #endif538 514 crStateSetTextureUsed(value, GL_FALSE); 539 515 break; 540 }541 516 default: 542 517 break; 543 518 } 544 519 crPackChromiumParameteriCR(target, value); 545 520 } 546 521 547 GLenum PACKSPU_APIENTRY packspu_GetError( void )548 {549 GET_THREAD(thread);550 int writeback = 1;551 GLenum return_val = (GLenum) 0;552 CRContext *pCurState = crStateGetCurrent();553 554 if (!CRPACKSPU_IS_WDDM_CRHGSMI() && !(pack_spu.thread[pack_spu.idxThreadInUse].netServer.conn->actual_network))555 {556 crError( "packspu_GetError doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!" );557 }558 if (pack_spu.swap)559 {560 crPackGetErrorSWAP( &return_val, &writeback );561 }562 else563 {564 crPackGetError( &return_val, &writeback );565 }566 567 packspuFlush( (void *) thread );568 CRPACKSPU_WRITEBACK_WAIT(thread, writeback);569 570 if (pack_spu.swap)571 {572 return_val = (GLenum) SWAP32(return_val);573 }574 575 return return_val;576 }577 578 522 #ifdef CHROMIUM_THREADSAFE 579 523 GLint PACKSPU_APIENTRY packspu_VBoxPackSetInjectThread(struct VBOXUHGSMI *pHgsmi) 580 524 { 581 525 GLint con = 0; 582 526 int i; 583 527 GET_THREAD(thread); -
VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_net.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_net.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_net.c
old new 246 246 , pHgsmi 247 247 #endif 248 248 ); 249 249 if (server->conn) 250 250 { 251 251 g_u32VBoxHostCaps = crNetHostCapsGet(); 252 crPackCapsSet(g_u32VBoxHostCaps); 252 if (g_u32VBoxHostCaps & CR_VBOX_CAP_CMDBLOCKS) 253 crPackCmdBlocksEnable(); 253 254 } 254 255 } 255 256 256 257 void packspuConnectToServer( CRNetServer *server 257 258 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) 258 259 , struct VBOXUHGSMI *pHgsmi -
VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_special
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_special /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/Additions//common/crOpenGL/pack/packspu_special
old new 129 129 DeleteFramebuffersEXT 130 130 DeleteRenderbuffersEXT 131 131 GenBuffersARB 132 132 DeleteBuffersARB 133 133 StringMarkerGREMEDY 134 134 GenTextures 135 CompileShader 136 NewList 137 EndList 138 GetError 139 No newline at end of file 135 CompileShader 136 No newline at end of file -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/chromium.h
Binary files vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/glapi_parser/apiutil.pyc and /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/glapi_parser/apiutil.pyc differ diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/chromium.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/chromium.h
old new 733 733 /* enable zero vertex attribute generation to work around wine bug */ 734 734 #define GL_CHECK_ZERO_VERT_ARRT 0x8B30 735 735 736 736 /* share lists */ 737 737 #define GL_SHARE_LISTS_CR 0x8B31 738 738 739 #define GL_HH_SET_CLIENT_CALLOUT 0x8B32740 741 /* ensure the resource is */742 #define GL_PIN_TEXTURE_SET_CR 0x8B32743 #define GL_PIN_TEXTURE_CLEAR_CR 0x8B33744 745 739 /**********************************************************************/ 746 740 /***** Chromium-specific API *****/ 747 741 /**********************************************************************/ 748 742 749 743 750 744 /* -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_dump.h
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_dump.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_dump.h
old new 24 24 #include <iprt/cdefs.h> 25 25 #include <iprt/string.h> 26 26 #include <cr_spu.h> 27 27 #include <cr_glstate.h> 28 28 #include <cr_blitter.h> 29 29 30 # define VBOXDUMPDECL(_type) _type RTCALL30 # define VBOXDUMPDECL(_type) DECLEXPORT(_type) 31 31 32 32 RT_C_DECLS_BEGIN 33 33 34 34 #ifdef RT_OS_WINDOWS 35 35 DECLEXPORT(void) crDmpDumpImgDmlBreak(struct CR_DUMPER * pDumper, CR_BLITTER_IMG *pImg, const char*pszEntryDesc); 36 36 … … 134 134 { 135 135 pRec->pBlitter = pBlitter; 136 136 pRec->pDispatch = pDispatch; 137 137 pRec->pDumper = pDumper; 138 138 } 139 139 140 VBOXDUMPDECL(void) crRecDumpBuffer(CR_RECORDER *pRec, CRContext *ctx, GLint idRedirFBO, VBOXVR_TEXTURE *pRedirTex);141 VBOXDUMPDECL(void) crRecDumpTextures(CR_RECORDER *pRec, CRContext *ctx );140 VBOXDUMPDECL(void) crRecDumpBuffer(CR_RECORDER *pRec, CRContext *ctx, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin, GLint idRedirFBO, VBOXVR_TEXTURE *pRedirTex); 141 VBOXDUMPDECL(void) crRecDumpTextures(CR_RECORDER *pRec, CRContext *ctx, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin); 142 142 VBOXDUMPDECL(void) crRecDumpTextureV(CR_RECORDER *pRec, const VBOXVR_TEXTURE *pTex, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin, const char *pszStr, va_list pArgList); 143 VBOXDUMPDECL(void) crRecDumpTextureF(CR_RECORDER *pRec, const VBOXVR_TEXTURE *pTex, const char *pszStr, ...);143 VBOXDUMPDECL(void) crRecDumpTextureF(CR_RECORDER *pRec, const VBOXVR_TEXTURE *pTex, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin, const char *pszStr, ...); 144 144 VBOXDUMPDECL(void) crRecDumpTextureByIdV(CR_RECORDER *pRec, CRContext *ctx, GLint id, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin, const char *pszStr, va_list pArgList); 145 145 VBOXDUMPDECL(void) crRecDumpTextureByIdF(CR_RECORDER *pRec, CRContext *ctx, GLint id, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin, const char *pszStr, ...); 146 146 VBOXDUMPDECL(void) crRecDumpShader(CR_RECORDER *pRec, CRContext *ctx, GLint id, GLint hwid); 147 147 VBOXDUMPDECL(void) crRecDumpProgram(CR_RECORDER *pRec, CRContext *ctx, GLint id, GLint hwid); 148 148 VBOXDUMPDECL(void) crRecRecompileShader(CR_RECORDER *pRec, CRContext *ctx, GLint id, GLint hwid); 149 149 VBOXDUMPDECL(void) crRecRecompileProgram(CR_RECORDER *pRec, CRContext *ctx, GLint id, GLint hwid); -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_error.h
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_error.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_error.h
old new 36 36 # endif 37 37 #endif 38 38 39 39 DECLEXPORT(void) crEnableWarnings(int onOff); 40 40 41 41 DECLEXPORT(void) crDebug(const char *format, ... ) PRINTF; 42 DECLEXPORT(void) crDbgCmdPrint(const char *description1, const char *description2, const char *cmd, ...);43 DECLEXPORT(void) crDbgCmdSymLoadPrint(const char *modName, const void*pvAddress);44 42 #if defined(DEBUG_misha) && defined(RT_OS_WINDOWS) 45 43 typedef void FNCRDEBUG(const char *format, ... ) PRINTF; 46 44 typedef FNCRDEBUG *PFNCRDEBUG; 47 45 DECLINLINE(PFNCRDEBUG) crGetDebug() {return crDebug;} 48 46 # define crWarning (RT_BREAKPOINT(), crDebug) 49 47 #else -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_glstate.h
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_glstate.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_glstate.h
old new 219 219 DECLEXPORT(GLboolean) crStateEnableDiffOnMakeCurrent(GLboolean fEnable); 220 220 221 221 void crStateSwitchPrepare(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO); 222 222 void crStateSwitchPostprocess(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO); 223 223 224 224 void crStateSyncHWErrorState(CRContext *ctx); 225 GLenum crStateCleanHWErrorState();226 227 #define CR_STATE_CLEAN_HW_ERR_WARN(_s) do {\228 GLenum _err = crStateCleanHWErrorState(); \229 if (_err != GL_NO_ERROR) { \230 static int _cErrPrints = 0; \231 if (_cErrPrints < 5) { \232 ++_cErrPrints; \233 WARN(("%s %#x, ignoring.. (%d out of 5)", _s, _err, _cErrPrints)); \234 } \235 } \236 } while (0)237 225 238 226 DECLEXPORT(void) crStateFlushFunc( CRStateFlushFunc ff ); 239 227 DECLEXPORT(void) crStateFlushArg( void *arg ); 240 228 DECLEXPORT(void) crStateDiffAPI( SPUDispatchTable *api ); 241 229 DECLEXPORT(void) crStateUpdateColorBits( void ); 242 230 … … 279 267 DECLEXPORT(void) crStateFreeFBImageLegacy(CRContext *to); 280 268 281 269 DECLEXPORT(void) crStateGetTextureObjectAndImage(CRContext *g, GLenum texTarget, GLint level, 282 270 CRTextureObj **obj, CRTextureLevel **img); 283 271 284 272 285 DECLEXPORT(void) crStateReleaseTexture(CRContext *pCtx, CRTextureObj *pObj);286 287 273 #ifndef IN_GUEST 288 274 DECLEXPORT(int32_t) crStateSaveContext(CRContext *pContext, PSSMHANDLE pSSM); 289 275 typedef DECLCALLBACK(CRContext*) FNCRSTATE_CONTEXT_GET(void*); 290 276 typedef FNCRSTATE_CONTEXT_GET *PFNCRSTATE_CONTEXT_GET; 291 277 DECLEXPORT(int32_t) crStateLoadContext(CRContext *pContext, CRHashTable * pCtxTable, PFNCRSTATE_CONTEXT_GET pfnCtxGet, PSSMHANDLE pSSM, uint32_t u32Version); 292 278 DECLEXPORT(void) crStateFreeShared(CRContext *pContext, CRSharedState *s); … … 296 282 297 283 DECLEXPORT(CRSharedState *) crStateGlobalSharedAcquire(); 298 284 DECLEXPORT(void) crStateGlobalSharedRelease(); 299 285 #endif 300 286 301 287 DECLEXPORT(void) crStateSetTextureUsed(GLuint texture, GLboolean used); 302 DECLEXPORT(void) crStatePinTexture(GLuint texture, GLboolean pin);303 288 DECLEXPORT(void) crStateDeleteTextureCallback(void *texObj); 304 289 305 290 /* XXX move these! */ 306 291 307 292 DECLEXPORT(void) STATE_APIENTRY 308 293 crStateChromiumParameteriCR( GLenum target, GLint value ); -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_pack.h
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_pack.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_pack.h
old new 105 105 # else 106 106 extern DLLDATA(CRPackContext) cr_packer_globals; 107 107 # define CR_GET_PACKER_CONTEXT(C) CRPackContext *C = &cr_packer_globals 108 108 # define CR_LOCK_PACKER_CONTEXT(PC) 109 109 # define CR_UNLOCK_PACKER_CONTEXT(PC) 110 110 # endif 111 extern uint32_t cr_packer_cmd_blocks_enabled;111 extern int cr_packer_cmd_blocks_enabled; 112 112 #else /* if defined IN_RING0 */ 113 113 # define CR_PACKER_CONTEXT_ARGSINGLEDECL CRPackContext *_pCtx 114 114 # define CR_PACKER_CONTEXT_ARGDECL CR_PACKER_CONTEXT_ARGSINGLEDECL, 115 115 # define CR_PACKER_CONTEXT_ARG _pCtx, 116 116 # define CR_PACKER_CONTEXT_ARGCTX(C) C, 117 117 # define CR_GET_PACKER_CONTEXT(C) CRPackContext *C = _pCtx … … 187 187 extern DECLEXPORT(void) crPackExpandMultiDrawArraysEXT( GLenum mode, GLint *first, GLsizei *count, GLsizei primcount, CRClientState *c, const GLfloat *pZva ); 188 188 extern DECLEXPORT(void) crPackExpandMultiDrawArraysEXTSWAP( GLenum mode, GLint *first, GLsizei *count, GLsizei primcount, CRClientState *c, const GLfloat *pZva ); 189 189 190 190 extern DECLEXPORT(void) crPackExpandMultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, CRClientState *c, const GLfloat *pZva ); 191 191 extern DECLEXPORT(void) crPackExpandMultiDrawElementsEXTSWAP( GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, CRClientState *c, const GLfloat *pZva ); 192 192 193 extern DECLEXPORT(void) crPackCapsSet(uint32_t u32Caps); 193 extern DECLEXPORT(void) crPackCmdBlocksEnable(); 194 194 195 195 196 /** 196 197 * Return number of opcodes in given buffer. 197 198 */ 198 199 static INLINE int 199 200 crPackNumOpcodes(const CRPackBuffer *buffer) … … 247 248 248 249 #define CR_CMDBLOCK_OP( _pc, _op) \ 249 250 do { \ 250 251 CR_PACK_SPECIAL_OP( _pc, _op); \ 251 252 } while (0) 252 253 253 #define CR_CMDBLOCK_IS_STARTED( pc, op ) CRPACKBLOCKSTATE_IS_OP_STARTED((pc)->u32CmdBlockState, op)254 254 255 255 #define CR_CMDBLOCK_BEGIN( pc, op ) \ 256 256 do { \ 257 257 CR_LOCK_PACKER_CONTEXT(pc); \ 258 258 if (!cr_packer_cmd_blocks_enabled) break; \ 259 if (!CRPACKBLOCKSTATE_IS_STARTED( (pc)->u32CmdBlockState)) { \259 if (!CRPACKBLOCKSTATE_IS_STARTED(pc->u32CmdBlockState)) { \ 260 260 THREADASSERT( pc ); \ 261 CRASSERT( (pc)->currentBuffer ); \262 if (!crPackBufferIsEmpty(& (pc)->buffer)) { \263 if ((* (pc)->buffer.opcode_start) != CR_NOP_OPCODE) { \264 (pc)->Flush( (pc)->flush_arg ); \265 Assert(crPackCanHoldOpcode( (pc), 1, 4 ) ); \266 CR_CMDBLOCK_OP( (pc), CR_CMDBLOCKBEGIN_OPCODE ); \261 CRASSERT( pc->currentBuffer ); \ 262 if (!crPackBufferIsEmpty(&pc->buffer)) { \ 263 if ((*pc->buffer.opcode_start) != CR_NOP_OPCODE) { \ 264 pc->Flush( pc->flush_arg ); \ 265 Assert(crPackCanHoldOpcode( pc, 1, 4 ) ); \ 266 CR_CMDBLOCK_OP( pc, CR_CMDBLOCKBEGIN_OPCODE ); \ 267 267 } \ 268 268 else { \ 269 (* (pc)->buffer.opcode_start) = CR_CMDBLOCKBEGIN_OPCODE; \269 (*pc->buffer.opcode_start) = CR_CMDBLOCKBEGIN_OPCODE; \ 270 270 } \ 271 271 } \ 272 272 else { \ 273 Assert(crPackCanHoldOpcode( (pc), 1, 4 ) ); \274 CR_CMDBLOCK_OP( (pc), CR_CMDBLOCKBEGIN_OPCODE ); \273 Assert(crPackCanHoldOpcode( pc, 1, 4 ) ); \ 274 CR_CMDBLOCK_OP( pc, CR_CMDBLOCKBEGIN_OPCODE ); \ 275 275 } \ 276 276 } \ 277 Assert(!CRPACKBLOCKSTATE_IS_OP_STARTED((pc)->u32CmdBlockState, op)); \ 278 CRPACKBLOCKSTATE_OP_START((pc)->u32CmdBlockState, op); \ 279 Assert(CRPACKBLOCKSTATE_IS_OP_STARTED((pc)->u32CmdBlockState, op)); \ 277 CRPACKBLOCKSTATE_OP_START(pc->u32CmdBlockState, op); \ 280 278 } while (0) 281 279 282 280 #define CR_CMDBLOCK_END( pc, op ) \ 283 281 do { \ 284 282 if (!cr_packer_cmd_blocks_enabled) break; \ 285 Assert(CRPACKBLOCKSTATE_IS_OP_STARTED((pc)->u32CmdBlockState, op)); \ 286 CRPACKBLOCKSTATE_OP_STOP((pc)->u32CmdBlockState, op); \ 287 Assert(!CRPACKBLOCKSTATE_IS_OP_STARTED((pc)->u32CmdBlockState, op)); \ 288 if (!CRPACKBLOCKSTATE_IS_STARTED((pc)->u32CmdBlockState)) { \ 283 CRPACKBLOCKSTATE_OP_STOP(pc->u32CmdBlockState, op); \ 284 if (!CRPACKBLOCKSTATE_IS_STARTED(pc->u32CmdBlockState)) { \ 289 285 THREADASSERT( pc ); \ 290 CRASSERT( (pc)->currentBuffer );\291 if (!crPackBufferIsEmpty(& (pc)->buffer)) {\292 if ((* (pc)->buffer.opcode_start) != CR_CMDBLOCKBEGIN_OPCODE) {\286 CRASSERT( pc->currentBuffer ); \ 287 if (!crPackBufferIsEmpty(&pc->buffer)) { \ 288 if ((*pc->buffer.opcode_start) != CR_CMDBLOCKBEGIN_OPCODE) {\ 293 289 if ( !crPackCanHoldOpcode( pc, 1, 4 ) ) { \ 294 (pc)->Flush( (pc)->flush_arg );\290 pc->Flush( pc->flush_arg ); \ 295 291 Assert(crPackCanHoldOpcode( pc, 1, 4 ) ); \ 296 292 } \ 297 293 CR_CMDBLOCK_OP( pc, CR_CMDBLOCKEND_OPCODE ); \ 298 (pc)->Flush( (pc)->flush_arg );\294 pc->Flush( pc->flush_arg ); \ 299 295 } \ 300 296 else { \ 301 (* (pc)->buffer.opcode_start) = CR_NOP_OPCODE;\297 (*pc->buffer.opcode_start) = CR_NOP_OPCODE; \ 302 298 } \ 303 299 } \ 304 300 else { \ 305 301 Assert(crPackCanHoldOpcode( pc, 1, 4 ) ); \ 306 302 CR_CMDBLOCK_OP( pc, CR_CMDBLOCKEND_OPCODE ); \ 307 (pc)->Flush( pc->flush_arg );\303 pc->Flush( pc->flush_arg ); \ 308 304 } \ 309 305 } \ 310 306 } while (0) 311 307 312 #define CR_CMDBLOCK_CHECK_FLUSH( pc ) \313 do { \314 if (!(cr_packer_cmd_blocks_enabled & CR_VBOX_CAP_CMDBLOCKS_FLUSH)) break; \315 if(!CRPACKBLOCKSTATE_IS_OP_STARTED((pc)->u32CmdBlockState, CRPACKBLOCKSTATE_OP_NEWLIST)) break; \316 THREADASSERT( pc ); \317 CRASSERT( (pc)->currentBuffer ); \318 if ( !crPackCanHoldOpcode( pc, 1, 4 ) ) { \319 (pc)->Flush( (pc)->flush_arg ); \320 Assert(crPackCanHoldOpcode( pc, 1, 4 ) ); \321 } \322 CR_CMDBLOCK_OP( pc, CR_CMDBLOCKFLUSH_OPCODE ); \323 (pc)->Flush( (pc)->flush_arg ); \324 } while (0)325 326 308 /** 327 309 * Alloc space for a message of 'len' bytes (plus 1 opcode). 328 310 * Only flush if buffer is full. 329 311 */ 330 312 #define CR_GET_BUFFERED_POINTER_NO_BEGINEND_FLUSH(pc, len, lock) \ 331 313 do { \ -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_server.h
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_server.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_server.h
old new 353 353 CRScreenInfo screen[CR_MAX_GUEST_MONITORS]; 354 354 CRScreenViewportInfo screenVieport[CR_MAX_GUEST_MONITORS]; 355 355 int screenCount; 356 356 357 357 GLboolean fCrCmdEnabled; 358 358 359 GLboolean fProcessingPendedCommands;360 361 359 int numClients; 362 360 CRClient *clients[CR_MAX_CLIENTS]; /**< array [numClients] */ 363 361 CRClient *curClient; 364 362 CRClientNode *pCleanupClient; /*list of clients with pending clean up*/ 365 363 CRHTABLE clientTable; 366 364 CRCurrentStatePointers current; … … 414 412 CR_BLITTER Blitter; 415 413 416 414 CR_SERVER_RPW RpwWorker; 417 415 418 416 VBOXCRCMDCTL_HGCMDISABLE_DATA DisableData; 419 417 420 RTSEMEVENT hCalloutCompletionEvent;421 VBOXCRCMDCTL *pCurrentCalloutCtl;422 VBOXCRCLIENT_INFO ClientInfo;423 424 418 /** configuration options */ 425 419 /*@{*/ 426 420 int useL2; 427 421 int ignore_papi; 428 422 unsigned int maxBarrierCount; 429 423 unsigned int clearCount; -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_sortarray.h
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_sortarray.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_sortarray.h
old new 1 /* $Id: cr_sortarray.h $ */2 3 /** @file4 * Sorted array API5 */6 7 /*8 * Copyright (C) 2014 Oracle Corporation9 *10 * This file is part of VirtualBox Open Source Edition (OSE), as11 * available from http://www.virtualbox.org. This file is free software;12 * you can redistribute it and/or modify it under the terms of the GNU13 * General Public License (GPL) as published by the Free Software14 * Foundation, in version 2 as it comes in the "COPYING" file of the15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.17 */18 #ifndef ___cr_sortarray_h_19 #define ___cr_sortarray_h_20 21 #include <iprt/types.h>22 #include <iprt/assert.h>23 24 typedef struct CR_SORTARRAY25 {26 uint32_t cBufferSize;27 uint32_t cSize;28 uint64_t *pElements;29 } CR_SORTARRAY;30 31 32 #ifndef IN_RING033 # define VBOXSADECL(_type) DECLEXPORT(_type)34 #else35 # define VBOXSADECL(_type) RTDECL(_type)36 #endif37 38 39 DECLINLINE(uint32_t) CrSaGetSize(const CR_SORTARRAY *pArray)40 {41 return pArray->cSize;42 }43 44 DECLINLINE(uint64_t) CrSaGetVal(const CR_SORTARRAY *pArray, uint32_t i)45 {46 Assert(i < pArray->cSize);47 return pArray->pElements[i];48 }49 50 DECLINLINE(const uint64_t*) CrSaGetElements(const CR_SORTARRAY *pArray)51 {52 return pArray->pElements;53 }54 55 DECLINLINE(void) CrSaClear(CR_SORTARRAY *pArray)56 {57 pArray->cSize = 0;58 }59 60 VBOXSADECL(int) CrSaInit(CR_SORTARRAY *pArray, uint32_t cInitBuffer);61 VBOXSADECL(void) CrSaCleanup(CR_SORTARRAY *pArray);62 /*63 * @return true if element is found */64 VBOXSADECL(bool) CrSaContains(const CR_SORTARRAY *pArray, uint64_t element);65 66 /*67 * @return VINF_SUCCESS if element is added68 * VINF_ALREADY_INITIALIZED if element was in array already69 * VERR_NO_MEMORY - no memory70 * */71 VBOXSADECL(int) CrSaAdd(CR_SORTARRAY *pArray, uint64_t element);72 73 /*74 * @return VINF_SUCCESS if element is removed75 * VINF_ALREADY_INITIALIZED if element was NOT in array76 * */77 VBOXSADECL(int) CrSaRemove(CR_SORTARRAY *pArray, uint64_t element);78 79 /*80 * @return VINF_SUCCESS on success81 * VERR_NO_MEMORY - no memory82 * */83 VBOXSADECL(void) CrSaIntersect(CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2);84 VBOXSADECL(int) CrSaIntersected(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2, CR_SORTARRAY *pResult);85 86 /*87 * @return VINF_SUCCESS on success88 * VERR_NO_MEMORY - no memory89 * */90 VBOXSADECL(int) CrSaUnited(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2, CR_SORTARRAY *pResult);91 92 /*93 * @return VINF_SUCCESS on success94 * VERR_NO_MEMORY - no memory95 * */96 VBOXSADECL(int) CrSaClone(const CR_SORTARRAY *pArray1, CR_SORTARRAY *pResult);97 98 VBOXSADECL(int) CrSaCmp(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2);99 100 VBOXSADECL(bool) CrSaCovers(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2);101 102 #endif /* ___cr_sortarray_h_ */ -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_unpack.h
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_unpack.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/cr_unpack.h
old new 30 30 DECLEXPORT(void) crUnpackPop(void); 31 31 32 32 typedef enum 33 33 { 34 34 CR_UNPACK_BUFFER_TYPE_GENERIC = 0, 35 35 CR_UNPACK_BUFFER_TYPE_CMDBLOCK_BEGIN, 36 CR_UNPACK_BUFFER_TYPE_CMDBLOCK_FLUSH,37 36 CR_UNPACK_BUFFER_TYPE_CMDBLOCK_END 38 37 } CR_UNPACK_BUFFER_TYPE; 39 38 40 39 DECLEXPORT(CR_UNPACK_BUFFER_TYPE) crUnpackGetBufferType(const void *opcodes, unsigned int num_opcodes); 41 40 42 41 extern CRNetworkPointer * return_ptr; -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/state/cr_texture.h
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/state/cr_texture.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/include/state/cr_texture.h
old new 90 90 #ifdef CR_ARB_shadow_ambient 91 91 GLfloat compareFailValue; 92 92 #endif 93 93 #ifdef CR_SGIS_generate_mipmap 94 94 GLboolean generateMipmap; 95 95 #endif 96 GLboolean pinned; /* <- keep the texture alive if its ctxUsage reaches zero */97 96 CRbitvalue dirty[CR_MAX_BITARRAY]; 98 97 CRbitvalue imageBit[CR_MAX_BITARRAY]; 99 98 CRbitvalue paramsBit[CR_MAX_TEXTURE_UNITS][CR_MAX_BITARRAY]; 100 99 /* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */ 101 100 CRbitvalue ctxUsage[CR_MAX_BITARRAY]; 102 101 } CRTextureObj; -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/opcodes.py
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/opcodes.py /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/opcodes.py
old new 35 35 36 36 print "\tCR_EXTEND_OPCODE=%d," % enum_index 37 37 enum_index = enum_index + 1 38 38 print "\tCR_CMDBLOCKBEGIN_OPCODE=%d," % enum_index 39 39 enum_index = enum_index + 1 40 40 print "\tCR_CMDBLOCKEND_OPCODE=%d," % enum_index 41 enum_index = enum_index + 142 print "\tCR_CMDBLOCKFLUSH_OPCODE=%d," % enum_index43 41 print "\tCR_NOP_OPCODE=255" 44 42 if enum_index > 254: 45 43 # This would have saved Mike some grief if it had been here earlier. 46 44 print >> sys.stderr, "You have more than 255 opcodes! You've been adding functions to" 47 45 print >> sys.stderr, "glapi_parser/APIspec! Each new function you add" 48 46 print >> sys.stderr, "gets an opcode assigned to it. Fortunately for you, we have" -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_beginend.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_beginend.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_beginend.c
old new 10 10 void PACK_APIENTRY crPackBegin( GLenum mode ) 11 11 { 12 12 CR_GET_PACKER_CONTEXT(pc); 13 13 unsigned char *data_ptr; 14 14 (void) pc; 15 15 16 if (CR_CMDBLOCK_IS_STARTED(pc, CRPACKBLOCKSTATE_OP_BEGIN))17 {18 WARN(("recursive begin?"));19 return;20 }21 22 16 CR_CMDBLOCK_BEGIN( pc, CRPACKBLOCKSTATE_OP_BEGIN ); 23 17 #ifndef VBOX 24 18 if (pc->buffer.canBarf) 25 19 { 26 20 if (!pc->buffer.holds_BeginEnd) 27 21 pc->Flush( pc->flush_arg ); … … 81 75 CR_GET_BUFFERED_POINTER_NO_ARGS( pc ); 82 76 WRITE_OPCODE( pc, CR_END_OPCODE ); 83 77 pc->buffer.in_BeginEnd = 0; 84 78 CR_CMDBLOCK_END( pc, CRPACKBLOCKSTATE_OP_BEGIN ); 85 79 CR_UNLOCK_PACKER_CONTEXT(pc); 86 80 } 81 -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_bufferobject.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_bufferobject.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_bufferobject.c
old new 96 96 WRITE_DATA( 8, GLenum, target ); 97 97 WRITE_DATA( 12, GLuint, (GLuint) offset ); 98 98 WRITE_DATA( 16, GLuint, (GLuint) size ); 99 99 WRITE_NETWORK_POINTER( 20, (void *) data ); 100 100 WRITE_NETWORK_POINTER( 28, (void *) writeback ); 101 101 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 102 CR_CMDBLOCK_CHECK_FLUSH(pc);103 102 CR_UNLOCK_PACKER_CONTEXT(pc); 104 103 } 105 104 106 105 void PACK_APIENTRY 107 106 crPackDeleteBuffersARB(GLsizei n, const GLuint * buffers) 108 107 { -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_context.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_context.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_context.c
old new 42 42 WRITE_BYTES( 8, displayName, DISPLAY_NAME_LEN ); 43 43 WRITE_DATA( DISPLAY_NAME_LEN + 8, GLint, visual ); 44 44 WRITE_DATA( DISPLAY_NAME_LEN + 12, GLint, shareCtx ); 45 45 WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 16, (void *) return_value ); 46 46 WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 24, (void *) writeback ); 47 47 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 48 CR_CMDBLOCK_CHECK_FLUSH(pc);49 48 CR_UNLOCK_PACKER_CONTEXT(pc); 50 49 } 51 50 52 51 void PACK_APIENTRY 53 52 crPackCreateContextSWAP( const char *dpyName, GLint visual, GLint shareCtx, 54 53 GLint *return_value, int *writeback ) … … 75 74 WRITE_BYTES( 8, displayName, DISPLAY_NAME_LEN ); 76 75 WRITE_DATA( DISPLAY_NAME_LEN + 8, GLenum, SWAP32(visual) ); 77 76 WRITE_DATA( DISPLAY_NAME_LEN + 12, GLenum, SWAP32(shareCtx) ); 78 77 WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 16, (void *) return_value ); 79 78 WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 24, (void *) writeback ); 80 79 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 81 CR_CMDBLOCK_CHECK_FLUSH(pc);82 80 CR_UNLOCK_PACKER_CONTEXT(pc); 83 81 } 84 82 85 83 86 84 void PACK_APIENTRY crPackWindowCreate( const char *dpyName, GLint visBits, GLint *return_value, int *writeback ) 87 85 { … … 105 103 WRITE_DATA( 4, GLenum, CR_WINDOWCREATE_EXTEND_OPCODE ); 106 104 WRITE_BYTES( 8, displayName, DISPLAY_NAME_LEN ); 107 105 WRITE_DATA( DISPLAY_NAME_LEN + 8, GLint, visBits ); 108 106 WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 12, (void *) return_value ); 109 107 WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 20, (void *) writeback ); 110 108 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 111 CR_CMDBLOCK_CHECK_FLUSH(pc);112 109 CR_UNLOCK_PACKER_CONTEXT(pc); 113 110 } 114 111 115 112 void PACK_APIENTRY crPackWindowCreateSWAP( const char *dpyName, GLint visBits, GLint *return_value, int *writeback ) 116 113 { 117 114 char displayName[DISPLAY_NAME_LEN]; … … 134 131 WRITE_DATA( 4, GLenum, SWAP32(CR_WINDOWCREATE_EXTEND_OPCODE) ); 135 132 WRITE_BYTES( 8, displayName, DISPLAY_NAME_LEN ); 136 133 WRITE_DATA( DISPLAY_NAME_LEN + 8, GLint, SWAP32(visBits) ); 137 134 WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 12, (void *) return_value ); 138 135 WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 20, (void *) writeback ); 139 136 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 140 CR_CMDBLOCK_CHECK_FLUSH(pc);141 137 CR_UNLOCK_PACKER_CONTEXT(pc); 142 138 } -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/packer.py
Binary files vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_currenttypes.pyc and /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_currenttypes.pyc differ diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/packer.py /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/packer.py
old new 207 207 # finish up 208 208 if is_extended: 209 209 print "\tWRITE_OPCODE( pc, CR_EXTEND_OPCODE );" 210 210 else: 211 211 print "\tWRITE_OPCODE( pc, %s );" % apiutil.OpcodeName( func_name ) 212 212 213 if "get" in apiutil.Properties(func_name):214 print '\tCR_CMDBLOCK_CHECK_FLUSH(pc);'215 216 213 print '\tCR_UNLOCK_PACKER_CONTEXT(pc);' 217 214 print '}\n' 218 215 219 216 220 r0_funcs = [ 'ChromiumParameteriCR', 'WindowSize', 'WindowShow', 'WindowPosition' ]221 217 222 218 223 219 apiutil.CopyrightC() 224 220 225 221 print """ 226 222 /* DO NOT EDIT - THIS FILE GENERATED BY THE packer.py SCRIPT */ … … 259 255 pointers_ok = 1 260 256 params.append(("writeback", "int *", 0)) 261 257 262 258 if func_name == 'Writeback': 263 259 pointers_ok = 1 264 260 265 if not func_name in r0_funcs:266 print '#ifndef IN_RING0'267 268 261 PrintFunc( func_name, params, 0, pointers_ok ) 269 262 PrintFunc( func_name, params, 1, pointers_ok ) 270 271 if not func_name in r0_funcs:272 print '#endif'273 -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_init.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_init.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_init.c
old new 14 14 int cr_packer_globals; /* dummy - for the sake of packer.def */ 15 15 #else 16 16 int _PackerTSD; /* dummy - for the sake of packer.def */ /* drm1 */ 17 17 DLLDATA(CRPackContext) cr_packer_globals; 18 18 #endif 19 19 20 uint32_t cr_packer_cmd_blocks_enabled = 0;20 int cr_packer_cmd_blocks_enabled = 0; 21 21 22 22 CRPackContext *crPackNewContext( int swapping ) 23 23 { 24 24 #ifdef CHROMIUM_THREADSAFE 25 25 CRPackContext *pc = crCalloc(sizeof(CRPackContext)); 26 26 if (!pc) … … 65 65 return (CRPackContext *) crGetTSD( &_PackerTSD ); 66 66 #else 67 67 return &cr_packer_globals; 68 68 #endif 69 69 } 70 70 71 void crPackC apsSet(uint32_t u32Caps)71 void crPackCmdBlocksEnable() 72 72 { 73 cr_packer_cmd_blocks_enabled = (u32Caps & (CR_VBOX_CAP_CMDBLOCKS_FLUSH | CR_VBOX_CAP_CMDBLOCKS));73 cr_packer_cmd_blocks_enabled = 1; 74 74 } -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_lists.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_lists.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_lists.c
old new 60 60 61 61 void PACK_APIENTRY crPackNewList( GLuint list, GLenum mode ) 62 62 { 63 63 CR_GET_PACKER_CONTEXT(pc); 64 64 unsigned char *data_ptr; 65 65 (void) pc; 66 67 if (CR_CMDBLOCK_IS_STARTED(pc, CRPACKBLOCKSTATE_OP_NEWLIST))68 {69 WARN(("recursive NewList?"));70 return;71 }72 73 66 CR_CMDBLOCK_BEGIN( pc, CRPACKBLOCKSTATE_OP_NEWLIST ); 74 67 CR_GET_BUFFERED_POINTER_NO_BEGINEND_FLUSH( pc, 16, GL_FALSE ); 75 68 WRITE_DATA( 0, GLint, 16 ); 76 69 WRITE_DATA( 4, GLenum, CR_NEWLIST_EXTEND_OPCODE ); 77 70 WRITE_DATA( 8, GLuint, list ); 78 71 WRITE_DATA( 12, GLenum, mode ); -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_pixels.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_pixels.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_pixels.c
old new 100 100 WRITE_DATA( 32, GLint, packstate->skipRows ); 101 101 WRITE_DATA( 36, GLint, packstate->skipPixels ); 102 102 WRITE_DATA( 40, GLint, bytes_per_row ); 103 103 WRITE_DATA( 44, GLint, packstate->rowLength ); 104 104 WRITE_NETWORK_POINTER( 48, (char *) pixels ); 105 105 WRITE_OPCODE( pc, CR_READPIXELS_OPCODE ); 106 CR_CMDBLOCK_CHECK_FLUSH(pc);107 106 CR_UNLOCK_PACKER_CONTEXT(pc); 108 107 } 109 108 110 109 /* Round N up to the next multiple of 8 */ 111 110 #define CEIL8(N) (((N) + 7) & ~0x7) 112 111 … … 217 216 WRITE_DATA( 12, GLint, level ); 218 217 WRITE_DATA( 16, GLenum, format ); 219 218 WRITE_DATA( 20, GLenum, type ); 220 219 WRITE_NETWORK_POINTER( 24, (void *) pixels ); 221 220 WRITE_NETWORK_POINTER( 32, (void *) writeback ); 222 221 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 223 CR_CMDBLOCK_CHECK_FLUSH(pc);224 222 CR_UNLOCK_PACKER_CONTEXT(pc); 225 223 } -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_program.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_program.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_program.c
old new 278 278 WRITE_DATA(4, GLenum, CR_AREPROGRAMSRESIDENTNV_EXTEND_OPCODE); 279 279 WRITE_DATA(8, GLsizei, n); 280 280 crMemcpy(data_ptr + 12, programs, n * sizeof(*programs)); 281 281 WRITE_NETWORK_POINTER(12 + n * sizeof(*programs), (void *) residences); 282 282 WRITE_NETWORK_POINTER(20 + n * sizeof(*programs), (void *) writeback); 283 283 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 284 CR_CMDBLOCK_CHECK_FLUSH(pc);285 284 CR_UNLOCK_PACKER_CONTEXT(pc); 286 285 } 287 286 288 287 289 288 void PACK_APIENTRY crPackGetProgramNamedParameterfvNV( GLuint id, GLsizei len, const GLubyte *name, GLfloat *params, int *writeback ) 290 289 { … … 297 296 WRITE_DATA( 8, GLuint, id ); 298 297 WRITE_DATA( 12, GLsizei, len ); 299 298 crMemcpy(data_ptr + 16, name, len); 300 299 WRITE_NETWORK_POINTER( 16 + len, (void *) params ); 301 300 WRITE_NETWORK_POINTER( 16 + len + 8, (void *) writeback ); 302 301 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 303 CR_CMDBLOCK_CHECK_FLUSH(pc);304 302 CR_UNLOCK_PACKER_CONTEXT(pc); 305 303 } 306 304 307 305 void PACK_APIENTRY crPackGetProgramNamedParameterdvNV( GLuint id, GLsizei len, const GLubyte *name, GLdouble *params, int *writeback ) 308 306 { 309 307 int packet_length = 32 + len; … … 315 313 WRITE_DATA( 8, GLuint, id ); 316 314 WRITE_DATA( 12, GLsizei, len ); 317 315 crMemcpy(data_ptr + 16, name, len); 318 316 WRITE_NETWORK_POINTER( 16 + len, (void *) params ); 319 317 WRITE_NETWORK_POINTER( 16 + len + 8, (void *) writeback ); 320 318 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 321 CR_CMDBLOCK_CHECK_FLUSH(pc);322 319 CR_UNLOCK_PACKER_CONTEXT(pc); 323 320 } 324 321 325 322 326 323 void PACK_APIENTRY crPackDeleteProgramsARB( GLsizei n, const GLuint *ids ) 327 324 { -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_shaders.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_shaders.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_shaders.c
old new 425 425 WRITE_DATA(8, GLuint, program); 426 426 WRITE_DATA(12, GLuint, index); 427 427 WRITE_DATA(16, GLsizei, bufSize); 428 428 WRITE_NETWORK_POINTER(20, (void *) length); 429 429 WRITE_NETWORK_POINTER(28, (void *) writeback); 430 430 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 431 CR_CMDBLOCK_CHECK_FLUSH(pc);432 431 CR_UNLOCK_PACKER_CONTEXT(pc); 433 432 } 434 433 435 434 void PACK_APIENTRY crPackGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback) 436 435 { 437 436 CR_GET_PACKER_CONTEXT(pc); … … 446 445 WRITE_DATA(8, GLuint, program); 447 446 WRITE_DATA(12, GLuint, index); 448 447 WRITE_DATA(16, GLsizei, bufSize); 449 448 WRITE_NETWORK_POINTER(20, (void *) length); 450 449 WRITE_NETWORK_POINTER(28, (void *) writeback); 451 450 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 452 CR_CMDBLOCK_CHECK_FLUSH(pc);453 451 CR_UNLOCK_PACKER_CONTEXT(pc); 454 452 } 455 453 456 454 void PACK_APIENTRY crPackGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders, int * writeback) 457 455 { 458 456 CR_GET_PACKER_CONTEXT(pc); … … 464 462 WRITE_DATA(4, GLenum, CR_GETATTACHEDSHADERS_EXTEND_OPCODE); 465 463 WRITE_DATA(8, GLuint, program); 466 464 WRITE_DATA(12, GLsizei, maxCount); 467 465 WRITE_NETWORK_POINTER(16, (void *) count); 468 466 WRITE_NETWORK_POINTER(24, (void *) writeback); 469 467 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 470 CR_CMDBLOCK_CHECK_FLUSH(pc);471 468 CR_UNLOCK_PACKER_CONTEXT(pc); 472 469 } 473 470 474 471 void PACK_APIENTRY crPackGetAttachedObjectsARB(VBoxGLhandleARB containerObj, GLsizei maxCount, GLsizei * count, VBoxGLhandleARB * obj, int * writeback) 475 472 { 476 473 CR_GET_PACKER_CONTEXT(pc); … … 481 478 WRITE_DATA(4, GLenum, CR_GETATTACHEDOBJECTSARB_EXTEND_OPCODE); 482 479 WRITE_DATA(8, VBoxGLhandleARB, containerObj); 483 480 WRITE_DATA(12, GLsizei, maxCount); 484 481 WRITE_NETWORK_POINTER(16, (void *) count); 485 482 WRITE_NETWORK_POINTER(24, (void *) writeback); 486 483 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 487 CR_CMDBLOCK_CHECK_FLUSH(pc);488 484 CR_UNLOCK_PACKER_CONTEXT(pc); 489 485 } 490 486 491 487 void PACK_APIENTRY crPackGetInfoLogARB(VBoxGLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog, int * writeback) 492 488 { 493 489 CR_GET_PACKER_CONTEXT(pc); … … 498 494 WRITE_DATA(4, GLenum, CR_GETINFOLOGARB_EXTEND_OPCODE); 499 495 WRITE_DATA(8, VBoxGLhandleARB, obj); 500 496 WRITE_DATA(12, GLsizei, maxLength); 501 497 WRITE_NETWORK_POINTER(16, (void *) length); 502 498 WRITE_NETWORK_POINTER(24, (void *) writeback); 503 499 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 504 CR_CMDBLOCK_CHECK_FLUSH(pc);505 500 CR_UNLOCK_PACKER_CONTEXT(pc); 506 501 } 507 502 508 503 void PACK_APIENTRY crPackGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback) 509 504 { 510 505 CR_GET_PACKER_CONTEXT(pc); … … 516 511 WRITE_DATA(4, GLenum, CR_GETPROGRAMINFOLOG_EXTEND_OPCODE); 517 512 WRITE_DATA(8, GLuint, program); 518 513 WRITE_DATA(12, GLsizei, bufSize); 519 514 WRITE_NETWORK_POINTER(16, (void *) length); 520 515 WRITE_NETWORK_POINTER(24, (void *) writeback); 521 516 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 522 CR_CMDBLOCK_CHECK_FLUSH(pc);523 517 CR_UNLOCK_PACKER_CONTEXT(pc); 524 518 } 525 519 526 520 void PACK_APIENTRY crPackGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback) 527 521 { 528 522 CR_GET_PACKER_CONTEXT(pc); … … 534 528 WRITE_DATA(4, GLenum, CR_GETSHADERINFOLOG_EXTEND_OPCODE); 535 529 WRITE_DATA(8, GLuint, shader); 536 530 WRITE_DATA(12, GLsizei, bufSize); 537 531 WRITE_NETWORK_POINTER(16, (void *) length); 538 532 WRITE_NETWORK_POINTER(24, (void *) writeback); 539 533 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 540 CR_CMDBLOCK_CHECK_FLUSH(pc);541 534 CR_UNLOCK_PACKER_CONTEXT(pc); 542 535 } 543 536 544 537 void PACK_APIENTRY crPackGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, char * source, int * writeback) 545 538 { 546 539 CR_GET_PACKER_CONTEXT(pc); … … 552 545 WRITE_DATA(4, GLenum, CR_GETSHADERSOURCE_EXTEND_OPCODE); 553 546 WRITE_DATA(8, GLuint, shader); 554 547 WRITE_DATA(12, GLsizei, bufSize); 555 548 WRITE_NETWORK_POINTER(16, (void *) length); 556 549 WRITE_NETWORK_POINTER(24, (void *) writeback); 557 550 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 558 CR_CMDBLOCK_CHECK_FLUSH(pc);559 551 CR_UNLOCK_PACKER_CONTEXT(pc); 560 552 } 561 553 562 554 void PACK_APIENTRY crPackGetUniformsLocations(GLuint program, GLsizei maxcbData, GLsizei * cbData, GLvoid * pData, int * writeback) 563 555 { 564 556 CR_GET_PACKER_CONTEXT(pc); … … 569 561 WRITE_DATA(4, GLenum, CR_GETUNIFORMSLOCATIONS_EXTEND_OPCODE); 570 562 WRITE_DATA(8, GLuint, program); 571 563 WRITE_DATA(12, GLsizei, maxcbData); 572 564 WRITE_NETWORK_POINTER(16, (void *) cbData); 573 565 WRITE_NETWORK_POINTER(24, (void *) writeback); 574 566 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 575 CR_CMDBLOCK_CHECK_FLUSH(pc);576 567 CR_UNLOCK_PACKER_CONTEXT(pc); 577 568 } 578 569 579 570 void PACK_APIENTRY crPackGetAttribsLocations(GLuint program, GLsizei maxcbData, GLsizei * cbData, GLvoid * pData, int * writeback) 580 571 { 581 572 CR_GET_PACKER_CONTEXT(pc); … … 586 577 WRITE_DATA(4, GLenum, CR_GETATTRIBSLOCATIONS_EXTEND_OPCODE); 587 578 WRITE_DATA(8, GLuint, program); 588 579 WRITE_DATA(12, GLsizei, maxcbData); 589 580 WRITE_NETWORK_POINTER(16, (void *) cbData); 590 581 WRITE_NETWORK_POINTER(24, (void *) writeback); 591 582 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 592 CR_CMDBLOCK_CHECK_FLUSH(pc);593 583 CR_UNLOCK_PACKER_CONTEXT(pc); 594 584 } 595 585 596 586 void PACK_APIENTRY crPackGetAttribLocation(GLuint program, const char * name, GLint * return_value, int * writeback) 597 587 { 598 588 CR_GET_PACKER_CONTEXT(pc); … … 606 596 WRITE_DATA_AI(GLuint, program); 607 597 crMemcpy(data_ptr, name, cbName*sizeof(*name)); 608 598 data_ptr += cbName*sizeof(*name); 609 599 WRITE_NETWORK_POINTER(0, (void *) return_value); 610 600 WRITE_NETWORK_POINTER(8, (void *) writeback); 611 601 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 612 CR_CMDBLOCK_CHECK_FLUSH(pc);613 602 CR_UNLOCK_PACKER_CONTEXT(pc); 614 603 } 615 604 616 605 void PACK_APIENTRY crPackGetUniformLocation(GLuint program, const char * name, GLint * return_value, int * writeback) 617 606 { 618 607 CR_GET_PACKER_CONTEXT(pc); … … 626 615 WRITE_DATA_AI(GLuint, program); 627 616 crMemcpy(data_ptr, name, cbName*sizeof(*name)); 628 617 data_ptr += cbName*sizeof(*name); 629 618 WRITE_NETWORK_POINTER(0, (void *) return_value); 630 619 WRITE_NETWORK_POINTER(8, (void *) writeback); 631 620 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 632 CR_CMDBLOCK_CHECK_FLUSH(pc);633 621 CR_UNLOCK_PACKER_CONTEXT(pc); 634 622 } 635 623 636 624 void PACK_APIENTRY crPackBindAttribLocationSWAP(GLuint program, GLuint index, const char *name) 637 625 { 638 626 CR_GET_PACKER_CONTEXT(pc); -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_swap_texture.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_swap_texture.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_swap_texture.c
old new 681 681 WRITE_DATA( (i+1)*sizeof( int ) + 8, GLuint, SWAP32(textures[i]) ); 682 682 } 683 683 WRITE_NETWORK_POINTER( sizeof( int ) + 8 + n*sizeof( *textures ), (void *) residences ); 684 684 WRITE_NETWORK_POINTER( sizeof( int ) + 16 + n*sizeof( *textures ), (void *) return_val ); 685 685 WRITE_NETWORK_POINTER( sizeof( int ) + 24 + n*sizeof( *textures ), (void *) writeback ); 686 686 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 687 CR_CMDBLOCK_CHECK_FLUSH(pc);688 687 CR_UNLOCK_PACKER_CONTEXT(pc); 689 688 } 690 689 691 690 692 691 /********************************************************************** 693 692 * Texture compression -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_texture.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_texture.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/packer/pack_texture.c
old new 715 715 WRITE_DATA(4, GLenum, CR_ARETEXTURESRESIDENT_EXTEND_OPCODE); 716 716 WRITE_DATA(8, GLsizei, n); 717 717 crMemcpy(data_ptr + 12, textures, n * sizeof(*textures)); 718 718 WRITE_NETWORK_POINTER(12 + n * sizeof(*textures), (void *) residences); 719 719 WRITE_NETWORK_POINTER(20 + n * sizeof(*textures), (void *) writeback); 720 720 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 721 CR_CMDBLOCK_CHECK_FLUSH(pc);722 721 CR_UNLOCK_PACKER_CONTEXT(pc); 723 722 } 724 723 725 724 726 725 /********************************************************************** 727 726 * Texture compression -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/spu_loader/spuload.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/spu_loader/spuload.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/spu_loader/spuload.c
old new 92 92 * crSPUUnloadChain in the failure branches below will misbehave */ 93 93 crMemset(the_spu, 0, sizeof (*the_spu)); 94 94 the_spu->id = id; 95 95 the_spu->privatePtr = NULL; 96 96 path = __findDLL( name, dir ); 97 97 the_spu->dll = crDLLOpen( path, 0/*resolveGlobal*/ ); 98 #if defined(DEBUG_misha) && defined(RT_OS_WINDOWS)99 crDbgCmdSymLoadPrint(path, the_spu->dll->hinstLib);100 #endif101 98 the_spu->entry_point = 102 99 (SPULoadFunction) crDLLGetNoError( the_spu->dll, SPU_ENTRY_POINT_NAME ); 103 100 if (!the_spu->entry_point) 104 101 { 105 102 crError( "Couldn't load the SPU entry point \"%s\" from SPU \"%s\"!", 106 103 SPU_ENTRY_POINT_NAME, name ); -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_diff.c
Binary files vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/convert.pyc and /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/convert.pyc differ Binary files vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/get_components.pyc and /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/get_components.pyc differ diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_diff.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_diff.c
old new 584 584 { 585 585 if (ctx->error != GL_NO_ERROR) 586 586 ctx->error = err; 587 587 } 588 588 } 589 589 590 GLenum crStateCleanHWErrorState()591 {592 GLenum err;593 while ((err = diff_api.GetError()) != GL_NO_ERROR)594 {595 static int cErrPrints = 0;596 #ifndef DEBUG_misha597 if (cErrPrints < 5)598 #endif599 {600 ++cErrPrints;601 WARN(("cleaning gl error (0x%x), ignoring.. (%d out of 5) ..", err, cErrPrints));602 }603 }604 605 return err;606 }607 608 609 590 void crStateSwitchPrepare(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO) 610 591 { 611 592 if (!fromCtx) 612 593 return; 613 594 614 595 if (g_bVBoxEnableDiffOnMakeCurrent && toCtx && toCtx != fromCtx) … … 621 602 622 603 void crStateSwitchPostprocess(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO) 623 604 { 624 605 if (!toCtx) 625 606 return; 626 607 627 #ifdef CR_EXT_framebuffer_object628 crStateFramebufferObjectReenableHW(fromCtx, toCtx, idDrawFBO, idReadFBO);629 #endif630 631 608 if (g_bVBoxEnableDiffOnMakeCurrent && fromCtx && toCtx != fromCtx) 632 609 { 633 CR_STATE_CLEAN_HW_ERR_WARN("error on make current"); 610 GLenum err; 611 while ((err = diff_api.GetError()) != GL_NO_ERROR) 612 { 613 static int cErrPrints = 0; 614 #ifndef DEBUG_misha 615 if (cErrPrints < 5) 616 #endif 617 { 618 ++cErrPrints; 619 crWarning("gl error (0x%x) after context switch, ignoring.. (%d out of 5) ..", err, cErrPrints); 620 } 621 } 634 622 } 623 #ifdef CR_EXT_framebuffer_object 624 crStateFramebufferObjectReenableHW(fromCtx, toCtx, idDrawFBO, idReadFBO); 625 #endif 635 626 } -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_framebuffer.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_framebuffer.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_framebuffer.c
old new 1093 1093 1094 1094 1095 1095 DECLEXPORT(GLuint) STATE_APIENTRY crStateGetFramebufferHWID(GLuint id) 1096 1096 { 1097 1097 CRContext *g = GetCurrentContext(); 1098 1098 CRFramebufferObject *pFBO = (CRFramebufferObject*) crHashtableSearch(g->shared->fbTable, id); 1099 #if 0 //def DEBUG_misha1099 #ifdef DEBUG_misha 1100 1100 crDebug("FB id(%d) hw(%d)", id, pFBO ? pFBO->hwid : 0); 1101 1101 #endif 1102 1102 return pFBO ? pFBO->hwid : 0; 1103 1103 } 1104 1104 1105 1105 DECLEXPORT(GLuint) STATE_APIENTRY crStateGetRenderbufferHWID(GLuint id) -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state.h
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state.h
old new 73 73 void crStateFreeBufferObject(void *data); 74 74 void crStateFreeFBO(void *data); 75 75 void crStateFreeRBO(void *data); 76 76 77 77 void crStateGenNames(CRContext *g, CRHashTable *table, GLsizei n, GLuint *names); 78 78 void crStateRegNames(CRContext *g, CRHashTable *table, GLsizei n, GLuint *names); 79 void crStateOnTextureUsageRelease(CRSharedState *pS, CRTextureObj *pObj);80 79 #endif -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_init.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_init.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_init.c
old new 46 46 s->refCount = 1; /* refcount is number of contexts using this state */ 47 47 s->saveCount = 0; 48 48 } 49 49 return s; 50 50 } 51 51 52 53 52 54 /** 53 55 * Callback used for crFreeHashtable(). 54 56 */ 55 57 DECLEXPORT(void) 56 58 crStateDeleteTextureCallback(void *texObj) 57 59 { … … 64 66 typedef struct CR_STATE_RELEASEOBJ 65 67 { 66 68 CRContext *pCtx; 67 69 CRSharedState *s; 68 70 } CR_STATE_RELEASEOBJ, *PCR_STATE_RELEASEOBJ; 69 71 70 void crStateOnTextureUsageRelease(CRSharedState *pS, CRTextureObj *pObj)71 {72 if (!pObj->pinned)73 crHashtableDelete(pS->textureTable, pObj->id, crStateDeleteTextureCallback);74 else75 Assert(crHashtableSearch(pS->textureTable, pObj->id));76 }77 78 void crStateReleaseTextureInternal(CRSharedState *pS, CRContext *pCtx, CRTextureObj *pObj)79 {80 Assert(CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj) || pObj->pinned);81 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pCtx);82 if (CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj))83 return;84 85 crStateOnTextureUsageRelease(pS, pObj);86 }87 88 DECLEXPORT(void) crStateReleaseTexture(CRContext *pCtx, CRTextureObj *pObj)89 {90 Assert(CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj));91 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pCtx);92 if (CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj))93 return;94 95 if (!gSharedState)96 {97 WARN(("no global shared"));98 return;99 }100 101 crStateOnTextureUsageRelease(gSharedState, pObj);102 }103 104 void crStateReleaseBufferObjectInternal(CRSharedState *pS, CRContext *pCtx, CRBufferObject *pObj)105 {106 Assert(CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj));107 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pCtx);108 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj))109 crHashtableDelete(pS->buffersTable, pObj->id, crStateFreeBufferObject);110 }111 112 void crStateReleaseFBOInternal(CRSharedState *pS, CRContext *pCtx, CRFramebufferObject *pObj)113 {114 Assert(CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj));115 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pCtx);116 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj))117 crHashtableDelete(pS->fbTable, pObj->id, crStateFreeFBO);118 }119 120 void crStateReleaseRBOInternal(CRSharedState *pS, CRContext *pCtx, CRRenderbufferObject *pObj)121 {122 Assert(CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj));123 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pCtx);124 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj))125 crHashtableDelete(pS->rbTable, pObj->id, crStateFreeRBO);126 }127 128 72 static void ReleaseTextureCallback(unsigned long key, void *data1, void *data2) 129 73 { 130 74 PCR_STATE_RELEASEOBJ pData = (PCR_STATE_RELEASEOBJ)data2; 131 75 CRTextureObj *pObj = (CRTextureObj *)data1; 132 crStateReleaseTextureInternal(pData->s, pData->pCtx, pObj); 76 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pData->pCtx); 77 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj)) 78 crHashtableDelete(pData->s->textureTable, key, crStateDeleteTextureCallback); 133 79 } 134 80 135 81 static void ReleaseBufferObjectCallback(unsigned long key, void *data1, void *data2) 136 82 { 137 83 PCR_STATE_RELEASEOBJ pData = (PCR_STATE_RELEASEOBJ)data2; 138 84 CRBufferObject *pObj = (CRBufferObject *)data1; 139 crStateReleaseBufferObjectInternal(pData->s, pData->pCtx, pObj); 85 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pData->pCtx); 86 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj)) 87 crHashtableDelete(pData->s->buffersTable, key, crStateFreeBufferObject); 140 88 } 141 89 142 90 static void ReleaseFBOCallback(unsigned long key, void *data1, void *data2) 143 91 { 144 92 PCR_STATE_RELEASEOBJ pData = (PCR_STATE_RELEASEOBJ)data2; 145 93 CRFramebufferObject *pObj = (CRFramebufferObject *)data1; 146 crStateReleaseFBOInternal(pData->s, pData->pCtx, pObj); 94 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pData->pCtx); 95 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj)) 96 crHashtableDelete(pData->s->fbTable, key, crStateFreeFBO); 147 97 } 148 98 149 99 static void ReleaseRBOCallback(unsigned long key, void *data1, void *data2) 150 100 { 151 101 PCR_STATE_RELEASEOBJ pData = (PCR_STATE_RELEASEOBJ)data2; 152 102 CRRenderbufferObject *pObj = (CRRenderbufferObject *)data1; 153 crStateReleaseRBOInternal(pData->s, pData->pCtx, pObj); 103 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pData->pCtx); 104 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj)) 105 crHashtableDelete(pData->s->rbTable, key, crStateFreeRBO); 154 106 } 155 107 156 108 /** 157 109 * Decrement shared state's refcount and delete when it hits zero. 158 110 */ 159 111 DECLEXPORT(void) -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_lists.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_lists.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_lists.c
old new 171 171 void STATE_APIENTRY crStateQueryHWState(GLuint fbFbo, GLuint bbFbo) 172 172 { 173 173 CRContext *g = GetCurrentContext(); 174 174 CRStateBits *sb = GetCurrentBits(); 175 175 CRbitvalue *bitID=g->bitid, *negbitID=g->neg_bitid; 176 176 177 CRASSERT(g_bVBoxEnableDiffOnMakeCurrent);178 179 crStateSyncHWErrorState(g);180 181 177 if (CHECKDIRTY(sb->buffer.dirty, negbitID)) 182 178 { 183 179 if (CHECKDIRTY(sb->buffer.enable, negbitID)) 184 180 { 185 181 CRSTATE_SET_ENABLED(buffer.depthTest, GL_DEPTH_TEST); 186 182 CRSTATE_SET_ENABLED(buffer.blend, GL_BLEND); … … 1202 1198 } 1203 1199 #endif 1204 1200 crMemcpy(&g->polygon.stipple[0], &stipple[0], sizeof(stipple)); 1205 1201 } 1206 1202 } 1207 1203 } 1208 1209 CR_STATE_CLEAN_HW_ERR_WARN("error on hw sync");1210 1204 } 1211 1205 1212 1206 void STATE_APIENTRY crStateNewList (GLuint list, GLenum mode) 1213 1207 { 1214 1208 CRContext *g = GetCurrentContext(); 1215 1209 CRListsState *l = &(g->lists); -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_texture.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_texture.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/state_tracker/state_texture.c
old new 750 750 751 751 #ifdef CR_EXT_framebuffer_object 752 752 crStateTextureCheckFBOAPs(GL_DRAW_FRAMEBUFFER, tObj->id); 753 753 crStateTextureCheckFBOAPs(GL_READ_FRAMEBUFFER, tObj->id); 754 754 #endif 755 755 } 756 757 CR_STATE_SHAREDOBJ_USAGE_CLEAR(tObj, g); 756 758 } 757 759 758 760 void STATE_APIENTRY crStateDeleteTextures(GLsizei n, const GLuint *textures) 759 761 { 760 762 CRContext *g = GetCurrentContext(); 761 763 CRTextureState *t = &(g->texture); … … 790 792 if (tObj) 791 793 { 792 794 GLuint j; 793 795 794 796 crStateCleanupTextureRefs(g, tObj); 795 797 796 CR_STATE_SHAREDOBJ_USAGE_CLEAR(tObj, g);797 798 798 CR_STATE_SHAREDOBJ_USAGE_FOREACH_USED_IDX(tObj, j) 799 799 { 800 800 /* saved state version <= SHCROGL_SSM_VERSION_BEFORE_CTXUSAGE_BITS does not have usage bits info, 801 801 * so on restore, we set mark bits as used. 802 802 * This is why g_pAvailableContexts[j] could be NULL 803 803 * also g_pAvailableContexts[0] will hold default context, which we should discard */ 804 804 CRContext *ctx = g_pAvailableContexts[j]; 805 805 if (j && ctx) 806 {807 806 crStateCleanupTextureRefs(ctx, tObj); 808 CR_STATE_SHAREDOBJ_USAGE_CLEAR(tObj, g);809 }810 807 else 811 808 CR_STATE_SHAREDOBJ_USAGE_CLEAR_IDX(tObj, j); 812 809 } 813 810 814 811 /* on the host side, ogl texture object is deleted by a separate cr_server.head_spu->dispatch_table.DeleteTextures(n, newTextures); 815 812 * in crServerDispatchDeleteTextures, we just delete a state object here, which crStateDeleteTextureObject does */ … … 893 890 /* update the current matrix pointer, etc. */ 894 891 if (g->transform.matrixMode == GL_TEXTURE) { 895 892 crStateMatrixMode(GL_TEXTURE); 896 893 } 897 894 } 898 895 899 #ifndef IN_GUEST900 # ifdef DEBUG901 static uint32_t gDbgNumPinned = 0;902 # endif903 904 DECLEXPORT(void) crStatePinTexture(GLuint texture, GLboolean pin)905 {906 CRTextureObj * pTobj;907 CRSharedState *pShared = crStateGlobalSharedAcquire();908 if (pShared)909 {910 pTobj = (CRTextureObj*)crHashtableSearch(pShared->textureTable, texture);911 912 if (pTobj)913 {914 # ifdef DEBUG915 if (!pTobj->pinned != !pin)916 {917 if (pin)918 ++gDbgNumPinned;919 else920 {921 Assert(gDbgNumPinned);922 --gDbgNumPinned;923 }924 }925 # endif926 pTobj->pinned = !!pin;927 if (!pin)928 {929 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pTobj))930 crStateOnTextureUsageRelease(pShared, pTobj);931 }932 }933 else934 WARN(("texture %d not defined", texture));935 936 crStateGlobalSharedRelease();937 }938 else939 WARN(("no global shared"));940 }941 #endif942 943 896 DECLEXPORT(void) crStateSetTextureUsed(GLuint texture, GLboolean used) 944 897 { 945 898 CRContext *g = GetCurrentContext(); 946 899 CRTextureObj *tobj; 947 900 948 901 if (!texture) … … 959 912 { 960 913 tobj = crStateTextureAllocate_t(g, texture); 961 914 } 962 915 else 963 916 #endif 964 917 { 965 WARN(("crStateSetTextureUsed: failed to fined a HW name for texture(%d)!", texture));918 crWarning("crStateSetTextureUsed: failed to fined a HW name for texture(%d)!", texture); 966 919 return; 967 920 } 968 921 } 969 922 970 923 if (used) 971 924 CR_STATE_SHAREDOBJ_USAGE_SET(tobj, g); … … 974 927 CRStateBits *sb = GetCurrentBits(); 975 928 CRTextureBits *tb = &(sb->texture); 976 929 CRTextureState *t = &(g->texture); 977 930 978 931 crStateCleanupTextureRefs(g, tobj); 979 932 980 crStateReleaseTexture(g, tobj); 933 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(tobj)) 934 { 935 /* on the host side, we need to delete an ogl texture object here as well, which crStateDeleteTextureCallback will do 936 * in addition to calling crStateDeleteTextureObject to delete a state object */ 937 crHashtableDelete(g->shared->textureTable, texture, crStateDeleteTextureCallback); 938 } 981 939 982 940 DIRTY(tb->dirty, g->neg_bitid); 983 941 DIRTY(tb->current[t->curTextureUnit], g->neg_bitid); 984 942 } 985 943 } 986 944 … … 3386 3344 else 3387 3345 { 3388 3346 Assert(!tobj); 3389 3347 } 3390 3348 if (tobj) 3391 3349 { 3392 //crDebug("tex id(%d), hwid(%d)", tobj->id, tobj->hwid);3350 crDebug("tex id(%d), hwid(%d)", tobj->id, tobj->hwid); 3393 3351 } 3394 3352 #endif 3395 3353 3396 3354 3397 3355 return tobj ? crStateGetTextureObjHWID(tobj) : 0; 3398 3356 } … … 3403 3361 3404 3362 #ifndef IN_GUEST 3405 3363 if (tobj->id && !tobj->hwid) 3406 3364 { 3407 3365 CRASSERT(diff_api.GenTextures); 3408 3366 diff_api.GenTextures(1, &tobj->hwid); 3409 #if 0 //def DEBUG_misha3367 #ifdef DEBUG_misha 3410 3368 crDebug("tex id(%d), hwid(%d)", tobj->id, tobj->hwid); 3411 3369 #endif 3412 3370 CRASSERT(tobj->hwid); 3413 3371 } 3414 3372 #endif 3415 3373 -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/util/error.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/util/error.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/util/error.c
old new 174 174 #if !defined(IN_GUEST) || defined(CR_DEBUG_BACKDOOR_ENABLE) 175 175 #include <VBox/log.h> 176 176 #endif 177 177 178 178 #if defined(WINDOWS) 179 179 # define CR_DEBUG_CONSOLE_ENABLE 180 181 # include "Shlwapi.h"182 180 #endif 183 181 184 182 #if defined(WINDOWS) && defined(IN_GUEST) 185 183 # ifndef CR_DEBUG_BACKDOOR_ENABLE 186 184 # error "CR_DEBUG_BACKDOOR_ENABLE is expected!" 187 185 # endif … … 458 456 { 459 457 VBoxDispMpLoggerLog(pcszStr); 460 458 } 461 459 #endif 462 460 463 461 464 #if defined( WINDOWS) /* && (!defined(DEBUG_misha) || !defined(IN_GUEST) ) */462 #if defined(DEBUG) && defined(WINDOWS) /* && (!defined(DEBUG_misha) || !defined(IN_GUEST) ) */ 465 463 # define CR_DEBUG_DBGPRINT_ENABLE 466 464 #endif 467 465 468 466 #ifdef CR_DEBUG_DBGPRINT_ENABLE 469 467 static void crDebugDbgPrint(const char *str) 470 468 { 471 469 OutputDebugString(str); 472 470 OutputDebugString("\n"); 473 471 } 474 475 static void crDebugDbgPrintF(const char * szString, ...)476 {477 char szBuffer[4096] = {0};478 va_list pArgList;479 va_start(pArgList, szString);480 vsprintf( szBuffer, szString, pArgList );481 va_end(pArgList);482 483 OutputDebugStringA(szBuffer);484 }485 486 static void crDebugDmlPrint(const char* pszDesc, const char* pszCmd)487 {488 crDebugDbgPrintF("<?dml?><exec cmd=\"%s\">%s</exec>, ( %s )\n", pszCmd, pszDesc, pszCmd);489 }490 491 492 DECLEXPORT(void) crDbgCmdPrint(const char *description1, const char *description2, const char *cmd, ...)493 {494 va_list args;495 char aTxt[8092];496 char aCmd[8092];497 498 sprintf( aTxt, "%s%s", description1, description2 );499 500 va_start( args, cmd );501 502 vsprintf( aCmd, cmd, args );503 504 va_end( args );505 506 crDebugDmlPrint(aTxt, aCmd);507 508 crDebug("%s: %s", aTxt, aCmd);509 }510 511 DECLEXPORT(void) crDbgCmdSymLoadPrint(const char *modName, const void*pvAddress)512 {513 static bool fEnable = false;514 static bool fInitialized = false;515 const char * pszName;516 static const char * pszModulePath = NULL;517 518 if (!fInitialized)519 {520 #ifndef DEBUG_misha521 if (crGetenv( "CR_DEBUG_MODULE_ENABLE" ))522 #endif523 {524 fEnable = true;525 }526 527 fInitialized = true;528 }529 530 if (!fEnable)531 return;532 533 pszName = PathFindFileNameA(modName);534 535 if (!pszModulePath)536 pszModulePath = crGetenv("CR_DEBUG_MODULE_PATH");537 if (!pszModulePath)538 pszModulePath = "c:\\Users\\senmk\\Downloads\\Data\\Data";539 540 crDbgCmdPrint("load modules for ", pszName, ".reload /i /f %s\\%s=%#p", pszModulePath, pszName, pvAddress);541 }542 543 472 #endif 544 473 545 474 DECLEXPORT(void) crDebug(const char *format, ... ) 546 475 { 547 476 va_list args; 548 477 static char txt[8092]; -
VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/util/sortarray.cpp
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/util/sortarray.cpp /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/GuestHost//OpenGL/util/sortarray.cpp
old new 1 /* $Id: sortarray.cpp $ */2 3 /** @file4 * Sorted array impl5 */6 7 /*8 * Copyright (C) 2014 Oracle Corporation9 *10 * This file is part of VirtualBox Open Source Edition (OSE), as11 * available from http://www.virtualbox.org. This file is free software;12 * you can redistribute it and/or modify it under the terms of the GNU13 * General Public License (GPL) as published by the Free Software14 * Foundation, in version 2 as it comes in the "COPYING" file of the15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.17 */18 19 #include <cr_sortarray.h>20 #include <cr_error.h>21 #include <iprt/err.h>22 #include <iprt/mem.h>23 24 #include <memory.h>25 26 VBOXSADECL(int) CrSaInit(CR_SORTARRAY *pArray, uint32_t cInitBuffer)27 {28 pArray->cBufferSize = cInitBuffer;29 pArray->cSize = 0;30 if (cInitBuffer)31 {32 pArray->pElements = (uint64_t*)RTMemAlloc(cInitBuffer * sizeof (pArray->pElements[0]));33 if (!pArray->pElements)34 {35 WARN(("no memory"));36 /* sanity */37 pArray->cBufferSize = 0;38 return VERR_NO_MEMORY;39 }40 }41 else42 pArray->pElements = NULL;43 44 return VINF_SUCCESS;45 }46 47 VBOXSADECL(void) CrSaCleanup(CR_SORTARRAY *pArray)48 {49 if (pArray->pElements)50 RTMemFree(pArray->pElements);51 52 CrSaInit(pArray, 0);53 }54 55 static int crSaSearch(const CR_SORTARRAY *pArray, uint64_t element)56 {57 int iMin = 0;58 int iMax = pArray->cSize;59 int i = 0;60 61 while (iMin < iMax)62 {63 i = (iMax + iMin) / 2;64 65 uint64_t el = pArray->pElements[i];66 if (el == element)67 return i;68 else if (el < element)69 iMin = i + 1;70 else71 iMax = i;72 }73 74 return -1;75 }76 77 static void crSaDbgValidate(const CR_SORTARRAY *pArray)78 {79 Assert(pArray->cSize <= pArray->cBufferSize);80 Assert(!pArray->pElements == !pArray->cBufferSize);81 if (!pArray->cSize)82 return;83 uint64_t cur = pArray->pElements[0];84 for (uint32_t i = 1; i < pArray->cSize; ++i)85 {86 Assert(pArray->pElements[i] > cur);87 cur = pArray->pElements[i];88 }89 }90 91 #ifdef DEBUG92 # define crSaValidate crSaDbgValidate93 #else94 # define crSaValidate(_a) do {} while (0)95 #endif96 97 static int crSaInsAt(CR_SORTARRAY *pArray, uint32_t iPos, uint64_t element)98 {99 if (pArray->cSize == pArray->cBufferSize)100 {101 uint32_t cNewBufferSize = pArray->cBufferSize + 16;102 uint64_t *pNew;103 if (pArray->pElements)104 pNew = (uint64_t*)RTMemRealloc(pArray->pElements, cNewBufferSize * sizeof (pArray->pElements[0]));105 else106 pNew = (uint64_t*)RTMemAlloc(cNewBufferSize * sizeof (pArray->pElements[0]));107 if (!pNew)108 {109 WARN(("no memory"));110 return VERR_NO_MEMORY;111 }112 113 pArray->pElements = pNew;114 pArray->cBufferSize = cNewBufferSize;115 crSaValidate(pArray);116 }117 118 for (int32_t i = (int32_t)pArray->cSize - 1; i >= (int32_t)iPos; --i)119 {120 pArray->pElements[i+1] = pArray->pElements[i];121 }122 123 pArray->pElements[iPos] = element;124 ++pArray->cSize;125 126 crSaValidate(pArray);127 128 return VINF_SUCCESS;129 }130 131 static void crSaDelAt(CR_SORTARRAY *pArray, uint32_t iPos)132 {133 Assert(pArray->cSize > iPos);134 135 for (uint32_t i = iPos; i < pArray->cSize - 1; ++i)136 {137 pArray->pElements[i] = pArray->pElements[i+1];138 }139 140 --pArray->cSize;141 }142 143 static int crSaAdd(CR_SORTARRAY *pArray, uint64_t element)144 {145 int iMin = 0;146 int iMax = pArray->cSize;147 int i = 0;148 uint64_t el;149 150 if (!iMax)151 return crSaInsAt(pArray, 0, element);152 153 while (iMin < iMax)154 {155 i = (iMax + iMin) / 2;156 157 el = pArray->pElements[i];158 if (el == element)159 return VINF_ALREADY_INITIALIZED;160 else if (el < element)161 iMin = i + 1;162 else163 iMax = i;164 }165 166 if (el < element)167 return crSaInsAt(pArray, i+1, element);168 return crSaInsAt(pArray, i, element);169 }170 171 static int crSaRemove(CR_SORTARRAY *pArray, uint64_t element)172 {173 int i = crSaSearch(pArray, element);174 if (i >= 0)175 {176 crSaDelAt(pArray, i);177 return VINF_SUCCESS;178 }179 return VINF_ALREADY_INITIALIZED;180 }181 182 /*183 * * @return true if element is found */184 VBOXSADECL(bool) CrSaContains(const CR_SORTARRAY *pArray, uint64_t element)185 {186 return crSaSearch(pArray, element) >= 0;187 }188 189 VBOXSADECL(int) CrSaAdd(CR_SORTARRAY *pArray, uint64_t element)190 {191 return crSaAdd(pArray, element);192 }193 194 VBOXSADECL(int) CrSaRemove(CR_SORTARRAY *pArray, uint64_t element)195 {196 return crSaRemove(pArray, element);197 }198 199 static int crSaIntersected(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2, CR_SORTARRAY *pResult)200 {201 int rc = VINF_SUCCESS;202 CrSaClear(pResult);203 204 for (uint32_t i = 0, j = 0; i < pArray1->cSize && j < pArray2->cSize; )205 {206 if (pArray1->pElements[i] == pArray2->pElements[j])207 {208 rc = CrSaAdd(pResult, pArray1->pElements[i]);209 if (rc < 0)210 {211 WARN(("CrSaAdd failed"));212 return rc;213 }214 215 ++i;216 ++j;217 }218 else if (pArray1->pElements[i] < pArray2->pElements[j])219 {220 ++i;221 }222 else223 {224 ++j;225 }226 }227 228 return VINF_SUCCESS;229 }230 231 static void crSaIntersect(CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2)232 {233 for (uint32_t i = 0, j = 0; i < pArray1->cSize && j < pArray2->cSize; )234 {235 if (pArray1->pElements[i] == pArray2->pElements[j])236 {237 ++i;238 ++j;239 }240 else if (pArray1->pElements[i] < pArray2->pElements[j])241 crSaDelAt(pArray1, i);242 else243 ++j;244 }245 }246 247 /*248 * @return >= 0 success249 * < 0 - no memory250 * */251 VBOXSADECL(void) CrSaIntersect(CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2)252 {253 crSaIntersect(pArray1, pArray2);254 }255 256 VBOXSADECL(int) CrSaIntersected(CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2, CR_SORTARRAY *pResult)257 {258 return crSaIntersected(pArray1, pArray2, pResult);259 }260 261 static int crSaUnited(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2, CR_SORTARRAY *pResult)262 {263 int rc = VINF_SUCCESS;264 CrSaClear(pResult);265 266 uint32_t i = 0, j = 0;267 uint32_t cResult = 0;268 while (i < pArray1->cSize && j < pArray2->cSize)269 {270 uint64_t element;271 if (pArray1->pElements[i] == pArray2->pElements[j])272 {273 element = pArray1->pElements[i];274 ++i;275 ++j;276 }277 else if (pArray1->pElements[i] < pArray2->pElements[j])278 {279 element = pArray1->pElements[i];280 ++i;281 }282 else283 {284 element = pArray1->pElements[j];285 ++j;286 }287 288 rc = crSaInsAt(pResult, cResult++, element);289 if (rc < 0)290 {291 WARN(("crSaInsAt failed"));292 return rc;293 }294 }295 296 uint32_t iTail;297 const CR_SORTARRAY *pTail;298 299 if (i < pArray1->cSize)300 {301 iTail = i;302 pTail = pArray1;303 }304 else if (j < pArray2->cSize)305 {306 iTail = j;307 pTail = pArray2;308 }309 else310 {311 iTail = 0;312 pTail = 0;313 }314 315 if (pTail)316 {317 for (;iTail < pTail->cSize; ++iTail)318 {319 rc = crSaInsAt(pResult, cResult++, pTail->pElements[iTail]);320 if (rc < 0)321 {322 WARN(("crSaInsAt failed"));323 return rc;324 }325 }326 }327 328 return VINF_SUCCESS;329 }330 331 VBOXSADECL(int) CrSaUnited(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2, CR_SORTARRAY *pResult)332 {333 return crSaUnited(pArray1, pArray2, pResult);334 }335 336 static int crSaClone(const CR_SORTARRAY *pArray1, CR_SORTARRAY *pResult)337 {338 int rc = 0;339 CrSaClear(pResult);340 341 if (pArray1->cSize > pResult->cBufferSize)342 {343 CrSaCleanup(pResult);344 uint32_t cNewBufferSize = pArray1->cSize;345 uint64_t *pNew = (uint64_t*)RTMemAlloc(cNewBufferSize * sizeof (pResult->pElements[0]));346 if (!pNew)347 {348 WARN(("no memory"));349 return VERR_NO_MEMORY;350 }351 352 pResult->pElements = pNew;353 pResult->cBufferSize = cNewBufferSize;354 crSaValidate(pResult);355 }356 357 pResult->cSize = pArray1->cSize;358 memcpy(pResult->pElements, pArray1->pElements, pArray1->cSize * sizeof (pArray1->pElements[0]));359 return VINF_SUCCESS;360 }361 362 /*363 * @return VINF_SUCCESS on success364 * VERR_NO_MEMORY - no memory365 * */366 VBOXSADECL(int) CrSaClone(const CR_SORTARRAY *pArray1, CR_SORTARRAY *pResult)367 {368 return crSaClone(pArray1, pResult);369 }370 371 static int crSaCmp(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2)372 {373 int diff = CrSaGetSize(pArray1) - CrSaGetSize(pArray2);374 if (diff)375 return diff;376 377 return memcmp(pArray1->pElements, pArray2->pElements, pArray1->cSize * sizeof (pArray1->pElements[0]));378 }379 380 VBOXSADECL(int) CrSaCmp(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2)381 {382 return crSaCmp(pArray1, pArray2);383 }384 385 static bool crSaCovers(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2)386 {387 if (CrSaGetSize(pArray1) < CrSaGetSize(pArray2))388 return false;389 390 uint32_t i = 0, j = 0;391 while (j < pArray2->cSize)392 {393 if (i == pArray1->cSize)394 return false;395 396 if (pArray1->pElements[i] == pArray2->pElements[j])397 {398 ++i;399 ++j;400 }401 else if (pArray1->pElements[i] < pArray2->pElements[j])402 ++i;403 else404 return false;405 }406 407 return true;408 }409 410 VBOXSADECL(bool) CrSaCovers(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2)411 {412 return crSaCovers(pArray1, pArray2);413 }414 -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserver/crservice.cpp
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserver/crservice.cpp /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserver/crservice.cpp
old new 948 948 g_pConsole = pConsole; 949 949 g_u32ScreenCount = monitorCount; 950 950 951 951 rc = crVBoxServerSetScreenCount(monitorCount); 952 952 AssertRCReturn(rc, rc); 953 953 954 #if 1 954 955 955 crServerVBoxCompositionSetEnableStateGlobal(GL_FALSE); 956 956 957 957 for (i=0; i<monitorCount; ++i) 958 958 { 959 959 CHECK_ERROR_RET(pDisplay, QueryFramebuffer(i, pFramebuffer.asOutParam()), rc); 960 960 … … 975 975 rc = crVBoxServerMapScreen(i, xo, yo, w, h, winId); 976 976 AssertRCReturn(rc, rc); 977 977 } 978 978 } 979 979 980 980 crServerVBoxCompositionSetEnableStateGlobal(GL_TRUE); 981 #endif982 981 983 982 rc = VINF_SUCCESS; 984 983 } 985 984 } 986 985 break; 987 986 } … … 1429 1428 if ((cbCtl - sizeof (VBOXCRCMDCTL)) % sizeof(VBOXHGCMSVCPARM)) 1430 1429 { 1431 1430 WARN(("invalid param size")); 1432 1431 return VERR_INVALID_PARAMETER; 1433 1432 } 1434 1433 uint32_t cParams = (cbCtl - sizeof (VBOXCRCMDCTL)) / sizeof (VBOXHGCMSVCPARM); 1435 bool fHasCallout = VBOXCRCMDCTL_IS_CALLOUT_AVAILABLE(pCtl); 1436 if (fHasCallout) 1437 crVBoxServerCalloutEnable(pCtl); 1438 1439 int rc = svcHostCallPerform(pCtl->u32Function, cParams, (VBOXHGCMSVCPARM*)(pCtl + 1)); 1440 1441 if (fHasCallout) 1442 crVBoxServerCalloutDisable(); 1443 1444 return rc; 1434 return svcHostCallPerform(pCtl->u32Function, cParams, (VBOXHGCMSVCPARM*)(pCtl + 1)); 1445 1435 } 1446 1436 1447 1437 static DECLCALLBACK(int) svcHostCall(void *, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 1448 1438 { 1449 1439 switch (u32Function) 1450 1440 { -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/presenter/server_presenter.cpp
Binary files vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/get_sizes.pyc and /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/get_sizes.pyc differ diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/presenter/server_presenter.cpp /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/presenter/server_presenter.cpp
old new 30 30 31 31 #define PCR_FBTEX_FROM_TEX(_pTex) ((CR_FBTEX*)((uint8_t*)(_pTex) - RT_OFFSETOF(CR_FBTEX, Tex))) 32 32 #define PCR_FRAMEBUFFER_FROM_COMPOSITOR(_pCompositor) ((CR_FRAMEBUFFER*)((uint8_t*)(_pCompositor) - RT_OFFSETOF(CR_FRAMEBUFFER, Compositor))) 33 33 #define PCR_FBENTRY_FROM_ENTRY(_pEntry) ((CR_FRAMEBUFFER_ENTRY*)((uint8_t*)(_pEntry) - RT_OFFSETOF(CR_FRAMEBUFFER_ENTRY, Entry))) 34 34 35 35 36 static int crPMgrFbConnectTargetDisplays(HCR_FRAMEBUFFER hFb, CR_FBDISPLAY_INFO *pDpInfo, uint32_t u32ModeAdd);37 38 36 CR_PRESENTER_GLOBALS g_CrPresenter; 39 37 40 38 /* FRAMEBUFFER */ 41 39 42 40 void CrFbInit(CR_FRAMEBUFFER *pFb, uint32_t idFb) 43 41 { … … 933 931 CRTextureObj *pTobj = pFbTex->pTobj; 934 932 935 933 CrTdBltDataCleanupNe(pTex); 936 934 937 935 if (pTobj) 938 936 { 937 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pTobj, cr_server.MainContextInfo.pContext); 938 939 939 crHashtableDelete(g_CrPresenter.pFbTexMap, pTobj->id, NULL); 940 940 941 crStateReleaseTexture(cr_server.MainContextInfo.pContext, pTobj); 941 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pTobj)) 942 { 943 CRSharedState *pShared = crStateGlobalSharedAcquire(); 942 944 945 CRASSERT(pShared); 946 /* on the host side, we need to delete an ogl texture object here as well, which crStateDeleteTextureCallback will do 947 * in addition to calling crStateDeleteTextureObject to delete a state object */ 948 crHashtableDelete(pShared->textureTable, pTobj->id, crStateDeleteTextureCallback); 943 949 944 crStateGlobalSharedRelease(); 950 crStateGlobalSharedRelease(); 951 } 952 953 crStateGlobalSharedRelease(); 945 954 } 946 955 947 956 crFbTexFree(pFbTex); 948 957 } 949 958 950 959 void CrFbTexDataInit(CR_TEXDATA* pFbTex, const VBOXVR_TEXTURE *pTex, PFNCRTEXDATA_RELEASED pfnTextureReleased) … … 3954 3963 } 3955 3964 3956 3965 const RTRECT *pRect = CrVrScrCompositorRectGet(&hFb->Compositor); 3957 3966 crServerDispatchVBoxTexPresent(hostId, idFb, 0, 0, 1, (const GLint*)pRect); 3958 3967 return 0; 3959 3968 } 3960 3961 typedef struct CRSERVER_CLIENT_CALLOUT3962 {3963 VBOXCRCMDCTL_CALLOUT_LISTENTRY Entry;3964 PFNVCRSERVER_CLIENT_CALLOUT_CB pfnCb;3965 void*pvCb;3966 } CRSERVER_CLIENT_CALLOUT;3967 3968 static DECLCALLBACK(void) crServerClientCalloutCb(struct VBOXCRCMDCTL_CALLOUT_LISTENTRY *pEntry)3969 {3970 CRSERVER_CLIENT_CALLOUT *pCallout = RT_FROM_MEMBER(pEntry, CRSERVER_CLIENT_CALLOUT, Entry);3971 pCallout->pfnCb(pCallout->pvCb);3972 int rc = RTSemEventSignal(cr_server.hCalloutCompletionEvent);3973 if (RT_FAILURE(rc))3974 WARN(("RTSemEventSignal failed rc %d", rc));3975 }3976 3977 static DECLCALLBACK(void) crServerClientCallout(PFNVCRSERVER_CLIENT_CALLOUT_CB pfnCb, void*pvCb)3978 {3979 Assert(cr_server.pCurrentCalloutCtl);3980 CRSERVER_CLIENT_CALLOUT Callout;3981 Callout.pfnCb = pfnCb;3982 Callout.pvCb = pvCb;3983 cr_server.ClientInfo.pfnCallout(cr_server.ClientInfo.hClient, cr_server.pCurrentCalloutCtl, &Callout.Entry, crServerClientCalloutCb);3984 3985 int rc = RTSemEventWait(cr_server.hCalloutCompletionEvent, RT_INDEFINITE_WAIT);3986 if (RT_FAILURE(rc))3987 WARN(("RTSemEventWait failed %d", rc));3988 }3989 3990 3991 DECLEXPORT(void) crVBoxServerCalloutEnable(VBOXCRCMDCTL *pCtl)3992 {3993 #if 1 //def CR_SERVER_WITH_CLIENT_CALLOUTS3994 Assert(!cr_server.pCurrentCalloutCtl);3995 cr_server.pCurrentCalloutCtl = pCtl;3996 3997 cr_server.head_spu->dispatch_table.ChromiumParametervCR(GL_HH_SET_CLIENT_CALLOUT, 0, 0, (void*)crServerClientCallout);3998 #endif3999 }4000 4001 extern DECLEXPORT(void) crVBoxServerCalloutDisable()4002 {4003 #if 1 //def CR_SERVER_WITH_CLIENT_CALLOUTS4004 Assert(cr_server.pCurrentCalloutCtl);4005 4006 cr_server.head_spu->dispatch_table.ChromiumParametervCR(GL_HH_SET_CLIENT_CALLOUT, 0, 0, NULL);4007 4008 cr_server.pCurrentCalloutCtl = NULL;4009 #endif4010 } -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server.h
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server.h
old new 416 416 int CrPMgrViewportUpdate(uint32_t idScreen); 417 417 int CrPMgrScreenChanged(uint32_t idScreen); 418 418 int CrPMgrResize(const struct VBVAINFOSCREEN *pScreen, void *pvVRAM, const uint32_t *pTargetMap); 419 419 int CrPMgrSaveState(PSSMHANDLE pSSM); 420 420 int CrPMgrLoadState(PSSMHANDLE pSSM, uint32_t version); 421 421 HCR_FRAMEBUFFER CrPMgrFbGet(uint32_t idScreen); 422 int CrPMgrClearRegionsGlobal();423 422 /*cleanup stuff*/ 424 423 425 424 426 425 int CrPMgrInit(); 427 426 void CrPMgrTerm(); 428 427 int CrPMgrDisable(); -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_lists.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_lists.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_lists.c
old new 66 66 crStateNewList( list, mode ); 67 67 cr_server.head_spu->dispatch_table.NewList( list, mode ); 68 68 } 69 69 70 70 static void crServerQueryHWState() 71 71 { 72 if (!cr_server.bUseMultipleContexts) 72 GLuint fbFbo, bbFbo; 73 CRClient *client = cr_server.curClient; 74 CRMuralInfo *mural = client ? client->currentMural : NULL; 75 if (mural && mural->fRedirected) 73 76 { 74 GLuint fbFbo, bbFbo; 75 CRClient *client = cr_server.curClient; 76 CRMuralInfo *mural = client ? client->currentMural : NULL; 77 if (mural && mural->fRedirected) 78 { 79 fbFbo = mural->aidFBOs[CR_SERVER_FBO_FB_IDX(mural)]; 80 bbFbo = mural->aidFBOs[CR_SERVER_FBO_BB_IDX(mural)]; 81 } 82 else 83 { 84 fbFbo = bbFbo = 0; 85 } 86 crStateQueryHWState(fbFbo, bbFbo); 77 fbFbo = mural->aidFBOs[CR_SERVER_FBO_FB_IDX(mural)]; 78 bbFbo = mural->aidFBOs[CR_SERVER_FBO_BB_IDX(mural)]; 87 79 } 80 else 81 { 82 fbFbo = bbFbo = 0; 83 } 84 crStateQueryHWState(fbFbo, bbFbo); 88 85 } 89 86 90 87 void SERVER_DISPATCH_APIENTRY crServerDispatchEndList(void) 91 88 { 92 89 CRContext *g = crStateGetCurrent(); 93 90 CRListsState *l = &(g->lists); -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_main.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_main.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_main.c
old new 280 280 281 281 crNetTearDown(); 282 282 283 283 VBoxVrListClear(&cr_server.RootVr); 284 284 285 285 VBoxVrTerm(); 286 287 RTSemEventDestroy(cr_server.hCalloutCompletionEvent);288 286 } 289 287 290 288 static void crServerClose( unsigned int id ) 291 289 { 292 290 crError( "Client disconnected!" ); 293 291 (void) id; … … 384 382 | _FPU_MASK_OM | _FPU_MASK_UM); 385 383 _FPU_SETCW(mask); 386 384 } 387 385 #endif 388 386 389 387 cr_server.fCrCmdEnabled = GL_FALSE; 390 cr_server.fProcessingPendedCommands = GL_FALSE;391 388 CrHTableCreate(&cr_server.clientTable, CR_MAX_CLIENTS); 392 389 393 390 cr_server.bUseMultipleContexts = (crGetenv( "CR_SERVER_ENABLE_MULTIPLE_CONTEXTS" ) != NULL); 394 391 395 392 if (cr_server.bUseMultipleContexts) 396 393 { … … 492 489 | _FPU_MASK_OM | _FPU_MASK_UM); 493 490 _FPU_SETCW(mask); 494 491 } 495 492 #endif 496 493 497 494 cr_server.fCrCmdEnabled = GL_FALSE; 498 cr_server.fProcessingPendedCommands = GL_FALSE;499 495 CrHTableCreate(&cr_server.clientTable, CR_MAX_CLIENTS); 500 496 501 497 cr_server.bUseMultipleContexts = (crGetenv( "CR_SERVER_ENABLE_MULTIPLE_CONTEXTS" ) != NULL); 502 498 503 499 if (cr_server.bUseMultipleContexts) 504 500 { … … 514 510 cr_server.bIsInLoadingState = GL_FALSE; 515 511 cr_server.bIsInSavingState = GL_FALSE; 516 512 cr_server.bForceMakeCurrentOnClientSwitch = GL_FALSE; 517 513 518 514 cr_server.pCleanupClient = NULL; 519 515 520 rc = RTSemEventCreate(&cr_server.hCalloutCompletionEvent);521 if (!RT_SUCCESS(rc))522 {523 WARN(("RTSemEventCreate failed %d", rc));524 return GL_FALSE;525 }526 527 516 /* 528 517 * Create default mural info and hash table. 529 518 */ 530 519 cr_server.muralTable = crAllocHashtable(); 531 520 defaultMural = (CRMuralInfo *) crCalloc(sizeof(CRMuralInfo)); 532 521 defaultMural->spuWindow = CR_RENDER_DEFAULT_WINDOW_ID; … … 3967 3956 PVBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP pSetup = (PVBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP)pCtl; 3968 3957 g_pvVRamBase = (uint8_t*)pSetup->pvVRamBase; 3969 3958 g_cbVRam = pSetup->cbVRam; 3970 3959 3971 3960 g_pLed = pSetup->pLed; 3972 3961 3973 cr_server.ClientInfo = pSetup->CrClientInfo;3974 3975 3962 pSetup->CrCmdServerInfo.hSvr = NULL; 3976 3963 pSetup->CrCmdServerInfo.pfnEnable = crVBoxCrCmdEnable; 3977 3964 pSetup->CrCmdServerInfo.pfnDisable = crVBoxCrCmdDisable; 3978 3965 pSetup->CrCmdServerInfo.pfnCmd = crVBoxCrCmdCmd; 3979 3966 pSetup->CrCmdServerInfo.pfnHostCtl = crVBoxCrCmdHostCtl; 3980 3967 pSetup->CrCmdServerInfo.pfnGuestCtl = crVBoxCrCmdGuestCtl; -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_misc.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_misc.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_misc.c
old new 7 7 #include "server_dispatch.h" 8 8 #include "server.h" 9 9 #include "cr_error.h" 10 10 #include "cr_mem.h" 11 11 #include "cr_string.h" 12 12 #include "cr_pixeldata.h" 13 #ifdef VBOX_WITH_CRDUMPER14 # include "cr_dump.h"15 #endif16 13 17 14 void SERVER_DISPATCH_APIENTRY crServerDispatchSelectBuffer( GLsizei size, GLuint *buffer ) 18 15 { 19 16 (void) size; 20 17 (void) buffer; 21 18 crError( "Unsupported network glSelectBuffer call." ); … … 79 76 else 80 77 { 81 78 crWarning("zero bytes for GL_DBG_CHECK_BREAK_CR"); 82 79 } 83 80 break; 84 81 } 85 case GL_HH_SET_DEFAULT_SHARED_CTX:86 WARN(("Recieved GL_HH_SET_DEFAULT_SHARED_CTX from guest, ignoring"));87 break;88 case GL_HH_SET_CLIENT_CALLOUT:89 WARN(("Recieved GL_HH_SET_CLIENT_CALLOUT from guest, ignoring"));90 break;91 82 default: 92 83 cr_server.head_spu->dispatch_table.GetChromiumParametervCR( target, index, type, count, local_storage ); 93 84 break; 94 85 } 95 86 96 87 crServerReturnValue( local_storage, bytes ); … … 297 288 break; 298 289 299 290 case GL_HH_SET_TMPCTX_MAKE_CURRENT: 300 291 /*we should not receive it from the guest! */ 301 292 break; 302 293 303 case GL_HH_SET_CLIENT_CALLOUT:304 WARN(("Recieved GL_HH_SET_CLIENT_CALLOUT from guest, ignoring"));305 break;306 307 294 default: 308 295 /* Pass the parameter info to the head SPU */ 309 296 cr_server.head_spu->dispatch_table.ChromiumParametervCR( target, type, count, values ); 310 297 break; 311 298 } 312 299 } … … 321 308 case GL_RCUSAGE_TEXTURE_SET_CR: 322 309 crStateSetTextureUsed(value, GL_TRUE); 323 310 break; 324 311 case GL_RCUSAGE_TEXTURE_CLEAR_CR: 325 312 crStateSetTextureUsed(value, GL_FALSE); 326 313 break; 327 case GL_PIN_TEXTURE_SET_CR:328 crStatePinTexture(value, GL_TRUE);329 break;330 case GL_PIN_TEXTURE_CLEAR_CR:331 crStatePinTexture(value, GL_FALSE);332 break;333 314 case GL_SHARED_DISPLAY_LISTS_CR: 334 315 cr_server.sharedDisplayLists = value; 335 316 break; 336 317 case GL_SHARED_TEXTURE_OBJECTS_CR: 337 318 cr_server.sharedTextureObjects = value; 338 319 break; … … 343 324 cr_server.currentEye = value ? 1 : 0; 344 325 break; 345 326 case GL_HOST_WND_CREATED_HIDDEN_CR: 346 327 cr_server.bWindowsInitiallyHidden = value ? 1 : 0; 347 328 break; 348 329 case GL_HH_SET_DEFAULT_SHARED_CTX: 349 WARN(("Recieved GL_HH_SET_DEFAULT_SHARED_CTX from guest, ignoring"));330 crWarning("Recieved GL_HH_SET_DEFAULT_SHARED_CTX from guest, ignoring"); 350 331 break; 351 332 case GL_HH_RENDERTHREAD_INFORM: 352 WARN(("Recieved GL_HH_RENDERTHREAD_INFORM from guest, ignoring"));333 crWarning("Recieved GL_HH_RENDERTHREAD_INFORM from guest, ignoring"); 353 334 break; 354 335 default: 355 336 /* Pass the parameter info to the head SPU */ 356 337 cr_server.head_spu->dispatch_table.ChromiumParameteriCR( target, value ); 357 338 } 358 339 } … … 1501 1482 1502 1483 } 1503 1484 1504 1485 /* dump stuff */ 1505 1486 #ifdef VBOX_WITH_CRSERVER_DUMPER 1506 1487 1507 # ifndef VBOX_WITH_CRDUMPER1508 # error "VBOX_WITH_CRDUMPER undefined!"1509 # endif1510 1511 1488 /* first four bits are buffer dump config 1512 1489 * second four bits are texture dump config 1513 1490 * config flags: 1514 1491 * 1 - blit on enter 1515 1492 * 2 - blit on exit 1516 1493 * … … 1708 1685 crRecDumpVertAttrv(&cr_server.Recorder, ctx, idx, pszElFormat, cbEl, pvVal, cVal); 1709 1686 } 1710 1687 1711 1688 void crServerDumpBuffer(int idx) 1712 1689 { 1713 1690 CRContextInfo *pCtxInfo = cr_server.currentCtxInfo; 1691 CR_BLITTER_WINDOW BltWin; 1692 CR_BLITTER_CONTEXT BltCtx; 1714 1693 CRContext *ctx = crStateGetCurrent(); 1715 1694 GLint idFBO; 1716 1695 GLint idTex; 1717 1696 VBOXVR_TEXTURE RedirTex; 1718 1697 int rc = crServerDumpCheckInit(); 1719 1698 idx = idx >= 0 ? idx : crServerMuralFBOIdxFromBufferName(cr_server.currentMural, pCtxInfo->pContext->buffer.drawBuffer); … … 1729 1708 return; 1730 1709 } 1731 1710 1732 1711 idFBO = CR_SERVER_FBO_FOR_IDX(cr_server.currentMural, idx); 1733 1712 idTex = CR_SERVER_FBO_TEX_FOR_IDX(cr_server.currentMural, idx); 1734 1713 1714 crServerVBoxBlitterWinInit(&BltWin, cr_server.currentMural); 1715 crServerVBoxBlitterCtxInit(&BltCtx, pCtxInfo); 1716 1735 1717 RedirTex.width = cr_server.currentMural->fboWidth; 1736 1718 RedirTex.height = cr_server.currentMural->fboHeight; 1737 1719 RedirTex.target = GL_TEXTURE_2D; 1738 1720 RedirTex.hwid = idTex; 1739 1721 1740 crRecDumpBuffer(&cr_server.Recorder, ctx, idFBO, idTex ? &RedirTex : NULL);1722 crRecDumpBuffer(&cr_server.Recorder, ctx, &BltCtx, &BltWin, idFBO, idTex ? &RedirTex : NULL); 1741 1723 } 1742 1724 1743 1725 void crServerDumpTexture(const VBOXVR_TEXTURE *pTex) 1744 1726 { 1745 1727 CRContextInfo *pCtxInfo = cr_server.currentCtxInfo; 1746 1728 CR_BLITTER_WINDOW BltWin; … … 1759 1741 crRecDumpTextureF(&cr_server.Recorder, pTex, &BltCtx, &BltWin, "Tex (%d x %d), hwid (%d) target %#x", pTex->width, pTex->height, pTex->hwid, pTex->target); 1760 1742 } 1761 1743 1762 1744 void crServerDumpTextures() 1763 1745 { 1764 1746 CRContextInfo *pCtxInfo = cr_server.currentCtxInfo; 1747 CR_BLITTER_WINDOW BltWin; 1748 CR_BLITTER_CONTEXT BltCtx; 1765 1749 CRContext *ctx = crStateGetCurrent(); 1766 1750 int rc = crServerDumpCheckInit(); 1767 1751 if (!RT_SUCCESS(rc)) 1768 1752 { 1769 1753 crWarning("crServerDumpCheckInit failed, rc %d", rc); 1770 1754 return; 1771 1755 } 1772 1756 1773 crRecDumpTextures(&cr_server.Recorder, ctx); 1757 crServerVBoxBlitterWinInit(&BltWin, cr_server.currentMural); 1758 crServerVBoxBlitterCtxInit(&BltCtx, pCtxInfo); 1759 1760 crRecDumpTextures(&cr_server.Recorder, ctx, &BltCtx, &BltWin); 1774 1761 } 1775 1762 1776 1763 void crServerDumpFilterOpLeave(unsigned long event, CR_DUMPER *pDumper) 1777 1764 { 1778 1765 if (CR_SERVER_DUMP_F_DRAW_LEAVE_ALL & event) 1779 1766 { -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_muralfbo.cpp
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_muralfbo.cpp /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_muralfbo.cpp
old new 116 116 { 117 117 GLuint j; 118 118 CR_FBDATA *pData = &mural->aFBDatas[i]; 119 119 if (!pData->hFb) 120 120 continue; 121 121 122 if (pData->hFbEntry != NULL) 123 { 124 CrFbEntryRelease(pData->hFb, pData->hFbEntry); 125 pData->hFbEntry = NULL; 126 } 122 CrFbEntryRelease(pData->hFb, pData->hFbEntry); 123 pData->hFbEntry = NULL; 127 124 128 125 for (j = 0; j < mural->cBuffers; ++j) 129 126 { 130 127 CrTdRelease(pData->apTexDatas[j]); 131 128 pData->apTexDatas[j] = NULL; 132 129 } … … 189 186 return VINF_SUCCESS; 190 187 191 188 pData = &mural->aFBDatas[pScreenInfo->u32ViewIndex]; 192 189 193 190 if (!pData->hFb) 194 191 { 195 /* Guard against modulo-by-zero when calling CrFbEntryCreateForTexData196 below. Observed when failing to load atig6pxx.dll and similar. */197 if (RT_UNLIKELY(mural->cBuffers == 0))198 {199 WARN(("crServerRedirMuralDbSyncFb: cBuffers == 0 (crServerSupportRedirMuralFBO=%d)", crServerSupportRedirMuralFBO()));200 return VERR_NOT_SUPPORTED;201 }202 203 192 pData->hFb = hFb; 204 193 205 194 for (uint32_t i = 0; i < mural->cBuffers; ++i) 206 195 { 207 196 VBOXVR_TEXTURE Tex; 208 197 Tex.width = mural->width; -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_retval.py
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_retval.py /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_retval.py
old new 17 17 #include "cr_net.h" 18 18 #include "server_dispatch.h" 19 19 #include "server.h" 20 20 21 21 void crServerReturnValue( const void *payload, unsigned int payload_len ) 22 22 { 23 if (!cr_server.fProcessingPendedCommands) 24 { 25 CRMessageReadback *rb; 26 int msg_len = sizeof( *rb ) + payload_len; 27 28 /* Don't reply to client if we're loading VM snapshot*/ 29 if (cr_server.bIsInLoadingState) 30 return; 31 32 if (cr_server.curClient->conn->type == CR_FILE) 33 { 34 return; 35 } 36 37 rb = (CRMessageReadback *) crAlloc( msg_len ); 38 39 rb->header.type = CR_MESSAGE_READBACK; 40 CRDBGPTR_PRINTRB(cr_server.curClient->conn->u32ClientID, &cr_server.writeback_ptr); 41 CRDBGPTR_CHECKNZ(&cr_server.writeback_ptr); 42 CRDBGPTR_CHECKNZ(&cr_server.return_ptr); 43 crMemcpy( &(rb->writeback_ptr), &(cr_server.writeback_ptr), sizeof( rb->writeback_ptr ) ); 44 crMemcpy( &(rb->readback_ptr), &(cr_server.return_ptr), sizeof( rb->readback_ptr ) ); 45 crMemcpy( rb+1, payload, payload_len ); 46 crNetSend( cr_server.curClient->conn, NULL, rb, msg_len ); 47 CRDBGPTR_SETZ(&cr_server.writeback_ptr); 48 CRDBGPTR_SETZ(&cr_server.return_ptr); 49 crFree( rb ); 23 CRMessageReadback *rb; 24 int msg_len = sizeof( *rb ) + payload_len; 25 26 /* Don't reply to client if we're loading VM snapshot*/ 27 if (cr_server.bIsInLoadingState) 28 return; 29 30 if (cr_server.curClient->conn->type == CR_FILE) 31 { 50 32 return; 51 33 } 52 #ifdef DEBUG_misha 53 WARN(("Pending command returns value")); 54 #endif 34 35 rb = (CRMessageReadback *) crAlloc( msg_len ); 36 37 rb->header.type = CR_MESSAGE_READBACK; 38 CRDBGPTR_PRINTRB(cr_server.curClient->conn->u32ClientID, &cr_server.writeback_ptr); 39 CRDBGPTR_CHECKNZ(&cr_server.writeback_ptr); 40 CRDBGPTR_CHECKNZ(&cr_server.return_ptr); 41 crMemcpy( &(rb->writeback_ptr), &(cr_server.writeback_ptr), sizeof( rb->writeback_ptr ) ); 42 crMemcpy( &(rb->readback_ptr), &(cr_server.return_ptr), sizeof( rb->readback_ptr ) ); 43 crMemcpy( rb+1, payload, payload_len ); 44 crNetSend( cr_server.curClient->conn, NULL, rb, msg_len ); 55 45 CRDBGPTR_SETZ(&cr_server.writeback_ptr); 56 46 CRDBGPTR_SETZ(&cr_server.return_ptr); 47 crFree( rb ); 57 48 } 58 49 """ 59 50 60 51 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") 61 52 62 53 for func_name in keys: -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_stream.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_stream.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_stream.c
old new 547 547 return VINF_SUCCESS; 548 548 } 549 549 550 550 static void crServerPendProcess(CRConnection *conn) 551 551 { 552 552 CR_SERVER_PENDING_MSG *pIter, *pNext; 553 554 cr_server.fProcessingPendedCommands = GL_TRUE;555 556 553 RTListForEachSafe(&conn->PendingMsgList, pIter, pNext, CR_SERVER_PENDING_MSG, Node) 557 554 { 558 555 CRMessage *msg = &pIter->Msg; 559 556 const CRMessageOpcodes *msg_opcodes; 560 557 int opcodeBytes; 561 558 const char *data_ptr; … … 573 570 data_ptr - 1, /* first command's opcode */ 574 571 msg_opcodes->numOpcodes, /* how many opcodes */ 575 572 &(cr_server.dispatch)); /* the CR dispatch table */ 576 573 577 574 RTMemFree(pIter); 578 575 } 579 580 cr_server.fProcessingPendedCommands = GL_FALSE;581 576 } 582 577 583 578 /** 584 579 * This function takes the given message (which should be a buffer of 585 580 * rendering commands) and executes it. 586 581 */ … … 651 646 else 652 647 WARN(("Pend List is NOT empty, drain the current list, and ignore this command")); 653 648 654 649 crServerPendProcess(conn); 655 650 break; 656 651 } 657 case CR_UNPACK_BUFFER_TYPE_CMDBLOCK_FLUSH: /* just flush for now */658 {659 CrPMgrClearRegionsGlobal(); /* clear regions to ensure we don't do MakeCurrent and friends */660 crServerPendProcess(conn);661 Assert(RTListIsEmpty(&conn->PendingMsgList));662 break;663 }664 652 case CR_UNPACK_BUFFER_TYPE_CMDBLOCK_END: 665 653 { 666 //CRASSERT(!RTListIsEmpty(&conn->PendingMsgList));654 CRASSERT(!RTListIsEmpty(&conn->PendingMsgList)); 667 655 crServerPendProcess(conn); 668 656 Assert(RTListIsEmpty(&conn->PendingMsgList)); 669 657 break; 670 658 } 671 659 default: 672 660 WARN(("unsupported buffer type")); -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_window.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_window.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/crserverlib/server_window.c
old new 32 32 if (cr_server.fVisualBitsDefault) 33 33 realVisBits = cr_server.fVisualBitsDefault; 34 34 35 35 #ifdef RT_OS_DARWIN 36 36 if (fGuestWindow) 37 37 { 38 CRMuralInfo *dummy = crServerGetDummyMural( realVisBits);38 CRMuralInfo *dummy = crServerGetDummyMural(visBits); 39 39 if (!dummy) 40 40 { 41 41 WARN(("crServerGetDummyMural failed")); 42 42 return -1; 43 43 } 44 44 spuWindow = dummy->spuWindow; 45 45 mural->fIsDummyRefference = GL_TRUE; 46 47 dims[0] = dummy->width;48 dims[1] = dummy->height;49 46 } 50 47 else 51 48 #endif 52 49 { 53 50 /* 54 51 * Have first SPU make a new window. 55 52 */ 56 53 spuWindow = cr_server.head_spu->dispatch_table.WindowCreate( dpyName, realVisBits ); 57 54 if (spuWindow < 0) { 58 55 return spuWindow; 59 56 } 60 57 mural->fIsDummyRefference = GL_FALSE; 61 62 /* get initial window size */63 cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, spuWindow, GL_INT, 2, dims);64 58 } 65 59 60 /* get initial window size */ 61 cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, spuWindow, GL_INT, 2, dims); 62 66 63 defaultMural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, 0); 67 64 CRASSERT(defaultMural); 68 65 mural->gX = 0; 69 66 mural->gY = 0; 70 67 mural->width = dims[0]; 71 68 mural->height = dims[1]; -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/Makefile.kmk
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/Makefile.kmk /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/Makefile.kmk
old new 1 1 # $Id: Makefile.kmk $ 2 2 ## @file 3 3 # Sub-Makefile for the Shared OpenGL Host Service. 4 4 # 5 5 6 6 # 7 # Copyright (C) 2008-201 4Oracle Corporation7 # Copyright (C) 2008-2012 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as 10 10 # available from http://www.virtualbox.org. This file is free software; 11 11 # you can redistribute it and/or modify it under the terms of the GNU 12 12 # General Public License (GPL) as published by the Free Software 13 13 # Foundation, in version 2 as it comes in the "COPYING" file of the … … 371 371 render/VBoxOGLrenderspu.rc 372 372 VBoxOGLrenderspu_SOURCES.linux = render/renderspu_glx.c 373 373 VBoxOGLrenderspu_SOURCES.solaris = render/renderspu_glx.c 374 374 VBoxOGLrenderspu_SOURCES.freebsd = render/renderspu_glx.c 375 375 VBoxOGLrenderspu_OBJCFLAGS.darwin = -Wno-shadow 376 376 VBoxOGLrenderspu_SOURCES.darwin = \ 377 OpenGLTest/OpenGLTestDarwin.cpp \378 377 render/renderspu_cocoa.c \ 379 378 render/renderspu_cocoa_helper.m 380 379 ifdef VBOX_WITH_CRHGSMI 381 380 VBoxOGLrenderspu_DEFS += VBOX_WITH_CRHGSMI 382 381 endif 383 382 ifdef VBOX_WITH_VDMA 384 383 VBoxOGLrenderspu_DEFS += VBOX_WITH_VDMA 385 384 endif 386 VBoxOGLrenderspu_LDFLAGS.darwin += -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxOGLrenderspu.dylib -framework IOKit385 VBoxOGLrenderspu_LDFLAGS.darwin += -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxOGLrenderspu.dylib 387 386 VBoxOGLrenderspu_LIBS = \ 388 387 $(PATH_STAGE_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \ 389 388 $(VBOX_LIB_OGL_HOSTCRUTIL) \ 390 389 $(LIB_RUNTIME) 391 390 if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # the X11 gang 392 391 VBoxOGLrenderspu_LIBS += \ -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/render/renderspu.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/render/renderspu.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/render/renderspu.c
old new 312 312 313 313 crHashtableDelete(render_spu.contextTable, ctx, NULL); 314 314 315 315 renderspuContextMarkDeletedAndRelease(context); 316 316 } 317 317 318 WindowInfo* renderspuWinCreate(GLint visBits, GLint id)319 {320 WindowInfo* window = (WindowInfo *)crAlloc(sizeof (*window));321 if (!window)322 {323 crWarning("crAlloc failed");324 return NULL;325 }326 327 if (!renderspuWinInit(window, NULL, visBits, id))328 {329 crWarning("renderspuWinInit failed");330 crFree(window);331 return NULL;332 }333 334 return window;335 }336 337 void renderspuWinTermOnShutdown(WindowInfo *window)338 {339 renderspuVBoxCompositorSet(window, NULL);340 renderspuVBoxPresentBlitterCleanup(window);341 window->BltInfo.Base.id = -1;342 renderspu_SystemDestroyWindow( window );343 }344 345 static void renderspuCheckCurrentCtxWindowCB(unsigned long key, void *data1, void *data2)346 {347 ContextInfo *pCtx = (ContextInfo *) data1;348 WindowInfo *pWindow = data2;349 (void) key;350 351 if (pCtx->currentWindow==pWindow)352 {353 WindowInfo* pDummy = renderspuGetDummyWindow(pCtx->BltInfo.Base.visualBits);354 if (pDummy)355 {356 renderspuPerformMakeCurrent(pDummy, 0, pCtx);357 }358 else359 {360 crWarning("failed to get dummy window");361 renderspuMakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, pCtx->BltInfo.Base.id);362 }363 }364 }365 366 void renderspuWinTerm( WindowInfo *window )367 {368 if (!renderspuWinIsTermed(window))369 {370 371 GET_CONTEXT(pOldCtx);372 WindowInfo * pOldWindow = pOldCtx ? pOldCtx->currentWindow : NULL;373 CRASSERT(!pOldCtx == !pOldWindow);374 /* ensure no concurrent draws can take place */375 renderspuWinTermOnShutdown(window);376 /* check if this window is bound to some ctx. Note: window pointer is already freed here */377 crHashtableWalk(render_spu.contextTable, renderspuCheckCurrentCtxWindowCB, window);378 /* restore current context */379 {380 GET_CONTEXT(pNewCtx);381 WindowInfo * pNewWindow = pNewCtx ? pNewCtx->currentWindow : NULL;382 CRASSERT(!pNewCtx == !pNewWindow);383 384 if (pOldWindow == window)385 renderspuMakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, CR_RENDER_DEFAULT_CONTEXT_ID);386 else if (pNewCtx != pOldCtx || pOldWindow != pNewWindow)387 {388 if (pOldCtx)389 renderspuPerformMakeCurrent(pOldWindow, 0, pOldCtx);390 else391 renderspuMakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, CR_RENDER_DEFAULT_CONTEXT_ID);392 }393 }394 395 }396 }397 398 void renderspuWinCleanup(WindowInfo *window)399 {400 renderspuWinTerm( window );401 RTCritSectDelete(&window->CompositorLock);402 }403 404 void renderspuWinDestroy(WindowInfo *window)405 {406 renderspuWinCleanup(window);407 crFree(window);408 }409 410 318 WindowInfo* renderspuGetDummyWindow(GLint visBits) 411 319 { 412 320 WindowInfo *window = (WindowInfo *) crHashtableSearch(render_spu.dummyWindowTable, visBits); 413 321 if (!window) 414 322 { 415 window = renderspuWinCreate(visBits, -1);323 window = (WindowInfo *)crAlloc(sizeof (*window)); 416 324 if (!window) 417 325 { 418 WARN(("renderspuWinCreate failed")); 326 crWarning("crAlloc failed"); 327 return NULL; 328 } 329 330 if (!renderspuWindowInit(window, NULL, visBits, -1)) 331 { 332 crWarning("renderspuWindowInit failed"); 333 crFree(window); 419 334 return NULL; 420 335 } 421 336 422 337 crHashtableAdd(render_spu.dummyWindowTable, visBits, window); 423 338 } 424 339 … … 527 442 return; 528 443 } 529 444 530 445 renderspuPerformMakeCurrent(window, nativeWindow, context); 531 446 } 532 447 533 GLboolean renderspuWin InitWithVisual( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id )448 GLboolean renderspuWindowInitWithVisual( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id ) 534 449 { 535 450 crMemset(window, 0, sizeof (*window)); 536 451 RTCritSectInit(&window->CompositorLock); 537 452 window->pCompositor = NULL; 538 453 539 454 window->BltInfo.Base.id = id; … … 562 477 window->title = crStrdup(render_spu.window_title); 563 478 } 564 479 } 565 480 566 481 window->BltInfo.Base.visualBits = visual->visAttribs; 567 482 568 window->cRefs = 1;569 483 570 484 /* 571 485 crDebug("Render SPU: Creating window (visBits=0x%x, id=%d)", visBits, window->BltInfo.Base.id); 572 486 */ 573 487 /* Have GLX/WGL/AGL create the window */ 574 488 if (!renderspu_SystemVBoxCreateWindow( visual, showIt, window )) … … 583 497 return GL_TRUE; 584 498 } 585 499 586 500 /* 587 501 * Window functions 588 502 */ 589 GLboolean renderspuWin Init(WindowInfo *pWindow, const char *dpyName, GLint visBits, GLint id)503 GLboolean renderspuWindowInit(WindowInfo *pWindow, const char *dpyName, GLint visBits, GLint id) 590 504 { 591 505 VisualInfo *visual; 592 506 593 507 crMemset(pWindow, 0, sizeof (*pWindow)); 594 508 595 509 if (!dpyName || crStrlen(render_spu.display_string) > 0) … … 603 517 } 604 518 605 519 /* 606 520 crDebug("Render SPU: Creating window (visBits=0x%x, id=%d)", visBits, window->BltInfo.Base.id); 607 521 */ 608 522 /* Have GLX/WGL/AGL create the window */ 609 if (!renderspuWin InitWithVisual( pWindow, visual, 0, id ))523 if (!renderspuWindowInitWithVisual( pWindow, visual, 0, id )) 610 524 { 611 525 crWarning( "Render SPU: Couldn't create a window, renderspu_SystemCreateWindow failed" ); 612 526 return GL_FALSE; 613 527 } 614 528 615 529 return GL_TRUE; … … 635 549 crWarning("the specified window key %d is in use", id); 636 550 return -1; 637 551 } 638 552 } 639 553 640 554 /* Allocate WindowInfo */ 641 window = renderspuWinCreate(visBits, id); 642 555 window = (WindowInfo *) crCalloc(sizeof(WindowInfo)); 643 556 if (!window) 644 557 { 645 crWarning("renderspuWinCreate failed"); 558 crWarning( "Render SPU: Couldn't create a window" ); 559 return -1; 560 } 561 562 if (!renderspuWindowInit(window, dpyName, visBits, id)) 563 { 564 crWarning("renderspuWindowInit failed"); 646 565 crFree(window); 647 566 return -1; 648 567 } 649 568 650 569 crHashtableAdd(render_spu.windowTable, id, window); 651 570 return window->BltInfo.Base.id; … … 654 573 GLint RENDER_APIENTRY 655 574 renderspuWindowCreate( const char *dpyName, GLint visBits ) 656 575 { 657 576 return renderspuWindowCreateEx( dpyName, visBits, 0 ); 658 577 } 659 578 660 void renderspuWinReleaseCb(void*pvWindow)579 static void renderspuCheckCurrentCtxWindowCB(unsigned long key, void *data1, void *data2) 661 580 { 662 renderspuWinRelease((WindowInfo*)pvWindow); 581 ContextInfo *pCtx = (ContextInfo *) data1; 582 WindowInfo *pWindow = data2; 583 (void) key; 584 585 if (pCtx->currentWindow==pWindow) 586 { 587 WindowInfo* pDummy = renderspuGetDummyWindow(pCtx->BltInfo.Base.visualBits); 588 if (pDummy) 589 { 590 renderspuPerformMakeCurrent(pDummy, 0, pCtx); 591 } 592 else 593 { 594 crWarning("failed to get dummy window"); 595 renderspuMakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, pCtx->BltInfo.Base.id); 596 } 597 } 598 } 599 600 void renderspuWindowTermBase( WindowInfo *window ) 601 { 602 renderspuVBoxCompositorSet(window, NULL); 603 renderspuVBoxPresentBlitterCleanup(window); 604 renderspu_SystemDestroyWindow( window ); 605 RTCritSectDelete(&window->CompositorLock); 606 } 607 608 void renderspuWindowTerm( WindowInfo *window ) 609 { 610 GET_CONTEXT(pOldCtx); 611 WindowInfo * pOldWindow = pOldCtx ? pOldCtx->currentWindow : NULL; 612 CRASSERT(!pOldCtx == !pOldWindow); 613 /* ensure no concurrent draws can take place */ 614 renderspuWindowTermBase(window); 615 /* check if this window is bound to some ctx. Note: window pointer is already freed here */ 616 crHashtableWalk(render_spu.contextTable, renderspuCheckCurrentCtxWindowCB, window); 617 /* restore current context */ 618 { 619 GET_CONTEXT(pNewCtx); 620 WindowInfo * pNewWindow = pNewCtx ? pNewCtx->currentWindow : NULL; 621 CRASSERT(!pNewCtx == !pNewWindow); 622 623 if (pOldWindow == window) 624 renderspuMakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, CR_RENDER_DEFAULT_CONTEXT_ID); 625 else if (pNewCtx != pOldCtx || pOldWindow != pNewWindow) 626 { 627 if (pOldCtx) 628 renderspuPerformMakeCurrent(pOldWindow, 0, pOldCtx); 629 else 630 renderspuMakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, CR_RENDER_DEFAULT_CONTEXT_ID); 631 } 632 } 663 633 } 664 634 665 635 void 666 636 RENDER_APIENTRY renderspuWindowDestroy( GLint win ) 667 637 { 668 638 WindowInfo *window; … … 673 643 crWarning("request to destroy a default mural, ignoring"); 674 644 return; 675 645 } 676 646 window = (WindowInfo *) crHashtableSearch(render_spu.windowTable, win); 677 647 if (window) { 678 648 crDebug("Render SPU: Destroy window (%d)", win); 679 /* since os-specific backend can hold its own reference to the window object (e.g. on OSX), 680 * we need to explicitly issue a window destroy command 681 * this ensures the backend will eventually release the reference, 682 * the window object itself will remain valid until its ref count reaches zero */ 683 renderspuWinTerm( window ); 649 renderspuWindowTerm( window ); 684 650 685 651 /* remove window info from hash table, and free it */ 686 crHashtableDelete(render_spu.windowTable, win, renderspuWinReleaseCb);652 crHashtableDelete(render_spu.windowTable, win, crFree); 687 653 688 654 } 689 655 else { 690 656 crDebug("Render SPU: Attempt to destroy invalid window (%d)", win); 691 657 } 692 658 } … … 709 675 renderspu_SystemWindowSize( window, w, h ); 710 676 window->BltInfo.width = w; 711 677 window->BltInfo.height = h; 712 678 } 713 679 } 714 680 else { 715 WARN(("Render SPU: Attempt to resize invalid window (%d)", win));681 crDebug("Render SPU: Attempt to resize invalid window (%d)", win); 716 682 } 717 683 } 718 684 719 685 720 686 static void RENDER_APIENTRY 721 687 renderspuWindowPosition( GLint win, GLint x, GLint y ) … … 788 754 */ 789 755 flag = 0; 790 756 } 791 757 792 758 visible = !!flag; 793 759 794 //if (window->visible != visible)760 if (window->visible != visible) 795 761 { 796 762 renderspu_SystemShowWindow( window, visible ); 797 763 window->visible = visible; 798 764 } 799 765 } 800 766 else { … … 1474 1440 crWarning("Unhandled target in renderspuChromiumParameterfCR()"); 1475 1441 break; 1476 1442 } 1477 1443 #endif 1478 1444 } 1479 1445 1480 bool renderspuCalloutAvailable()1481 {1482 return render_spu.pfnClientCallout != NULL;1483 }1484 1485 bool renderspuCalloutClient(PFNVCRSERVER_CLIENT_CALLOUT_CB pfnCb, void *pvCb)1486 {1487 if (render_spu.pfnClientCallout)1488 {1489 render_spu.pfnClientCallout(pfnCb, pvCb);1490 return true;1491 }1492 return false;1493 }1494 1446 1495 1447 static void RENDER_APIENTRY 1496 1448 renderspuChromiumParametervCR(GLenum target, GLenum type, GLsizei count, 1497 1449 const GLvoid *values) 1498 1450 { 1499 1451 int client_num; 1500 1452 unsigned short port; 1501 1453 CRMessage *msg, pingback; 1502 1454 unsigned char *privbuf = NULL; 1503 1455 1504 1456 switch (target) { 1505 case GL_HH_SET_CLIENT_CALLOUT: 1506 render_spu.pfnClientCallout = (PFNVCRSERVER_CLIENT_CALLOUT)values; 1507 break; 1457 1508 1458 case GL_GATHER_CONNECT_CR: 1509 1459 if (render_spu.gather_userbuf_size) 1510 1460 privbuf = (unsigned char *)crAlloc(1024*768*4); 1511 1461 1512 1462 port = ((GLint *) values)[0]; 1513 1463 -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/render/renderspu_glx.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/render/renderspu_glx.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/render/renderspu_glx.c
old new 400 400 dpyName = renderspuGetDisplayName(); 401 401 if (dpyName) 402 402 { 403 403 GLboolean bRc = renderspuInitVisual(&render_spu.WinCmdVisual, dpyName, render_spu.default_visual); 404 404 if (bRc) 405 405 { 406 bRc = renderspuWin InitWithVisual(&render_spu.WinCmdWindow, &render_spu.WinCmdVisual, GL_FALSE, CR_RENDER_WINCMD_ID);406 bRc = renderspuWindowInitWithVisual(&render_spu.WinCmdWindow, &render_spu.WinCmdVisual, GL_FALSE, CR_RENDER_WINCMD_ID); 407 407 if (bRc) 408 408 { 409 409 XSelectInput(render_spu.WinCmdVisual.dpy, render_spu.WinCmdWindow.window, StructureNotifyMask); 410 410 render_spu.WinCmdAtom = XInternAtom(render_spu.WinCmdVisual.dpy, "VBoxWinCmd", False); 411 411 CRASSERT(render_spu.WinCmdAtom != None); 412 412 return VINF_SUCCESS; 413 413 } 414 414 else 415 415 { 416 crError("renderspuWin InitWithVisual failed");416 crError("renderspuWindowInitWithVisual failed"); 417 417 } 418 418 /* there is no visual destroy impl currently 419 419 * @todo: implement */ 420 420 } 421 421 else 422 422 { … … 438 438 } 439 439 440 440 static void renderspuWinCmdTerm() 441 441 { 442 442 /* the window is not in the table, this will just ensure the key is freed */ 443 443 crHashtableDelete(render_spu.windowTable, CR_RENDER_WINCMD_ID, NULL); 444 renderspuWin Cleanup(&render_spu.WinCmdWindow);444 renderspuWindowTerm(&render_spu.WinCmdWindow); 445 445 crFreeHashtable(render_spu.pWinToInfoTable, NULL); 446 446 /* we do not have visual destroy functionality 447 447 * @todo implement */ 448 448 } 449 449 450 450 … … 536 536 { 537 537 const struct VBOXVR_SCR_COMPOSITOR * pCompositor; 538 538 539 539 pCompositor = renderspuVBoxCompositorAcquire(pWindow); 540 540 if (pCompositor) 541 541 { 542 renderspuVBoxPresentCompositionGeneric(pWindow, pCompositor, NULL, 0, false);542 renderspuVBoxPresentCompositionGeneric(pWindow, pCompositor, NULL, 0, true); 543 543 renderspuVBoxCompositorRelease(pWindow); 544 544 } 545 545 } 546 546 } 547 547 break; 548 548 } … … 1921 1921 XUnmapWindow( window->visual->dpy, window->window ); 1922 1922 XSync(window->visual->dpy, 0); 1923 1923 } 1924 1924 } 1925 1925 } 1926 1926 1927 #define CR_RENDER_FORCE_PRESENT_MAIN_THREAD1928 1929 1927 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry ) 1930 1928 { 1931 1929 /* the CR_RENDER_FORCE_PRESENT_MAIN_THREAD is actually inherited from cocoa backend impl, 1932 1930 * here it forces rendering in WinCmd thread rather than a Main thread. 1933 1931 * it is used for debugging only in any way actually. 1934 1932 * @todo: change to some more generic macro name */ … … 1944 1942 else if (rc == VERR_SEM_BUSY) 1945 1943 #endif 1946 1944 { 1947 1945 Status status; 1948 1946 XEvent event; 1949 1947 render_spu.self.Flush(); 1950 //renderspuVBoxPresentBlitterEnsureCreated(window, 0);1948 renderspuVBoxPresentBlitterEnsureCreated(window, 0); 1951 1949 1952 1950 crMemset(&event, 0, sizeof (event)); 1953 1951 event.type = Expose; 1954 1952 event.xexpose.window = window->window; 1955 1953 event.xexpose.width = window->BltInfo.width; 1956 1954 event.xexpose.height = window->BltInfo.height; 1957 1955 status = XSendEvent(render_spu.pCommunicationDisplay, render_spu.WinCmdWindow.window, False, 0, &event); 1958 1956 if (!status) 1959 1957 { 1960 WARN(("XSendEvent returned null")); 1958 Assert(0); 1959 crWarning("XSendEvent returned null"); 1961 1960 } 1962 1961 XFlush(render_spu.pCommunicationDisplay); 1963 1962 } 1964 1963 #ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD 1965 1964 else 1966 1965 { 1967 1966 /* this is somewhat we do not expect */ 1968 WARN(("renderspuVBoxCompositorTryAcquire failed rc %d", rc));1967 crWarning("renderspuVBoxCompositorTryAcquire failed rc %d", rc); 1969 1968 } 1970 1969 #endif 1971 1970 } 1972 1971 1973 1972 static void 1974 1973 MarkWindow(WindowInfo *w) -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/render/renderspu.h
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/render/renderspu.h /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/render/renderspu.h
old new 94 94 int x, y; 95 95 // int width, height; 96 96 // int id; /**< integer window ID */ 97 97 CR_BLITTER_WINDOW BltInfo; 98 98 99 99 VisualInfo *visual; 100 101 volatile uint32_t cRefs;102 103 100 GLboolean mapPending; 104 101 GLboolean visible; 105 102 GLboolean everCurrent; /**< has this window ever been bound? */ 106 103 char *title; 107 104 108 105 const VBOXVR_SCR_COMPOSITOR *pCompositor; … … 218 215 typedef GLhandleARB (*PFNGET_HANDLE)(GLenum pname); 219 216 typedef void (*PFNGET_INFO_LOG)( GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog ); 220 217 typedef void (*PFNGET_OBJECT_PARAMETERFV)( GLhandleARB obj, GLenum pname, GLfloat * params ); 221 218 typedef void (*PFNGET_OBJECT_PARAMETERIV)( GLhandleARB obj, GLenum pname, GLint * params ); 222 219 #endif 223 220 224 typedef DECLCALLBACKPTR(void, PFNVCRSERVER_CLIENT_CALLOUT_CB)(void *pvCb);225 typedef DECLCALLBACKPTR(void, PFNVCRSERVER_CLIENT_CALLOUT)(PFNVCRSERVER_CLIENT_CALLOUT_CB pfnCb, void*pvCb);226 227 228 221 /** 229 222 * Renderspu state info 230 223 */ 231 224 typedef struct { 232 225 SPUDispatchTable self; 233 226 int id; … … 291 284 char *swap_master_url; 292 285 CRConnection **swap_conns; 293 286 294 287 SPUDispatchTable blitterDispatch; 295 288 CRHashTable *blitterTable; 296 289 297 PFNVCRSERVER_CLIENT_CALLOUT pfnClientCallout;298 299 290 #ifdef USE_OSMESA 300 291 /** Off screen rendering hooks. */ 301 292 int use_osmesa; 302 293 303 294 OSMesaContext (*OSMesaCreateContext)( GLenum format, OSMesaContext sharelist ); 304 295 GLboolean (* OSMesaMakeCurrent)( OSMesaContext ctx, … … 434 425 bool fRedraw); 435 426 extern PCR_BLITTER renderspuVBoxPresentBlitterGet( WindowInfo *window ); 436 427 void renderspuVBoxPresentBlitterCleanup( WindowInfo *window ); 437 428 extern int renderspuVBoxPresentBlitterEnter( PCR_BLITTER pBlitter, int32_t i32MakeCurrentUserData ); 438 429 extern PCR_BLITTER renderspuVBoxPresentBlitterGetAndEnter( WindowInfo *window, int32_t i32MakeCurrentUserData, bool fRedraw ); 439 430 extern PCR_BLITTER renderspuVBoxPresentBlitterEnsureCreated( WindowInfo *window, int32_t i32MakeCurrentUserData ); 440 WindowInfo* renderspuWinCreate(GLint visBits, GLint id); 441 void renderspuWinTermOnShutdown(WindowInfo *window); 442 void renderspuWinTerm( WindowInfo *window ); 443 void renderspuWinCleanup(WindowInfo *window); 444 void renderspuWinDestroy(WindowInfo *window); 445 GLboolean renderspuWinInitWithVisual( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id ); 446 GLboolean renderspuWinInit(WindowInfo *pWindow, const char *dpyName, GLint visBits, GLint id); 447 448 DECLINLINE(void) renderspuWinRetain(WindowInfo *window) 449 { 450 ASMAtomicIncU32(&window->cRefs); 451 } 452 453 DECLINLINE(bool) renderspuWinIsTermed(WindowInfo *window) 454 { 455 return window->BltInfo.Base.id < 0; 456 } 457 458 DECLINLINE(void) renderspuWinRelease(WindowInfo *window) 459 { 460 uint32_t cRefs = ASMAtomicDecU32(&window->cRefs); 461 if (!cRefs) 462 { 463 renderspuWinDestroy(window); 464 } 465 } 466 431 void renderspuWindowTermBase( WindowInfo *window ); 432 extern void renderspuWindowTerm( WindowInfo *window ); 467 433 extern WindowInfo* renderspuGetDummyWindow(GLint visBits); 468 434 extern void renderspuPerformMakeCurrent(WindowInfo *window, GLint nativeWindow, ContextInfo *context); 435 extern GLboolean renderspuWindowInit(WindowInfo *pWindow, const char *dpyName, GLint visBits, GLint id); 436 extern GLboolean renderspuWindowInitWithVisual( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id ); 469 437 extern GLboolean renderspuInitVisual(VisualInfo *pVisInfo, const char *displayName, GLbitfield visAttribs); 470 438 extern void renderspuVBoxCompositorBlit ( const struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter); 471 439 extern void renderspuVBoxCompositorBlitStretched ( const struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter, GLfloat scaleX, GLfloat scaleY); 472 440 extern GLint renderspuCreateContextEx(const char *dpyName, GLint visBits, GLint id, GLint shareCtx); 473 441 extern GLint renderspuWindowCreateEx( const char *dpyName, GLint visBits, GLint id ); 474 442 … … 485 453 486 454 ContextInfo * renderspuDefaultSharedContextAcquire(); 487 455 void renderspuDefaultSharedContextRelease(ContextInfo * pCtx); 488 456 uint32_t renderspuContextRelease(ContextInfo *context); 489 457 uint32_t renderspuContextRetain(ContextInfo *context); 490 458 491 bool renderspuCalloutAvailable();492 bool renderspuCalloutClient(PFNVCRSERVER_CLIENT_CALLOUT_CB pfnCb, void *pvCb);493 494 495 459 #ifdef __cplusplus 496 460 extern "C" { 497 461 #endif 498 462 DECLEXPORT(void) renderspuSetWindowId(uint64_t winId); 499 463 DECLEXPORT(void) renderspuReparentWindow(GLint window); 500 464 DECLEXPORT(void) renderspuSetUnscaledHiDPI(bool fEnable); -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/render/renderspu_init.c
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/render/renderspu_init.c /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/render/renderspu_init.c
old new 425 425 renderspuContextMarkDeletedAndRelease(context); 426 426 } 427 427 428 428 static void DeleteWindowCallback( void *data ) 429 429 { 430 430 WindowInfo *window = (WindowInfo *) data; 431 renderspuWin TermOnShutdown(window);432 renderspuWinRelease(window);431 renderspuWindowTermBase(window); 432 crFree(window); 433 433 } 434 434 435 435 static void DeleteBlitterCallback( void *data ) 436 436 { 437 437 PCR_BLITTER pBlitter = (PCR_BLITTER) data; 438 438 CrBltTerm(pBlitter); -
VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/unpacker/unpack.py
diff -uNr -U 6 vbox-orig/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/unpacker/unpack.py /home/alexey/VirtualBox-5.0.0_BETA2/src/VBox/HostServices//SharedOpenGL/unpacker/unpack.py
old new 26 26 DECLEXPORT(const unsigned char *) cr_unpackData = NULL; 27 27 SPUDispatchTable cr_unpackDispatch; 28 28 29 29 static void crUnpackExtend(void); 30 30 static void crUnpackExtendDbg(void); 31 31 32 #if 0 //def DEBUG_misha 33 //# define CR_UNPACK_DEBUG_OPCODES 34 # define CR_UNPACK_DEBUG_LAST_OPCODES 35 # define CR_UNPACK_DEBUG_PREV_OPCODES 36 #endif 37 38 #ifdef CR_UNPACK_DEBUG_PREV_OPCODES 39 static GLenum g_VBoxDbgCrPrevOpcode = 0; 40 static GLenum g_VBoxDbgCrPrevExtendOpcode = 0; 41 #endif 32 /*#define CR_UNPACK_DEBUG_OPCODES*/ 33 /*#define CR_UNPACK_DEBUG_LAST_OPCODES*/ 42 34 """ 43 35 44 36 nodebug_opcodes = [ 45 37 "CR_MULTITEXCOORD2FARB_OPCODE", 46 38 "CR_VERTEX3F_OPCODE", 47 39 "CR_NORMAL3F_OPCODE", … … 215 207 } 216 208 217 209 CR_UNPACK_BUFFER_TYPE crUnpackGetBufferType(const void *opcodes, unsigned int num_opcodes) 218 210 { 219 211 const uint8_t *pu8Codes = (const uint8_t *)opcodes; 220 212 213 CR_UNPACK_BUFFER_TYPE enmType; 221 214 uint8_t first; 222 215 uint8_t last; 223 216 224 217 if (!num_opcodes) 225 218 return CR_UNPACK_BUFFER_TYPE_GENERIC; 226 219 227 220 first = pu8Codes[0]; 228 221 last = pu8Codes[1-(int)num_opcodes]; 229 230 switch (last) 231 { 232 case CR_CMDBLOCKFLUSH_OPCODE: 233 return CR_UNPACK_BUFFER_TYPE_CMDBLOCK_FLUSH; 234 case CR_CMDBLOCKEND_OPCODE: 235 return (first == CR_CMDBLOCKBEGIN_OPCODE) ? CR_UNPACK_BUFFER_TYPE_GENERIC : CR_UNPACK_BUFFER_TYPE_CMDBLOCK_END; 236 default: 237 return (first != CR_CMDBLOCKBEGIN_OPCODE) ? CR_UNPACK_BUFFER_TYPE_GENERIC : CR_UNPACK_BUFFER_TYPE_CMDBLOCK_BEGIN; 238 } 222 223 enmType = (first != CR_CMDBLOCKBEGIN_OPCODE) ? CR_UNPACK_BUFFER_TYPE_GENERIC : CR_UNPACK_BUFFER_TYPE_CMDBLOCK_BEGIN; 224 225 if (last != CR_CMDBLOCKEND_OPCODE) 226 return enmType; 227 228 /* last is CMDBLOCKEND*/ 229 return (enmType == CR_UNPACK_BUFFER_TYPE_CMDBLOCK_BEGIN) ? CR_UNPACK_BUFFER_TYPE_GENERIC : CR_UNPACK_BUFFER_TYPE_CMDBLOCK_END; 239 230 } 240 231 241 232 void crUnpack( const void *data, const void *opcodes, 242 233 unsigned int num_opcodes, SPUDispatchTable *table ) 243 234 { 244 235 unsigned int i; … … 260 251 { 261 252 262 253 CRDBGPTR_CHECKZ(writeback_ptr); 263 254 CRDBGPTR_CHECKZ(return_ptr); 264 255 265 256 /*crDebug(\"Unpacking opcode \%d\", *unpack_opcodes);*/ 266 #ifdef CR_UNPACK_DEBUG_PREV_OPCODES267 g_VBoxDbgCrPrevOpcode = *unpack_opcodes;268 #endif269 257 switch( *unpack_opcodes ) 270 258 {""" 271 259 272 260 # 273 261 # Emit switch cases for all unextended opcodes 274 262 # … … 296 284 # endif 297 285 crUnpackExtend(); 298 286 #endif 299 287 break; 300 288 case CR_CMDBLOCKBEGIN_OPCODE: 301 289 case CR_CMDBLOCKEND_OPCODE: 302 case CR_CMDBLOCKFLUSH_OPCODE:303 290 case CR_NOP_OPCODE: 304 291 INCR_DATA_PTR_NO_ARGS( ); 305 292 break; 306 293 default: 307 294 crError( "Unknown opcode: %d", *unpack_opcodes ); 308 295 break; … … 330 317 print '}\n' 331 318 332 319 print 'static void crUnpackExtend(void)' 333 320 print '{' 334 321 print '\tGLenum extend_opcode = %s;' % ReadData( 4, 'GLenum' ); 335 322 print '' 336 print '#ifdef CR_UNPACK_DEBUG_PREV_OPCODES'337 print '\tg_VBoxDbgCrPrevExtendOpcode = extend_opcode;'338 print '#endif'339 print ''340 323 print '\t/*crDebug(\"Unpacking extended opcode \%d", extend_opcode);*/' 341 324 print '\tswitch( extend_opcode )' 342 325 print '\t{' 343 326 344 327 345 328 # … … 360 343 }""" 361 344 362 345 print 'static void crUnpackExtendDbg(void)' 363 346 print '{' 364 347 print '\tGLenum extend_opcode = %s;' % ReadData( 4, 'GLenum' ); 365 348 print '' 366 print '#ifdef CR_UNPACK_DEBUG_PREV_OPCODES'367 print '\tg_VBoxDbgCrPrevExtendOpcode = extend_opcode;'368 print '#endif'369 print ''370 349 print '\t/*crDebug(\"Unpacking extended opcode \%d", extend_opcode);*/' 371 350 print '\tswitch( extend_opcode )' 372 351 print '\t{' 373 352 374 353 375 354 #

