VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/cr_dump.h@ 46344

Last change on this file since 46344 was 46344, checked in by vboxsync, 12 years ago

crOpenGL: missing files

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1/* $Id: cr_dump.h 46344 2013-05-31 13:30:43Z vboxsync $ */
2
3/** @file
4 * Debugging: Dump API
5 */
6/*
7 * Copyright (C) 2013 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17#ifndef ___cr_dump_h__
18#define ___cr_dump_h__
19
20/* dump stuff */
21//#define VBOX_WITH_CRDUMPER
22#ifdef VBOX_WITH_CRDUMPER
23
24#include <iprt/cdefs.h>
25#include <iprt/string.h>
26#include <cr_spu.h>
27#include <cr_glstate.h>
28#include <cr_blitter.h>
29
30# define VBOXDUMPDECL(_type) DECLEXPORT(_type)
31
32RT_C_DECLS_BEGIN
33
34DECLEXPORT(void) crDmpDumpImgDmlBreak(struct CR_DUMPER * pDumper, const char*pszEntryDesc, CR_BLITTER_IMG *pImg);
35
36DECLEXPORT(void) crDmpDumpStrDbgPrint(struct CR_DUMPER * pDumper, const char*pszStr);
37
38struct CR_DUMPER;
39
40typedef DECLCALLBACKPTR(void, PFNCRDUMPIMG)(struct CR_DUMPER * pDumper, const char*pszEntryDesc, CR_BLITTER_IMG *pImg);
41typedef DECLCALLBACKPTR(void, PFNCRDUMPSTR)(struct CR_DUMPER * pDumper, const char*pszStr);
42
43typedef struct CR_DUMPER
44{
45 PFNCRDUMPIMG pfnDumpImg;
46 PFNCRDUMPSTR pfnDumpStr;
47} CR_DUMPER;
48
49#define crDmpImg(_pDumper, _pDesc, _pImg) do { \
50 (_pDumper)->pfnDumpImg((_pDumper), (_pDesc), (_pImg)); \
51 } while (0)
52
53#define crDmpStr(_pDumper, _pDesc) do { \
54 (_pDumper)->pfnDumpStr((_pDumper), (_pDesc)); \
55 } while (0)
56
57DECLINLINE(void) crDmpStrV(CR_DUMPER *pDumper, const char *pszStr, va_list pArgList)
58{
59 char szBuffer[4096] = {0};
60 RTStrPrintfV(szBuffer, sizeof (szBuffer), pszStr, pArgList);
61 crDmpStr(pDumper, szBuffer);
62}
63
64DECLINLINE(void) crDmpStrF(CR_DUMPER *pDumper, const char *pszStr, ...)
65{
66 va_list pArgList;
67 va_start(pArgList, pszStr);
68 crDmpStrV(pDumper, pszStr, pArgList);
69 va_end(pArgList);
70}
71
72typedef struct CR_DBGPRINT_DUMPER
73{
74 CR_DUMPER Base;
75} CR_DBGPRINT_DUMPER;
76
77typedef struct CR_HTML_DUMPER
78{
79 CR_DUMPER Base;
80 const char* pszFile;
81 const char* pszDir;
82 FILE *pFile;
83 uint32_t cImg;
84} CR_HTML_DUMPER;
85
86DECLEXPORT(int) crDmpHtmlInit(struct CR_HTML_DUMPER * pDumper, const char *pszDir, const char *pszFile);
87
88DECLINLINE(void) crDmpDbgPrintInit(CR_DBGPRINT_DUMPER *pDumper)
89{
90 pDumper->Base.pfnDumpImg = crDmpDumpImgDmlBreak;
91 pDumper->Base.pfnDumpStr = crDmpDumpStrDbgPrint;
92}
93
94typedef struct CR_RECORDER
95{
96 CR_BLITTER *pBlitter;
97 SPUDispatchTable *pDispatch;
98 CR_DUMPER *pDumper;
99} CR_RECORDER;
100
101DECLINLINE(void) crRecInit(CR_RECORDER *pRec, CR_BLITTER *pBlitter, SPUDispatchTable *pDispatch, CR_DUMPER *pDumper)
102{
103 pRec->pBlitter = pBlitter;
104 pRec->pDispatch = pDispatch;
105 pRec->pDumper = pDumper;
106}
107
108VBOXDUMPDECL(void) crRecDumpBuffer(CR_RECORDER *pRec, CRContext *ctx, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin, GLint idRedirFBO, VBOXVR_TEXTURE *pRedirTex);
109VBOXDUMPDECL(void) crRecDumpTextures(CR_RECORDER *pRec, CRContext *ctx, CR_BLITTER_CONTEXT *pCurCtx, CR_BLITTER_WINDOW *pCurWin);
110
111RT_C_DECLS_END
112
113#endif /* VBOX_WITH_CRDUMPER */
114/* */
115
116#endif /* #ifndef ___cr_dump_h__ */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette