Changeset 49172 in vbox
- Timestamp:
- Oct 17, 2013 7:34:35 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 90045
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_dump.h ¶
r48897 r49172 159 159 VBOXDUMPDECL(void) crRecDumpTexGen(CR_RECORDER *pRec, CRContext *ctx); 160 160 161 VBOXDUMPDECL(int) crRecAlphaImgCreate(const CR_BLITTER_IMG *pImg, CR_BLITTER_IMG *pAlphaImg); 162 VBOXDUMPDECL(void) crRecAlphaImgDestroy(CR_BLITTER_IMG *pImg); 163 164 161 165 typedef DECLCALLBACKPTR(GLuint, PFNCRDUMPGETHWID)(void *pvObj); 162 166 void* crDmpHashtableSearchByHwid(CRHashTable *pHash, GLuint hwid, PFNCRDUMPGETHWID pfnGetHwid, unsigned long *pKey); -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/dump.cpp ¶
r48897 r49172 34 34 #ifdef VBOX_WITH_CRDUMPER 35 35 36 static uint32_t g_CrDbgDumpRecTexInfo = 0; 36 static uint32_t g_CrDbgDumpRecTexInfo = 1; 37 static uint32_t g_CrDbgDumpAlphaData = 1; 37 38 38 39 /* dump stuff */ … … 463 464 { 464 465 crDmpImgF(pRec->pDumper, &Img, "ctx(%d), BUFFER: id(%d) hwid(%d), width(%d), height(%d)", ctx, id, Tex.hwid, width, height); 466 467 if (g_CrDbgDumpAlphaData) 468 { 469 CR_BLITTER_IMG AlphaImg = {0}; 470 rc = crRecAlphaImgCreate(&Img, &AlphaImg); 471 if (RT_SUCCESS(rc)) 472 { 473 crDmpImgF(pRec->pDumper, &AlphaImg, "Buffer ALPHA Data"); 474 crRecAlphaImgDestroy(&AlphaImg); 475 } 476 else 477 { 478 crWarning("crRecAlphaImgCreate failed rc %d", rc); 479 } 480 } 481 465 482 CrBltImgFree(pRec->pBlitter, &Img); 466 483 } … … 1232 1249 } 1233 1250 1251 int crRecAlphaImgCreate(const CR_BLITTER_IMG *pImg, CR_BLITTER_IMG *pAlphaImg) 1252 { 1253 if (pImg->enmFormat != GL_RGBA 1254 && pImg->enmFormat != GL_BGRA) 1255 { 1256 crWarning("unsupported format 0x%x", pImg->enmFormat); 1257 return VERR_NOT_IMPLEMENTED; 1258 } 1259 1260 pAlphaImg->bpp = 32; 1261 pAlphaImg->pitch = pImg->width * 4; 1262 pAlphaImg->cbData = pAlphaImg->pitch * pImg->height; 1263 pAlphaImg->enmFormat = GL_BGRA; 1264 pAlphaImg->width = pImg->width; 1265 pAlphaImg->height = pImg->height; 1266 1267 pAlphaImg->pvData = RTMemAlloc(pAlphaImg->cbData); 1268 if (!pAlphaImg->pvData) 1269 { 1270 crWarning("RTMemAlloc failed"); 1271 return VERR_NO_MEMORY; 1272 } 1273 1274 uint8_t *pu8SrcBuf = (uint8_t*)pImg->pvData; 1275 uint8_t *pu8DstBuf = (uint8_t*)pAlphaImg->pvData; 1276 for (uint32_t ih = 0; ih < pAlphaImg->height; ++ih) 1277 { 1278 uint32_t *pu32SrcBuf = (uint32_t*)pu8SrcBuf; 1279 uint32_t *pu32DstBuf = (uint32_t*)pu8DstBuf; 1280 for (uint32_t iw = 0; iw < pAlphaImg->width; ++iw) 1281 { 1282 uint8_t alpha = (((*pu32SrcBuf) >> 24) & 0xff); 1283 *pu32DstBuf = (0xff << 24) || (alpha << 16) || (alpha << 8) || alpha; 1284 ++pu32SrcBuf; 1285 ++pu32DstBuf; 1286 } 1287 pu8SrcBuf += pImg->pitch; 1288 pu8DstBuf += pAlphaImg->pitch; 1289 } 1290 1291 return VINF_SUCCESS; 1292 } 1293 1294 void crRecAlphaImgDestroy(CR_BLITTER_IMG *pImg) 1295 { 1296 RTMemFree(pImg->pvData); 1297 pImg->pvData = NULL; 1298 } 1299 1234 1300 void crRecDumpTextureV(CR_RECORDER *pRec, const VBOXVR_TEXTURE *pTex, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin, const char *pszStr, va_list pArgList) 1235 1301 { … … 1242 1308 { 1243 1309 crDmpImgV(pRec->pDumper, &Img, pszStr, pArgList); 1310 if (g_CrDbgDumpAlphaData) 1311 { 1312 CR_BLITTER_IMG AlphaImg = {0}; 1313 rc = crRecAlphaImgCreate(&Img, &AlphaImg); 1314 if (RT_SUCCESS(rc)) 1315 { 1316 crDmpImgF(pRec->pDumper, &AlphaImg, "Texture ALPHA Data"); 1317 crRecAlphaImgDestroy(&AlphaImg); 1318 } 1319 else 1320 { 1321 crWarning("crRecAlphaImgCreate failed rc %d", rc); 1322 } 1323 } 1244 1324 CrBltImgFree(pRec->pBlitter, &Img); 1245 1325 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h ¶
r48897 r49172 488 488 extern unsigned long g_CrDbgDumpDrawFramesCount; 489 489 490 extern uint32_t g_CrDbgDumpVertattrFixupOn; 491 490 492 bool crServerDumpFilterDmp(unsigned long event, CR_DUMPER *pDumper); 491 bool crServerDumpFilterOp(unsigned long event, CR_DUMPER *pDumper); 493 bool crServerDumpFilterOpEnter(unsigned long event, CR_DUMPER *pDumper); 494 void crServerDumpFilterOpLeave(unsigned long event, CR_DUMPER *pDumper); 492 495 493 496 //#define CR_SERVER_DUMP_MASK_OP 0x0000fffc … … 581 584 || (g_CrDbgDumpPid > 0 && ((uint64_t)g_CrDbgDumpPid) == cr_server.curClient->pid) \ 582 585 || (g_CrDbgDumpPid < 0 && ((uint64_t)(-g_CrDbgDumpPid)) != cr_server.curClient->pid)) \ 583 && crServerDumpFilterOp ((_ev), (_pDumper)))586 && crServerDumpFilterOpEnter((_ev), (_pDumper))) 584 587 #define CR_SERVER_DUMP_FILTER_DMP(_ev, _pDumper) (crServerDumpFilterDmp((_ev), (_pDumper))) 585 588 … … 595 598 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_BUFF_ENTER, cr_server.Recorder.pDumper)) { crServerDumpBuffer(-1); } \ 596 599 crDmpStrF(cr_server.Recorder.pDumper, "==Done ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \ 600 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_DRAW_ENTER_ALL, cr_server.Recorder.pDumper); \ 597 601 } while (0) 598 602 … … 608 612 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_STATE_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpState(); } \ 609 613 crDmpStrF(cr_server.Recorder.pDumper, "==Done LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \ 614 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_DRAW_LEAVE_ALL, cr_server.Recorder.pDumper); \ 610 615 } while (0) 611 616 … … 616 621 crServerDumpShader((_id)); \ 617 622 crDmpStrF(cr_server.Recorder.pDumper, "==Done[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \ 623 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_COMPILE_SHADER, cr_server.Recorder.pDumper); \ 618 624 } while (0) 619 625 … … 624 630 crServerDumpShader((_id)); \ 625 631 crDmpStrF(cr_server.Recorder.pDumper, "==Done[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \ 632 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_SHADER_SOURCE, cr_server.Recorder.pDumper); \ 626 633 } while (0) 627 634 … … 632 639 crServerDumpProgram((_id)); \ 633 640 crDmpStrF(cr_server.Recorder.pDumper, "==Done[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \ 641 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_LINK_PROGRAM, cr_server.Recorder.pDumper); \ 634 642 } while (0) 635 643 … … 641 649 if (g_CrDbgDumpDrawFramesCount) { crServerDumpFramesCheck(); } \ 642 650 crDmpStrF(cr_server.Recorder.pDumper, "==Done ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \ 651 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER, cr_server.Recorder.pDumper); \ 643 652 } while (0) 644 653 … … 648 657 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \ 649 658 crServerDumpTexture((_pTex)); \ 659 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_TEXPRESENT, cr_server.Recorder.pDumper); \ 650 660 } while (0) 651 661 … … 655 665 crServerDumpCheckInit(); \ 656 666 crDmpStrF(cr_server.Recorder.pDumper, "==Done LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \ 667 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_SWAPBUFFERS_LEAVE, cr_server.Recorder.pDumper); \ 657 668 } while (0) 658 669 … … 662 673 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \ 663 674 crServerDumpDrawel _msg; \ 675 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper); \ 664 676 } while (0) 665 677 … … 669 681 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \ 670 682 crServerDumpDrawelv((_index), (_pszElFormat), (_cbEl), (_pvVal), (_cVal)); \ 683 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper); \ 671 684 } while (0) 672 685 #else /* if !defined VBOX_WITH_CRSERVER_DUMPER */ -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c ¶
r48897 r49172 130 130 131 131 case GL_GATHER_CONNECT_CR: 132 /* 132 /* 133 133 * We want the last connect to go through, 134 134 * otherwise we might deadlock in CheckWindowSize() … … 136 136 */ 137 137 gather_connect_count++; 138 if (cr_server.only_swap_once && (gather_connect_count != cr_server.numClients)) 138 if (cr_server.only_swap_once && (gather_connect_count != cr_server.numClients)) 139 139 { 140 140 break; … … 156 156 const int eye = v[1] == 0.0 ? 0 : 1; 157 157 crMatrixInitFromFloats(&cr_server.viewMatrix[eye], v + 2); 158 159 crDebug("Got GL_SERVER_VIEW_MATRIX_CR:\n" 158 159 crDebug("Got GL_SERVER_VIEW_MATRIX_CR:\n" 160 160 " %f %f %f %f\n" 161 161 " %f %f %f %f\n" … … 194 194 const int eye = v[1] == 0.0 ? 0 : 1; 195 195 crMatrixInitFromFloats(&cr_server.projectionMatrix[eye], v + 2); 196 197 crDebug("Got GL_SERVER_PROJECTION_MATRIX_CR:\n" 196 197 crDebug("Got GL_SERVER_PROJECTION_MATRIX_CR:\n" 198 198 " %f %f %f %f\n" 199 199 " %f %f %f %f\n" … … 230 230 float bottom = znear * (b - 1.0f) / y; 231 231 float top = 2.0f * znear / y + bottom; 232 crDebug("Frustum: left, right, bottom, top, near, far: %f, %f, %f, %f, %f, %f", left, right, bottom, top, znear, zfar); 232 crDebug("Frustum: left, right, bottom, top, near, far: %f, %f, %f, %f, %f, %f", left, right, bottom, top, znear, zfar); 233 233 } 234 234 else { … … 323 323 324 324 325 void SERVER_DISPATCH_APIENTRY 325 void SERVER_DISPATCH_APIENTRY 326 326 crServerDispatchCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) 327 327 { … … 424 424 gl->GenFramebuffersEXT(1, &fboID); 425 425 gl->BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboID); 426 gl->FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, target, 426 gl->FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, target, 427 427 ctx->texture.unit[ctx->texture.curTextureUnit].currentTexture2D->hwid, level); 428 428 status = gl->CheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); … … 492 492 gl->GetTexImage(target, level, GL_BGRA, GL_UNSIGNED_BYTE, img1); 493 493 494 494 495 495 for (dRow=yoffset, sRow=y-height-1; dRow<yoffset-height; dRow++, sRow--) 496 496 { … … 879 879 } 880 880 881 void SERVER_DISPATCH_APIENTRY 881 void SERVER_DISPATCH_APIENTRY 882 882 crServerDispatchBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, 883 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, 883 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, 884 884 GLbitfield mask, GLenum filter) 885 885 { … … 1628 1628 } 1629 1629 1630 bool crServerDumpFilterOp(unsigned long event, CR_DUMPER *pDumper) 1630 void crServerDumpFilterOpLeave(unsigned long event, CR_DUMPER *pDumper) 1631 { 1632 } 1633 1634 bool crServerDumpFilterOpEnter(unsigned long event, CR_DUMPER *pDumper) 1631 1635 { 1632 1636 return CR_SERVER_DUMP_DEFAULT_FILTER_OP(event);
Note:
See TracChangeset
for help on using the changeset viewer.