- 時間撮記:
- 2013-10-4 下午07:35:58 (11 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/dump.cpp
r48613 r48897 1232 1232 } 1233 1233 1234 void crRecDumpTextureV(CR_RECORDER *pRec, const VBOXVR_TEXTURE *pTex, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin, const char *pszStr, va_list pArgList) 1235 { 1236 CR_BLITTER_IMG Img = {0}; 1237 int rc = CrBltEnter(pRec->pBlitter, pCurCtx, pCurWin); 1238 if (RT_SUCCESS(rc)) 1239 { 1240 rc = CrBltImgGetTex(pRec->pBlitter, pTex, GL_BGRA, &Img); 1241 if (RT_SUCCESS(rc)) 1242 { 1243 crDmpImgV(pRec->pDumper, &Img, pszStr, pArgList); 1244 CrBltImgFree(pRec->pBlitter, &Img); 1245 } 1246 else 1247 { 1248 crWarning("CrBltImgGetTex failed, rc %d", rc); 1249 } 1250 CrBltLeave(pRec->pBlitter); 1251 } 1252 else 1253 { 1254 crWarning("CrBltEnter failed, rc %d", rc); 1255 } 1256 } 1257 1258 void crRecDumpTextureF(CR_RECORDER *pRec, const VBOXVR_TEXTURE *pTex, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin, const char *pszStr, ...) 1259 { 1260 va_list pArgList; 1261 va_start(pArgList, pszStr); 1262 crRecDumpTextureV(pRec, pTex, pCurCtx, pCurWin, pszStr, pArgList); 1263 va_end(pArgList); 1264 } 1265 1266 void crRecDumpTextureByIdV(CR_RECORDER *pRec, CRContext *ctx, GLint id, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin, const char *pszStr, va_list pArgList) 1267 { 1268 CRTextureObj *pTobj = (CRTextureObj *)crHashtableSearch(ctx->shared->textureTable, id); 1269 if (!pTobj) 1270 { 1271 crWarning("no texture of id %d", id); 1272 return; 1273 } 1274 1275 CRTextureLevel *pTl = &pTobj->level[0][0 /* level */]; 1276 VBOXVR_TEXTURE Tex; 1277 Tex.width = pTl->width; 1278 Tex.height = pTl->height; 1279 Tex.target = pTobj->target; 1280 Assert(Tex.target == GL_TEXTURE_2D); 1281 Tex.hwid = pTobj->hwid; 1282 if (!Tex.hwid) 1283 { 1284 crWarning("no texture hwid of id %d", id); 1285 return; 1286 } 1287 1288 crRecDumpTextureV(pRec, &Tex, pCurCtx, pCurWin, pszStr, pArgList); 1289 } 1290 1291 void crRecDumpTextureByIdF(CR_RECORDER *pRec, CRContext *ctx, GLint id, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin, const char *pszStr, ...) 1292 { 1293 va_list pArgList; 1294 va_start(pArgList, pszStr); 1295 crRecDumpTextureByIdV(pRec, ctx, id, pCurCtx, pCurWin, pszStr, pArgList); 1296 va_end(pArgList); 1297 } 1298 1234 1299 void crRecDumpTextures(CR_RECORDER *pRec, CRContext *ctx, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin) 1235 1300 { … … 1238 1303 GLint restoreTexUnit = 0; 1239 1304 GLint curProgram = 0; 1240 int rc;1241 1305 int i; 1242 1306 … … 1294 1358 { 1295 1359 GLint hwTex = 0; 1296 CR_BLITTER_IMG Img = {0};1297 1360 VBOXVR_TEXTURE Tex; 1298 1361 … … 1327 1390 } 1328 1391 1329 rc = CrBltEnter(pRec->pBlitter, pCurCtx, pCurWin); 1330 if (RT_SUCCESS(rc)) 1331 { 1332 rc = CrBltImgGetTex(pRec->pBlitter, &Tex, GL_BGRA, &Img); 1333 if (RT_SUCCESS(rc)) 1334 { 1335 crDmpImgF(pRec->pDumper, &Img, "ctx(%d), Unit %d: TEXTURE_2D id(%d) hwid(%d), width(%d), height(%d)", ctx, i, pTobj->id, pTobj->hwid, width, height); 1336 CrBltImgFree(pRec->pBlitter, &Img); 1337 } 1338 else 1339 { 1340 crWarning("CrBltImgGetTex failed, rc %d", rc); 1341 } 1342 CrBltLeave(pRec->pBlitter); 1343 } 1344 else 1345 { 1346 crWarning("CrBltEnter failed, rc %d", rc); 1347 } 1392 crRecDumpTextureF(pRec, &Tex, pCurCtx, pCurWin, "ctx(%d), Unit %d: TEXTURE_2D id(%d) hwid(%d), width(%d), height(%d)", ctx, i, pTobj->id, pTobj->hwid, width, height); 1348 1393 } 1349 1394 // else
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器