VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h@ 50041

Last change on this file since 50041 was 50041, checked in by vboxsync, 11 years ago

crOpenGL: crOpenGL: 1. workaround point sprite driver bugs; 2. workaround multi-string shader source driver bug; 3. proper GLhandle for OSX; 4. extended dumping; 5. misc fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 32.7 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#ifndef CR_SERVER_H
8#define CR_SERVER_H
9
10#include "cr_protocol.h"
11#include "cr_glstate.h"
12#include "spu_dispatch_table.h"
13
14#include "state/cr_currentpointers.h"
15
16#include "cr_server.h"
17
18#ifdef VBOX_WITH_CRHGSMI
19# include <VBox/VBoxVideo.h>
20
21#include <iprt/cdefs.h>
22
23RT_C_DECLS_BEGIN
24
25extern uint8_t* g_pvVRamBase;
26extern uint32_t g_cbVRam;
27extern HCRHGSMICMDCOMPLETION g_hCrHgsmiCompletion;
28extern PFNCRHGSMICMDCOMPLETION g_pfnCrHgsmiCompletion;
29
30#define VBOXCRHGSMI_PTR(_off, _t) ((_t*)(g_pvVRamBase + (_off)))
31#define VBOXCRHGSMI_PTR_SAFE(_off, _cb, _t) ((_t*)crServerCrHgsmiPtrGet(_off, _cb))
32
33DECLINLINE(void*) crServerCrHgsmiPtrGet(VBOXVIDEOOFFSET offBuffer, uint32_t cbBuffer)
34{
35 return ((offBuffer) + (cbBuffer) <= g_cbVRam ? VBOXCRHGSMI_PTR(offBuffer, void) : NULL);
36}
37
38DECLINLINE(void) crServerCrHgsmiCmdComplete(struct VBOXVDMACMD_CHROMIUM_CMD *pCmd, int cmdProcessingRc)
39{
40 g_pfnCrHgsmiCompletion(g_hCrHgsmiCompletion, pCmd, cmdProcessingRc);
41}
42
43#define VBOXCRHGSMI_CMD_COMPLETE(_pData, _rc) do { \
44 Assert(CRVBOXHGSMI_CMDDATA_IS_HGSMICMD(_pData)); \
45 CRVBOXHGSMI_CMDDATA_ASSERT_ISSET(_pData); \
46 CRVBOXHGSMI_CMDDATA_RC(_pData, _rc); \
47 crServerCrHgsmiCmdComplete((_pData)->pHgsmiCmd, VINF_SUCCESS); \
48 } while (0)
49
50#define VBOXCRHGSMI_CMD_CHECK_COMPLETE(_pData, _rc) do { \
51 if (CRVBOXHGSMI_CMDDATA_IS_SET(_pData)) { \
52 VBOXCRHGSMI_CMD_COMPLETE(_pData, _rc); \
53 } \
54 } while (0)
55
56#endif
57
58/*
59 * This is the base number for window and context IDs
60 */
61#define MAGIC_OFFSET 5000
62
63extern CRServer cr_server;
64
65/* Semaphore wait queue node */
66typedef struct _wqnode {
67 RunQueue *q;
68 struct _wqnode *next;
69} wqnode;
70
71typedef struct {
72 GLuint count;
73 GLuint num_waiting;
74 RunQueue **waiting;
75} CRServerBarrier;
76
77typedef struct {
78 GLuint count;
79 wqnode *waiting, *tail;
80} CRServerSemaphore;
81
82typedef struct {
83 GLuint id;
84 GLint projParamStart;
85 GLfloat projMat[16]; /* projection matrix, accumulated via calls to */
86 /* glProgramLocalParameterARB, glProgramParameterNV */
87} CRServerProgram;
88
89void crServerSetVBoxConfiguration();
90void crServerSetVBoxConfigurationHGCM();
91void crServerInitDispatch(void);
92void crServerReturnValue( const void *payload, unsigned int payload_len );
93void crServerWriteback(void);
94int crServerRecv( CRConnection *conn, CRMessage *msg, unsigned int len );
95void crServerSerializeRemoteStreams(void);
96void crServerAddToRunQueue( CRClient *client );
97void crServerDeleteClient( CRClient *client );
98
99
100void crServerApplyBaseProjection( const CRmatrix *baseProj );
101void crServerApplyViewMatrix( const CRmatrix *view );
102void crServerSetOutputBounds( const CRMuralInfo *mural, int extNum );
103void crServerComputeViewportBounds( const CRViewportState *v, CRMuralInfo *mural );
104
105GLboolean crServerInitializeBucketing(CRMuralInfo *mural);
106
107void crComputeOverlapGeom(double *quads, int nquad, CRPoly ***res);
108void crComputeKnockoutGeom(double *quads, int nquad, int my_quad_idx, CRPoly **res);
109
110int crServerGetCurrentEye(void);
111
112GLboolean crServerClientInBeginEnd(const CRClient *client);
113
114GLint crServerDispatchCreateContextEx(const char *dpyName, GLint visualBits, GLint shareCtx, GLint preloadCtxID, int32_t internalID);
115GLint crServerDispatchWindowCreateEx(const char *dpyName, GLint visBits, GLint preloadWinID);
116GLint crServerMuralInit(CRMuralInfo *mural, const char *dpyName, GLint visBits, GLint preloadWinID, GLboolean fUseDefaultDEntry);
117void crServerMuralTerm(CRMuralInfo *mural);
118GLboolean crServerMuralSize(CRMuralInfo *mural, GLint width, GLint height);
119void crServerMuralPosition(CRMuralInfo *mural, GLint x, GLint y, GLboolean fSkipCheckGeometry);
120void crServerMuralVisibleRegion( CRMuralInfo *mural, GLint cRects, const GLint *pRects );
121void crServerMuralShow( CRMuralInfo *mural, GLint state );
122int crServerMuralSynchRootVr(CRMuralInfo *mural, bool *pfChanged);
123
124GLint crServerGenerateID(GLint *pCounter);
125
126GLint crServerSPUWindowID(GLint serverWindow);
127
128GLuint crServerTranslateProgramID(GLuint id);
129
130CRMuralInfo * crServerGetDummyMural(GLint visualBits);
131
132void crServerPresentOutputRedirect(CRMuralInfo *pMural);
133void crServerOutputRedirectCheckEnableDisable(CRMuralInfo *pMural);
134
135void crServerCheckMuralGeometry(CRMuralInfo *mural);
136GLboolean crServerSupportRedirMuralFBO(void);
137
138void crVBoxServerNotifyEvent(int32_t idScreen, uint32_t uEvent, void*pvData);
139void crVBoxServerCheckVisibilityEvent(int32_t idScreen);
140
141void crServerDisplayTermAll();
142
143void crServerWindowSize(CRMuralInfo *pMural);
144void crServerWindowShow(CRMuralInfo *pMural);
145void crServerWindowVisibleRegion(CRMuralInfo *pMural);
146void crServerWindowReparent(CRMuralInfo *pMural);
147
148void crServerWindowSetIsVisible(CRMuralInfo *pMural, GLboolean fIsVisible);
149void crServerWindowCheckIsVisible(CRMuralInfo *pMural);
150
151int crVBoxServerUpdateMuralRootVisibleRegion(CRMuralInfo *pMI);
152
153#define CR_SERVER_REDIR_F_NONE 0x00
154/* the data should be displayed on host (unset when is on or when CR_SERVER_REDIR_F_FBO_RAM_VMFB is set) */
155#define CR_SERVER_REDIR_F_DISPLAY 0x01
156/* guest window data get redirected to FBO on host */
157#define CR_SERVER_REDIR_F_FBO 0x02
158/* used with CR_SERVER_REDIR_F_FBO only
159 * indicates that FBO data should be copied to RAM for further processing */
160#define CR_SERVER_REDIR_F_FBO_RAM 0x04
161/* used with CR_SERVER_REDIR_F_FBO_RAM only
162 * indicates that FBO data should be passed to VRDP backend */
163#define CR_SERVER_REDIR_F_FBO_RAM_VRDP 0x08
164/* used with CR_SERVER_REDIR_F_FBO_RAM only
165 * indicates that FBO data should be passed to VM Framebuffer */
166#define CR_SERVER_REDIR_F_FBO_RAM_VMFB 0x10
167/* used with CR_SERVER_REDIR_F_FBO_RAM only
168 * makes the RPW (Read Pixels Worker) mechanism to be used for GPU memory aquisition */
169#define CR_SERVER_REDIR_F_FBO_RPW 0x20
170
171
172#define CR_SERVER_REDIR_F_ALL 0x3f
173
174#define CR_SERVER_REDIR_FGROUP_REQUIRE_FBO (CR_SERVER_REDIR_F_ALL & ~CR_SERVER_REDIR_F_DISPLAY)
175#define CR_SERVER_REDIR_FGROUP_REQUIRE_FBO_RAM (CR_SERVER_REDIR_F_FBO_RAM_VRDP | CR_SERVER_REDIR_F_FBO_RAM_VMFB | CR_SERVER_REDIR_F_FBO_RPW)
176
177DECLINLINE(GLuint) crServerRedirModeAdjust(GLuint value)
178{
179 /* sanitize values */
180 value &= CR_SERVER_REDIR_F_ALL;
181
182 if (value & CR_SERVER_REDIR_FGROUP_REQUIRE_FBO)
183 value |= CR_SERVER_REDIR_F_FBO;
184 if (value & CR_SERVER_REDIR_FGROUP_REQUIRE_FBO_RAM)
185 value |= CR_SERVER_REDIR_F_FBO_RAM;
186
187 return value;
188}
189
190int32_t crServerSetOffscreenRenderingMode(GLuint value);
191void crServerRedirMuralFBO(CRMuralInfo *mural, GLuint redir);
192void crServerDeleteMuralFBO(CRMuralInfo *mural);
193void crServerPresentFBO(CRMuralInfo *mural);
194GLboolean crServerIsRedirectedToFBO();
195GLint crServerMuralFBOIdxFromBufferName(CRMuralInfo *mural, GLenum buffer);
196void crServerMuralFBOSwapBuffers(CRMuralInfo *mural);
197
198void crServerVBoxCompositionDisableEnter(CRMuralInfo *mural);
199void crServerVBoxCompositionDisableLeave(CRMuralInfo *mural, GLboolean fForcePresentOnEnabled);
200void crServerVBoxCompositionPresent(CRMuralInfo *mural);
201DECLINLINE(GLboolean) crServerVBoxCompositionPresentNeeded(CRMuralInfo *mural)
202{
203 return mural->bVisible
204 && mural->width
205 && mural->height
206 && !mural->fRootVrOn ? !CrVrScrCompositorIsEmpty(&mural->Compositor) : !CrVrScrCompositorIsEmpty(&mural->RootVrCompositor);
207}
208
209#define CR_SERVER_FBO_BB_IDX(_mural) ((_mural)->iBbBuffer)
210#define CR_SERVER_FBO_FB_IDX(_mural) (((_mural)->iBbBuffer + 1) % ((_mural)->cBuffers))
211/* returns a valid index to be used for negative _idx, i.e. for GL_NONE cases */
212//#define CR_SERVER_FBO_ADJUST_IDX(_mural, _idx) ((_idx) >= 0 ? (_idx) : CR_SERVER_FBO_BB_IDX(_mural))
213/* just a helper that uses CR_SERVER_FBO_ADJUST_IDX for getting mural's FBO id for buffer index*/
214//#define CR_SERVER_FBO_FOR_IDX(_mural, _idx) ((_mural)->aidFBOs[CR_SERVER_FBO_ADJUST_IDX((_mural), (_idx))])
215//#define CR_SERVER_FBO_TEX_FOR_IDX(_mural, _idx) ((_mural)->aidColorTexs[CR_SERVER_FBO_ADJUST_IDX((_mural), (_idx))])
216#define CR_SERVER_FBO_FOR_IDX(_mural, _idx) ((_idx) >= 0 ? (_mural)->aidFBOs[(_idx)] : 0)
217#define CR_SERVER_FBO_TEX_FOR_IDX(_mural, _idx) ((_idx) >= 0 ? (_mural)->aidColorTexs[(_idx)] : 0)
218
219int32_t crVBoxServerInternalClientRead(CRClient *pClient, uint8_t *pBuffer, uint32_t *pcbBuffer);
220
221PCR_DISPLAY crServerDisplayGetInitialized(uint32_t idScreen);
222
223void crServerPerformMakeCurrent( CRMuralInfo *mural, CRContextInfo *ctxInfo );
224
225PCR_BLITTER crServerVBoxBlitterGet();
226
227DECLINLINE(void) crServerVBoxBlitterWinInit(CR_BLITTER_WINDOW *win, CRMuralInfo *mural)
228{
229 win->Base.id = mural->spuWindow;
230 win->Base.visualBits = mural->CreateInfo.visualBits;
231 win->width = mural->width;
232 win->height = mural->height;
233}
234
235DECLINLINE(void) crServerVBoxBlitterCtxInit(CR_BLITTER_CONTEXT *ctx, CRContextInfo *ctxInfo)
236{
237 ctx->Base.id = ctxInfo->SpuContext;
238 if (ctx->Base.id < 0)
239 ctx->Base.id = cr_server.MainContextInfo.SpuContext;
240 ctx->Base.visualBits = cr_server.curClient->currentCtxInfo->CreateInfo.visualBits;
241}
242
243/* display worker thread.
244 * see comments for CR_SERVER_RPW struct definition in cr_server.h */
245DECLINLINE(void) crServerXchgI8(int8_t *pu8Val1, int8_t *pu8Val2)
246{
247 int8_t tmp;
248 tmp = *pu8Val1;
249 *pu8Val1 = *pu8Val2;
250 *pu8Val2 = tmp;
251}
252
253#ifdef DEBUG
254# define CR_GLERR_CHECK(_op) do { \
255 GLenum status; \
256 while ((status = cr_server.head_spu->dispatch_table.GetError()) != GL_NO_ERROR) {/*Assert(0);*/} \
257 _op \
258 while ((status = cr_server.head_spu->dispatch_table.GetError()) != GL_NO_ERROR) {Assert(0);} \
259 } while (0)
260#else
261# define CR_GLERR_CHECK(_op) do { \
262 _op \
263 } while (0)
264#endif
265
266#ifdef DEBUG_misha
267# define CR_SERVER_RPW_DEBUG
268#endif
269/* *
270 * _name : Draw, Submitted, Worker, Gpu
271 */
272
273#ifdef CR_SERVER_RPW_DEBUG
274# define crServerRpwEntryDbgVerify(_pE) crServerRpwEntryDbgDoVerify(_pE)
275#else
276# define crServerRpwEntryDbgVerify(_pE) do {} while (0)
277#endif
278
279
280#define CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _name) ((_pEntry)->iTex##_name > 0)
281
282#define CR_SERVER_RPW_ENTRY_TEX_INVALIDATE(_pEntry, _name) do { \
283 crServerRpwEntryDbgVerify(_pEntry); \
284 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _name)); \
285 (_pEntry)->iTex##_name = -(_pEntry)->iTex##_name; \
286 crServerRpwEntryDbgVerify(_pEntry); \
287 } while (0)
288
289#define CR_SERVER_RPW_ENTRY_TEX_PROMOTE(_pEntry, _fromName, _toName) do { \
290 crServerRpwEntryDbgVerify(_pEntry); \
291 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _fromName)); \
292 Assert(!CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _toName)); \
293 crServerXchgI8(&(_pEntry)->iTex##_fromName, &(_pEntry)->iTex##_toName); \
294 crServerRpwEntryDbgVerify(_pEntry); \
295 } while (0)
296
297#define CR_SERVER_RPW_ENTRY_TEX_XCHG_VALID(_pEntry, _fromName, _toName) do { \
298 crServerRpwEntryDbgVerify(_pEntry); \
299 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _fromName)); \
300 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _toName)); \
301 crServerXchgI8(&(_pEntry)->iTex##_fromName, &(_pEntry)->iTex##_toName); \
302 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _fromName)); \
303 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _toName)); \
304 crServerRpwEntryDbgVerify(_pEntry); \
305 } while (0)
306
307
308#define CR_SERVER_RPW_ENTRY_TEX_PROMOTE_KEEPVALID(_pEntry, _fromName, _toName) do { \
309 crServerRpwEntryDbgVerify(_pEntry); \
310 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _fromName)); \
311 Assert(!CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _toName)); \
312 crServerXchgI8(&(_pEntry)->iTex##_fromName, &(_pEntry)->iTex##_toName); \
313 (_pEntry)->iTex##_fromName = -(_pEntry)->iTex##_fromName; \
314 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _fromName)); \
315 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _toName)); \
316 crServerRpwEntryDbgVerify(_pEntry); \
317 } while (0)
318
319#define CR_SERVER_RPW_ENTRY_TEX(_pEntry, _name) ((_pEntry)->aidWorkerTexs[(_pEntry)->iTex##_name - 1])
320
321#define CR_SERVER_RPW_ENTRY_PBO_NEXT_ID(_i) (((_i) + 1) % 2)
322#define CR_SERVER_RPW_ENTRY_PBO_IS_ACTIVE(_pEntry) ((_pEntry)->iCurPBO >= 0)
323#define CR_SERVER_RPW_ENTRY_PBO_CUR(_pEntry) ((_pEntry)->aidPBOs[(_pEntry)->iCurPBO])
324#define CR_SERVER_RPW_ENTRY_PBO_COMPLETED(_pEntry) ((_pEntry)->aidPBOs[CR_SERVER_RPW_ENTRY_PBO_NEXT_ID((_pEntry)->iCurPBO)])
325#define CR_SERVER_RPW_ENTRY_PBO_FLIP(_pEntry) do { \
326 (_pEntry)->iCurPBO = CR_SERVER_RPW_ENTRY_PBO_NEXT_ID((_pEntry)->iCurPBO); \
327 } while (0)
328
329#ifdef CR_SERVER_RPW_DEBUG
330DECLINLINE(void) crServerRpwEntryDbgDoVerify(CR_SERVER_RPW_ENTRY *pEntry)
331{
332 int tstMask = 0;
333 int8_t iVal;
334 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pEntry, Draw));
335
336#define CR_VERVER_RPW_ENTRY_DBG_CHECKVAL(_v) do { \
337 iVal = RT_ABS(_v); \
338 Assert(iVal > 0); \
339 Assert(iVal < 5); \
340 Assert(!(tstMask & (1 << iVal))); \
341 tstMask |= (1 << iVal); \
342 } while (0)
343
344 CR_VERVER_RPW_ENTRY_DBG_CHECKVAL(pEntry->iTexDraw);
345 CR_VERVER_RPW_ENTRY_DBG_CHECKVAL(pEntry->iTexSubmitted);
346 CR_VERVER_RPW_ENTRY_DBG_CHECKVAL(pEntry->iTexWorker);
347 CR_VERVER_RPW_ENTRY_DBG_CHECKVAL(pEntry->iTexGpu);
348 Assert(tstMask == 0x1E);
349}
350#endif
351
352DECLINLINE(bool) crServerRpwIsInitialized(const CR_SERVER_RPW *pWorker)
353{
354 return !!pWorker->ctxId;
355}
356int crServerRpwInit(CR_SERVER_RPW *pWorker);
357int crServerRpwTerm(CR_SERVER_RPW *pWorker);
358DECLINLINE(bool) crServerRpwEntryIsInitialized(const CR_SERVER_RPW_ENTRY *pEntry)
359{
360 return !!pEntry->pfnData;
361}
362int crServerRpwEntryInit(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry, uint32_t width, uint32_t height, PFNCR_SERVER_RPW_DATA pfnData);
363int crServerRpwEntryCleanup(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry);
364int crServerRpwEntryResize(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry, uint32_t width, uint32_t height);
365int crServerRpwEntrySubmit(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry);
366int crServerRpwEntryWaitComplete(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry);
367int crServerRpwEntryCancel(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry);
368DECLINLINE(void) crServerRpwEntryDrawSettingsToTex(const CR_SERVER_RPW_ENTRY *pEntry, VBOXVR_TEXTURE *pTex)
369{
370 pTex->width = pEntry->Size.cx;
371 pTex->height = pEntry->Size.cy;
372 pTex->target = GL_TEXTURE_2D;
373 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pEntry, Draw));
374 pTex->hwid = CR_SERVER_RPW_ENTRY_TEX(pEntry, Draw);
375}
376/**/
377
378typedef struct CR_SERVER_CTX_SWITCH
379{
380 GLuint idDrawFBO, idReadFBO;
381 CRContext *pNewCtx;
382 CRContext *pOldCtx;
383} CR_SERVER_CTX_SWITCH;
384
385DECLINLINE(void) crServerCtxSwitchPrepare(CR_SERVER_CTX_SWITCH *pData, CRContext *pNewCtx)
386{
387 CRMuralInfo *pCurrentMural = cr_server.currentMural;
388 CRContextInfo *pCurCtxInfo = cr_server.currentCtxInfo;
389 GLuint idDrawFBO, idReadFBO;
390 CRContext *pCurCtx = pCurCtxInfo ? pCurCtxInfo->pContext : NULL;
391
392 CRASSERT(pCurCtx == crStateGetCurrent());
393
394 if (pCurrentMural)
395 {
396 idDrawFBO = CR_SERVER_FBO_FOR_IDX(pCurrentMural, pCurrentMural->iCurDrawBuffer);
397 idReadFBO = CR_SERVER_FBO_FOR_IDX(pCurrentMural, pCurrentMural->iCurReadBuffer);
398 }
399 else
400 {
401 idDrawFBO = 0;
402 idReadFBO = 0;
403 }
404
405 crStateSwitchPrepare(pNewCtx, pCurCtx, idDrawFBO, idReadFBO);
406
407 pData->idDrawFBO = idDrawFBO;
408 pData->idReadFBO = idReadFBO;
409 pData->pNewCtx = pNewCtx;
410 pData->pOldCtx = pCurCtx;
411}
412
413DECLINLINE(void) crServerCtxSwitchPostprocess(CR_SERVER_CTX_SWITCH *pData)
414{
415 crStateSwitchPostprocess(pData->pOldCtx, pData->pNewCtx, pData->idDrawFBO, pData->idReadFBO);
416}
417
418void crServerInitTmpCtxDispatch();
419
420int crServerVBoxParseNumerics(const char *pszStr, const int defaultVal);
421
422void CrDpRootUpdate(PCR_DISPLAY pDisplay);
423void CrDpEnter(PCR_DISPLAY pDisplay);
424void CrDpLeave(PCR_DISPLAY pDisplay);
425int CrDpInit(PCR_DISPLAY pDisplay);
426void CrDpTerm(PCR_DISPLAY pDisplay);
427
428DECLINLINE(bool) CrDpIsEmpty(PCR_DISPLAY pDisplay)
429{
430 return CrVrScrCompositorIsEmpty(&pDisplay->Mural.Compositor);
431}
432
433int CrDpSaveState(PCR_DISPLAY pDisplay, PSSMHANDLE pSSM);
434int CrDpLoadState(PCR_DISPLAY pDisplay, PSSMHANDLE pSSM, uint32_t version);
435
436void CrDpReparent(PCR_DISPLAY pDisplay, CRScreenInfo *pScreen);
437
438void CrDpResize(PCR_DISPLAY pDisplay, int32_t xPos, int32_t yPos, uint32_t width, uint32_t height);
439void CrDpEntryInit(PCR_DISPLAY_ENTRY pEntry, const VBOXVR_TEXTURE *pTextureData, uint32_t fFlags, PFNVBOXVRSCRCOMPOSITOR_ENTRY_RELEASED pfnEntryReleased);
440void CrDpEntryCleanup(PCR_DISPLAY_ENTRY pEntry);
441int CrDpEntryRegionsSet(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
442int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, CR_DISPLAY_ENTRY_MAP *pMap);
443void CrDpRegionsClear(PCR_DISPLAY pDisplay);
444DECLINLINE(bool) CrDpEntryIsUsed(PCR_DISPLAY_ENTRY pEntry)
445{
446 return CrVrScrCompositorEntryIsInList(&pEntry->CEntry);
447}
448
449DECLINLINE(CRMuralInfo*) CrDpGetMural(PCR_DISPLAY pDisplay)
450{
451 return &pDisplay->Mural;
452}
453
454int CrDemGlobalInit();
455void CrDemTeGlobalTerm();
456void CrDemEnter(PCR_DISPLAY_ENTRY_MAP pMap);
457void CrDemLeave(PCR_DISPLAY_ENTRY_MAP pMap, PCR_DISPLAY_ENTRY pNewEntry, PCR_DISPLAY_ENTRY pReplacedEntry);
458int CrDemInit(PCR_DISPLAY_ENTRY_MAP pMap);
459void CrDemTerm(PCR_DISPLAY_ENTRY_MAP pMap);
460PCR_DISPLAY_ENTRY CrDemEntryAcquire(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture, uint32_t fFlags);
461void CrDemEntryRelease(PCR_DISPLAY_ENTRY pEntry);
462int CrDemEntrySaveState(PCR_DISPLAY_ENTRY pEntry, PSSMHANDLE pSSM);
463int CrDemEntryLoadState(PCR_DISPLAY_ENTRY_MAP pMap, PCR_DISPLAY_ENTRY *ppEntry, PSSMHANDLE pSSM);
464
465int crServerDisplaySaveState(PSSMHANDLE pSSM);
466int crServerDisplayLoadState(PSSMHANDLE pSSM, uint32_t u32Version);
467
468
469void crServerDEntryResized(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry);
470void crServerDEntryMoved(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry);
471void crServerDEntryVibleRegions(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry);
472void crServerDEntryCheckFBO(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry, CRContext *ctx);
473
474void crServerDEntryAllResized(CRMuralInfo *pMural);
475void crServerDEntryAllMoved(CRMuralInfo *pMural);
476void crServerDEntryAllVibleRegions(CRMuralInfo *pMural);
477
478//#define VBOX_WITH_CRSERVER_DUMPER
479#ifdef VBOX_WITH_CRSERVER_DUMPER
480void crServerDumpCheckTerm();
481int crServerDumpCheckInit();
482void crServerDumpBuffer(int idx);
483void crServerDumpTextures();
484void crServerDumpTexture(const VBOXVR_TEXTURE *pTex);
485void crServerDumpShader(GLint id);
486void crServerDumpProgram(GLint id);
487void crServerDumpCurrentProgram();
488void crServerDumpRecompileDumpCurrentProgram();
489void crServerRecompileCurrentProgram();
490void crServerDumpCurrentProgramUniforms();
491void crServerDumpCurrentProgramAttribs();
492void crServerDumpFramesCheck();
493void crServerDumpState();
494void crServerDumpDrawel(const char*pszFormat, ...);
495void crServerDumpDrawelv(GLuint idx, const char*pszElFormat, uint32_t cbEl, const void *pvVal, uint32_t cVal);
496
497extern int64_t g_CrDbgDumpPid;
498extern unsigned long g_CrDbgDumpEnabled;
499extern unsigned long g_CrDbgDumpDraw;
500extern unsigned long g_CrDbgDumpDrawFramesSettings;
501extern unsigned long g_CrDbgDumpDrawFramesAppliedSettings;
502extern unsigned long g_CrDbgDumpDrawFramesCount;
503
504extern uint32_t g_CrDbgDumpVertattrFixupOn;
505
506bool crServerDumpFilterDmp(unsigned long event, CR_DUMPER *pDumper);
507bool crServerDumpFilterOpEnter(unsigned long event, CR_DUMPER *pDumper);
508void crServerDumpFilterOpLeave(unsigned long event, CR_DUMPER *pDumper);
509
510//#define CR_SERVER_DUMP_MASK_OP 0x0000fffc
511//#define CR_SERVER_DUMP_OFF_OP 2
512//
513//#define CR_SERVER_DUMP_MASK_DIR 0x00000003
514//#define CR_SERVER_DUMP_OFF_DIR 0
515//
516//#define CR_SERVER_DUMP_MASK_DMP 0xffff0000
517//#define CR_SERVER_DUMP_OFF_DMP 16
518//
519//#define CR_SERVER_DUMP_MAKE_OP(_v) (1 << ((_v) + CR_SERVER_DUMP_OFF_OP))
520//#define CR_SERVER_DUMP_MAKE_DIR(_v) (1 << ((_v) + CR_SERVER_DUMP_OFF_DIR))
521//#define CR_SERVER_DUMP_MAKE_DMP(_v) (1 << ((_v) + CR_SERVER_DUMP_OFF_DMP))
522//
523//#define CR_SERVER_DUMP_GET_OP(_v) ((_v) & CR_SERVER_DUMP_MASK_OP)
524//#define CR_SERVER_DUMP_GET_DMP(_v) ((_v) & CR_SERVER_DUMP_MASK_DMP)
525//#define CR_SERVER_DUMP_GET_DIR(_v) ((_v) & CR_SERVER_DUMP_MASK_DIR)
526//
527//#define CR_SERVER_DUMP_ISANY_OP(_v1, _v2) (!!(CR_SERVER_DUMP_GET_OP(_v1) & CR_SERVER_DUMP_GET_OP(_v2)))
528//#define CR_SERVER_DUMP_ISANY_DIR(_v1, _v2) (!!(CR_SERVER_DUMP_GET_DIR(_v1) & CR_SERVER_DUMP_GET_DIR(_v2)))
529//#define CR_SERVER_DUMP_ISANY_DMP(_v1, _v2) (!!(CR_SERVER_DUMP_GET_DMP(_v1) & CR_SERVER_DUMP_GET_DMP(_v2)))
530//
531//#define CR_SERVER_DUMP_ISANY_OP(_v1, _v2) ((CR_SERVER_DUMP_GET_OP(_v1) & CR_SERVER_DUMP_GET_OP(_v2)) == CR_SERVER_DUMP_GET_OP(_v2))
532//#define CR_SERVER_DUMP_ISANY_DIR(_v1, _v2) ((CR_SERVER_DUMP_GET_DIR(_v1) & CR_SERVER_DUMP_GET_DIR(_v2)) == CR_SERVER_DUMP_GET_DIR(_v2))
533//#define CR_SERVER_DUMP_ISANY_DMP(_v1, _v2) ((CR_SERVER_DUMP_GET_DMP(_v1) & CR_SERVER_DUMP_GET_DMP(_v2)) == CR_SERVER_DUMP_GET_DMP(_v2))
534//
535//#define CR_SERVER_DUMP_F_DIR_ENTER CR_SERVER_DUMP_MAKE_DIR(0)
536//#define CR_SERVER_DUMP_F_DIR_LEAVE CR_SERVER_DUMP_MAKE_DIR(1)
537//
538//#define CR_SERVER_DUMP_F_OP_DRAW CR_SERVER_DUMP_MAKE_OP(0)
539//#define CR_SERVER_DUMP_F_OP_SWAPBUFFERS CR_SERVER_DUMP_MAKE_OP(1)
540//#define CR_SERVER_DUMP_F_OP_LINK_PROGRAM CR_SERVER_DUMP_MAKE_OP(2)
541//#define CR_SERVER_DUMP_F_OP_COMPILE_PROGRAM CR_SERVER_DUMP_MAKE_OP(3)
542//
543//#define CR_SERVER_DUMP_F_DMP_BUFF CR_SERVER_DUMP_MAKE_DMP(0)
544//#define CR_SERVER_DUMP_F_DMP_TEX CR_SERVER_DUMP_MAKE_DMP(0)
545//#define CR_SERVER_DUMP_F_DMP_PROGRAM CR_SERVER_DUMP_MAKE_DMP(0)
546//#define CR_SERVER_DUMP_F_DMP_PROGRAM_UNIFORMS CR_SERVER_DUMP_MAKE_DMP(0)
547//#define CR_SERVER_DUMP_F_DMP_STATE CR_SERVER_DUMP_MAKE_DMP(0)
548//
549//#define CR_SERVER_DUMP_GET_OP(_v) ((_v) & CR_SERVER_DUMP_MASK_OP)
550//#define CR_SERVER_DUMP_GET_DMP(_v) ((_v) & CR_SERVER_DUMP_MASK_DMP)
551//#define CR_SERVER_DUMP_GET_DIR(_v) ((_v) & CR_SERVER_DUMP_MASK_DIR)
552
553#define CR_SERVER_DUMP_F_DRAW_BUFF_ENTER 0x00000001
554#define CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE 0x00000002
555#define CR_SERVER_DUMP_F_DRAW_STATE_ENTER 0x00000004
556#define CR_SERVER_DUMP_F_DRAW_STATE_LEAVE 0x00000008
557#define CR_SERVER_DUMP_F_DRAW_TEX_ENTER 0x00000010
558#define CR_SERVER_DUMP_F_DRAW_TEX_LEAVE 0x00000020
559#define CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER 0x00000040
560#define CR_SERVER_DUMP_F_DRAW_PROGRAM_LEAVE 0x00000080
561#define CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_ENTER 0x00000100
562#define CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_LEAVE 0x00000200
563#define CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_ENTER 0x00000400
564#define CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_LEAVE 0x00000800
565
566#define CR_SERVER_DUMP_F_DRAW_ENTER_ALL (CR_SERVER_DUMP_F_DRAW_BUFF_ENTER \
567 | CR_SERVER_DUMP_F_DRAW_TEX_ENTER \
568 | CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER \
569 | CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_ENTER \
570 | CR_SERVER_DUMP_F_DRAW_STATE_ENTER \
571 | CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_ENTER)
572
573#define CR_SERVER_DUMP_F_DRAW_LEAVE_ALL (CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE \
574 | CR_SERVER_DUMP_F_DRAW_TEX_LEAVE \
575 | CR_SERVER_DUMP_F_DRAW_PROGRAM_LEAVE \
576 | CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_LEAVE \
577 | CR_SERVER_DUMP_F_DRAW_STATE_LEAVE \
578 | CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_LEAVE)
579
580#define CR_SERVER_DUMP_F_DRAW_ALL (CR_SERVER_DUMP_F_DRAW_ENTER_ALL | CR_SERVER_DUMP_F_DRAW_LEAVE_ALL)
581
582#define CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER 0x00010000
583#define CR_SERVER_DUMP_F_SWAPBUFFERS_LEAVE 0x00020000
584#define CR_SERVER_DUMP_F_TEXPRESENT 0x00040000
585#define CR_SERVER_DUMP_F_DRAWEL 0x00100000
586#define CR_SERVER_DUMP_F_COMPILE_SHADER 0x01000000
587#define CR_SERVER_DUMP_F_SHADER_SOURCE 0x02000000
588#define CR_SERVER_DUMP_F_LINK_PROGRAM 0x04000000
589
590
591#define CR_SERVER_DUMP_DEFAULT_FILTER_OP(_ev) ((((_ev) & g_CrDbgDumpDraw) != 0) \
592 || ((_ev) == CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER && g_CrDbgDumpDrawFramesCount))
593
594#define CR_SERVER_DUMP_DEFAULT_FILTER_DMP(_ev) (((_ev) & g_CrDbgDumpDraw) != 0)
595
596#define CR_SERVER_DUMP_FILTER_OP(_ev, _pDumper) (g_CrDbgDumpEnabled \
597 && (!g_CrDbgDumpPid \
598 || (g_CrDbgDumpPid > 0 && ((uint64_t)g_CrDbgDumpPid) == cr_server.curClient->pid) \
599 || (g_CrDbgDumpPid < 0 && ((uint64_t)(-g_CrDbgDumpPid)) != cr_server.curClient->pid)) \
600 && crServerDumpFilterOpEnter((_ev), (_pDumper)))
601#define CR_SERVER_DUMP_FILTER_DMP(_ev, _pDumper) (crServerDumpFilterDmp((_ev), (_pDumper)))
602
603#define CR_SERVER_DUMP_DRAW_ENTER() do { \
604 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAW_ENTER_ALL, cr_server.Recorder.pDumper)) break; \
605 crServerDumpCheckInit(); \
606 crDmpStrF(cr_server.Recorder.pDumper, "==ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
607 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_STATE_ENTER, cr_server.Recorder.pDumper)) { crServerDumpState(); } \
608 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgram(); } \
609 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_ENTER, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgramUniforms(); } \
610 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_ENTER, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgramAttribs(); } \
611 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_TEX_ENTER, cr_server.Recorder.pDumper)) { crServerDumpTextures(); } \
612 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_BUFF_ENTER, cr_server.Recorder.pDumper)) { crServerDumpBuffer(-1); } \
613 crDmpStrF(cr_server.Recorder.pDumper, "==Done ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
614 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_DRAW_ENTER_ALL, cr_server.Recorder.pDumper); \
615 } while (0)
616
617#define CR_SERVER_DUMP_DRAW_LEAVE() do { \
618 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAW_LEAVE_ALL, cr_server.Recorder.pDumper)) break; \
619 crServerDumpCheckInit(); \
620 crDmpStrF(cr_server.Recorder.pDumper, "==LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
621 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_TEX_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpTextures(); } \
622 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpBuffer(-1); } \
623 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgramUniforms(); } \
624 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgramAttribs(); } \
625 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgram(); } \
626 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_STATE_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpState(); } \
627 crDmpStrF(cr_server.Recorder.pDumper, "==Done LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
628 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_DRAW_LEAVE_ALL, cr_server.Recorder.pDumper); \
629 } while (0)
630
631#define CR_SERVER_DUMP_COMPILE_SHADER(_id) do { \
632 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_COMPILE_SHADER, cr_server.Recorder.pDumper)) break; \
633 crServerDumpCheckInit(); \
634 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
635 crServerDumpShader((_id)); \
636 crDmpStrF(cr_server.Recorder.pDumper, "==Done[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
637 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_COMPILE_SHADER, cr_server.Recorder.pDumper); \
638 } while (0)
639
640#define CR_SERVER_DUMP_SHADER_SOURCE(_id) do { \
641 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_SHADER_SOURCE, cr_server.Recorder.pDumper)) break; \
642 crServerDumpCheckInit(); \
643 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
644 crServerDumpShader((_id)); \
645 crDmpStrF(cr_server.Recorder.pDumper, "==Done[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
646 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_SHADER_SOURCE, cr_server.Recorder.pDumper); \
647 } while (0)
648
649#define CR_SERVER_DUMP_LINK_PROGRAM(_id) do { \
650 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_LINK_PROGRAM, cr_server.Recorder.pDumper)) break; \
651 crServerDumpCheckInit(); \
652 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
653 crServerDumpProgram((_id)); \
654 crDmpStrF(cr_server.Recorder.pDumper, "==Done[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
655 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_LINK_PROGRAM, cr_server.Recorder.pDumper); \
656 } while (0)
657
658#define CR_SERVER_DUMP_SWAPBUFFERS_ENTER() do { \
659 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER, cr_server.Recorder.pDumper)) break; \
660 crServerDumpCheckInit(); \
661 crDmpStrF(cr_server.Recorder.pDumper, "==ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
662 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER, cr_server.Recorder.pDumper)) { crServerDumpBuffer(CR_SERVER_FBO_BB_IDX(cr_server.currentMural)); } \
663 if (g_CrDbgDumpDrawFramesCount) { crServerDumpFramesCheck(); } \
664 crDmpStrF(cr_server.Recorder.pDumper, "==Done ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
665 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER, cr_server.Recorder.pDumper); \
666 } while (0)
667
668#define CR_SERVER_DUMP_TEXPRESENT(_pTex) do { \
669 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_TEXPRESENT, cr_server.Recorder.pDumper)) break; \
670 crServerDumpCheckInit(); \
671 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
672 crServerDumpTexture((_pTex)); \
673 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_TEXPRESENT, cr_server.Recorder.pDumper); \
674 } while (0)
675
676#define CR_SERVER_DUMP_SWAPBUFFERS_LEAVE() do { \
677 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_SWAPBUFFERS_LEAVE, cr_server.Recorder.pDumper)) break; \
678 crDmpStrF(cr_server.Recorder.pDumper, "==LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
679 crServerDumpCheckInit(); \
680 crDmpStrF(cr_server.Recorder.pDumper, "==Done LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
681 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_SWAPBUFFERS_LEAVE, cr_server.Recorder.pDumper); \
682 } while (0)
683
684#define CR_SERVER_DUMP_DRAWEL_F(_msg) do { \
685 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper)) break; \
686 crServerDumpCheckInit(); \
687 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
688 crServerDumpDrawel _msg; \
689 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper); \
690 } while (0)
691
692#define CR_SERVER_DUMP_DRAWEL_V(_index, _pszElFormat, _cbEl, _pvVal, _cVal) do { \
693 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper)) break; \
694 crServerDumpCheckInit(); \
695 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
696 crServerDumpDrawelv((_index), (_pszElFormat), (_cbEl), (_pvVal), (_cVal)); \
697 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper); \
698 } while (0)
699#else /* if !defined VBOX_WITH_CRSERVER_DUMPER */
700#define CR_SERVER_DUMP_DRAW_ENTER() do {} while (0)
701#define CR_SERVER_DUMP_DRAW_LEAVE() do {} while (0)
702#define CR_SERVER_DUMP_COMPILE_SHADER(_id) do {} while (0)
703#define CR_SERVER_DUMP_LINK_PROGRAM(_id) do {} while (0)
704#define CR_SERVER_DUMP_TEXPRESENT(_pTex) do {} while (0)
705#define CR_SERVER_DUMP_SWAPBUFFERS_ENTER() do {} while (0)
706#define CR_SERVER_DUMP_SWAPBUFFERS_LEAVE() do {} while (0)
707#define CR_SERVER_DUMP_SHADER_SOURCE(_id) do {} while (0)
708#define CR_SERVER_DUMP_DRAWEL_F(_msg) do {} while (0)
709#define CR_SERVER_DUMP_DRAWEL_V(_index, _pszElFormat, _cbEl, _pvVal, _cVal) do {} while (0)
710#endif /* !VBOX_WITH_CRSERVER_DUMPER */
711
712RT_C_DECLS_END
713
714#endif /* CR_SERVER_H */
Note: See TracBrowser for help on using the repository browser.

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