VirtualBox

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

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

wddm/crOpenGL/DevVGA: blitting enhancements and cleanup + bugfixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 32.3 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#include <cr_htable.h>
18#include <cr_compositor.h>
19
20#ifdef VBOX_WITH_CRHGSMI
21# include <VBox/VBoxVideo.h>
22
23#include <iprt/cdefs.h>
24
25RT_C_DECLS_BEGIN
26
27extern uint8_t* g_pvVRamBase;
28extern uint32_t g_cbVRam;
29extern HCRHGSMICMDCOMPLETION g_hCrHgsmiCompletion;
30extern PFNCRHGSMICMDCOMPLETION g_pfnCrHgsmiCompletion;
31
32#define VBOXCRHGSMI_PTR(_off, _t) ((_t*)(g_pvVRamBase + (_off)))
33#define VBOXCRHGSMI_PTR_SAFE(_off, _cb, _t) ((_t*)crServerCrHgsmiPtrGet(_off, _cb))
34
35DECLINLINE(void*) crServerCrHgsmiPtrGet(VBOXVIDEOOFFSET offBuffer, uint32_t cbBuffer)
36{
37 return ((offBuffer) + (cbBuffer) <= g_cbVRam ? VBOXCRHGSMI_PTR(offBuffer, void) : NULL);
38}
39
40DECLINLINE(void) crServerCrHgsmiCmdComplete(struct VBOXVDMACMD_CHROMIUM_CMD *pCmd, int cmdProcessingRc)
41{
42 g_pfnCrHgsmiCompletion(g_hCrHgsmiCompletion, pCmd, cmdProcessingRc);
43}
44
45#define VBOXCRHGSMI_CMD_COMPLETE(_pData, _rc) do { \
46 CRVBOXHGSMI_CMDDATA_ASSERT_ISSET(_pData); \
47 CRVBOXHGSMI_CMDDATA_RC(_pData, _rc); \
48 if (CRVBOXHGSMI_CMDDATA_IS_HGSMICMD(_pData)) { \
49 Assert(CRVBOXHGSMI_CMDDATA_IS_HGSMICMD(_pData)); \
50 crServerCrHgsmiCmdComplete((_pData)->pHgsmiCmd, VINF_SUCCESS); \
51 } \
52 } while (0)
53
54#define VBOXCRHGSMI_CMD_CHECK_COMPLETE(_pData, _rc) do { \
55 if (CRVBOXHGSMI_CMDDATA_IS_SET(_pData)) {\
56 VBOXCRHGSMI_CMD_COMPLETE(_pData, _rc); \
57 } \
58 } while (0)
59
60#endif
61
62/*
63 * This is the base number for window and context IDs
64 */
65#define MAGIC_OFFSET 5000
66
67extern CRServer cr_server;
68
69/* Semaphore wait queue node */
70typedef struct _wqnode {
71 RunQueue *q;
72 struct _wqnode *next;
73} wqnode;
74
75typedef struct {
76 GLuint count;
77 GLuint num_waiting;
78 RunQueue **waiting;
79} CRServerBarrier;
80
81typedef struct {
82 GLuint count;
83 wqnode *waiting, *tail;
84} CRServerSemaphore;
85
86typedef struct {
87 GLuint id;
88 GLint projParamStart;
89 GLfloat projMat[16]; /* projection matrix, accumulated via calls to */
90 /* glProgramLocalParameterARB, glProgramParameterNV */
91} CRServerProgram;
92
93void crServerSetVBoxConfiguration();
94void crServerSetVBoxConfigurationHGCM();
95void crServerInitDispatch(void);
96void crServerReturnValue( const void *payload, unsigned int payload_len );
97void crServerWriteback(void);
98int crServerRecv( CRConnection *conn, CRMessage *msg, unsigned int len );
99void crServerSerializeRemoteStreams(void);
100void crServerAddToRunQueue( CRClient *client );
101void crServerDeleteClient( CRClient *client );
102
103
104void crServerApplyBaseProjection( const CRmatrix *baseProj );
105void crServerApplyViewMatrix( const CRmatrix *view );
106void crServerSetOutputBounds( const CRMuralInfo *mural, int extNum );
107void crServerComputeViewportBounds( const CRViewportState *v, CRMuralInfo *mural );
108
109GLboolean crServerInitializeBucketing(CRMuralInfo *mural);
110
111void crComputeOverlapGeom(double *quads, int nquad, CRPoly ***res);
112void crComputeKnockoutGeom(double *quads, int nquad, int my_quad_idx, CRPoly **res);
113
114int crServerGetCurrentEye(void);
115
116GLboolean crServerClientInBeginEnd(const CRClient *client);
117
118GLint crServerDispatchCreateContextEx(const char *dpyName, GLint visualBits, GLint shareCtx, GLint preloadCtxID, int32_t internalID);
119GLint crServerDispatchWindowCreateEx(const char *dpyName, GLint visBits, GLint preloadWinID);
120GLint crServerMuralInit(CRMuralInfo *mural, GLboolean fGuestWindow, GLint visBits, GLint preloadWinID);
121void crServerMuralTerm(CRMuralInfo *mural);
122GLboolean crServerMuralSize(CRMuralInfo *mural, GLint width, GLint height);
123void crServerMuralPosition(CRMuralInfo *mural, GLint x, GLint y);
124void crServerMuralVisibleRegion( CRMuralInfo *mural, GLint cRects, const GLint *pRects );
125void crServerMuralShow( CRMuralInfo *mural, GLint state );
126
127GLint crServerGenerateID(GLint *pCounter);
128
129GLint crServerSPUWindowID(GLint serverWindow);
130
131GLuint crServerTranslateProgramID(GLuint id);
132
133CRMuralInfo * crServerGetDummyMural(GLint visualBits);
134
135void crServerCheckMuralGeometry(CRMuralInfo *mural);
136void crServerCheckAllMuralGeometry(CRMuralInfo *pMI);
137GLboolean crServerSupportRedirMuralFBO(void);
138
139void crVBoxServerMuralFbResizeBegin(HCR_FRAMEBUFFER hFb);
140void crVBoxServerMuralFbResizeEnd(HCR_FRAMEBUFFER hFb);
141
142void crVBoxServerNotifyEvent(int32_t idScreen, uint32_t uEvent, void*pvData);
143
144void crServerRedirMuralFbClear(CRMuralInfo *mural);
145
146void crServerWindowReparent(CRMuralInfo *pMural);
147
148void crServerRedirMuralFBO(CRMuralInfo *mural, bool fEnabled);
149void crServerDeleteMuralFBO(CRMuralInfo *mural);
150void crServerPresentFBO(CRMuralInfo *mural);
151GLboolean crServerIsRedirectedToFBO();
152GLint crServerMuralFBOIdxFromBufferName(CRMuralInfo *mural, GLenum buffer);
153void crServerMuralFBOSwapBuffers(CRMuralInfo *mural);
154
155HCR_FRAMEBUFFER CrPMgrFbGetFirstEnabled();
156HCR_FRAMEBUFFER CrPMgrFbGetNextEnabled(HCR_FRAMEBUFFER hFb);
157HCR_FRAMEBUFFER CrPMgrFbGetFirstInitialized();
158HCR_FRAMEBUFFER CrPMgrFbGetNextInitialized(HCR_FRAMEBUFFER hFb);
159
160int CrFbRegionsClear(HCR_FRAMEBUFFER hFb);
161
162
163#define CR_SERVER_FBO_BB_IDX(_mural) ((_mural)->iBbBuffer)
164#define CR_SERVER_FBO_FB_IDX(_mural) (((_mural)->iBbBuffer + 1) % ((_mural)->cBuffers))
165/* returns a valid index to be used for negative _idx, i.e. for GL_NONE cases */
166//#define CR_SERVER_FBO_ADJUST_IDX(_mural, _idx) ((_idx) >= 0 ? (_idx) : CR_SERVER_FBO_BB_IDX(_mural))
167/* just a helper that uses CR_SERVER_FBO_ADJUST_IDX for getting mural's FBO id for buffer index*/
168//#define CR_SERVER_FBO_FOR_IDX(_mural, _idx) ((_mural)->aidFBOs[CR_SERVER_FBO_ADJUST_IDX((_mural), (_idx))])
169//#define CR_SERVER_FBO_TEX_FOR_IDX(_mural, _idx) ((_mural)->aidColorTexs[CR_SERVER_FBO_ADJUST_IDX((_mural), (_idx))])
170#define CR_SERVER_FBO_FOR_IDX(_mural, _idx) ((_idx) >= 0 ? (_mural)->aidFBOs[(_idx)] : 0)
171#define CR_SERVER_FBO_TEX_FOR_IDX(_mural, _idx) ((_idx) >= 0 ? (_mural)->aidColorTexs[(_idx)] : 0)
172
173int32_t crVBoxServerInternalClientRead(CRClient *pClient, uint8_t *pBuffer, uint32_t *pcbBuffer);
174
175void crServerPerformMakeCurrent( CRMuralInfo *mural, CRContextInfo *ctxInfo );
176
177PCR_BLITTER crServerVBoxBlitterGet();
178PCR_BLITTER crServerVBoxBlitterGetInitialized();
179
180DECLINLINE(void) crServerVBoxBlitterWinInit(CR_BLITTER_WINDOW *win, CRMuralInfo *mural)
181{
182 win->Base.id = mural->spuWindow;
183 win->Base.visualBits = mural->CreateInfo.realVisualBits;
184 win->width = mural->width;
185 win->height = mural->height;
186}
187
188DECLINLINE(void) crServerVBoxBlitterCtxInit(CR_BLITTER_CONTEXT *ctx, CRContextInfo *ctxInfo)
189{
190 ctx->Base.id = ctxInfo->SpuContext;
191 if (ctx->Base.id < 0)
192 ctx->Base.id = cr_server.MainContextInfo.SpuContext;
193 ctx->Base.visualBits = cr_server.curClient->currentCtxInfo->CreateInfo.realVisualBits;
194}
195
196/* display worker thread.
197 * see comments for CR_SERVER_RPW struct definition in cr_server.h */
198DECLINLINE(void) crServerXchgI8(int8_t *pu8Val1, int8_t *pu8Val2)
199{
200 int8_t tmp;
201 tmp = *pu8Val1;
202 *pu8Val1 = *pu8Val2;
203 *pu8Val2 = tmp;
204}
205
206#ifdef DEBUG
207# define CR_GLERR_CHECK(_op) do { \
208 GLenum status; \
209 while ((status = cr_server.head_spu->dispatch_table.GetError()) != GL_NO_ERROR) {/*Assert(0);*/} \
210 _op \
211 while ((status = cr_server.head_spu->dispatch_table.GetError()) != GL_NO_ERROR) {Assert(0);} \
212 } while (0)
213#else
214# define CR_GLERR_CHECK(_op) do { \
215 _op \
216 } while (0)
217#endif
218
219#ifdef DEBUG_misha
220# define CR_SERVER_RPW_DEBUG
221#endif
222/* *
223 * _name : Draw, Submitted, Worker, Gpu
224 */
225
226#ifdef CR_SERVER_RPW_DEBUG
227# define crServerRpwEntryDbgVerify(_pE) crServerRpwEntryDbgDoVerify(_pE)
228#else
229# define crServerRpwEntryDbgVerify(_pE) do {} while (0)
230#endif
231
232
233#define CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _name) ((_pEntry)->iTex##_name > 0)
234
235#define CR_SERVER_RPW_ENTRY_TEX_INVALIDATE(_pEntry, _name) do { \
236 crServerRpwEntryDbgVerify(_pEntry); \
237 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _name)); \
238 (_pEntry)->iTex##_name = -(_pEntry)->iTex##_name; \
239 crServerRpwEntryDbgVerify(_pEntry); \
240 } while (0)
241
242#define CR_SERVER_RPW_ENTRY_TEX_PROMOTE(_pEntry, _fromName, _toName) do { \
243 crServerRpwEntryDbgVerify(_pEntry); \
244 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _fromName)); \
245 Assert(!CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _toName)); \
246 crServerXchgI8(&(_pEntry)->iTex##_fromName, &(_pEntry)->iTex##_toName); \
247 crServerRpwEntryDbgVerify(_pEntry); \
248 } while (0)
249
250#define CR_SERVER_RPW_ENTRY_TEX_XCHG_VALID(_pEntry, _fromName, _toName) do { \
251 crServerRpwEntryDbgVerify(_pEntry); \
252 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _fromName)); \
253 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _toName)); \
254 crServerXchgI8(&(_pEntry)->iTex##_fromName, &(_pEntry)->iTex##_toName); \
255 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _fromName)); \
256 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _toName)); \
257 crServerRpwEntryDbgVerify(_pEntry); \
258 } while (0)
259
260
261#define CR_SERVER_RPW_ENTRY_TEX_PROMOTE_KEEPVALID(_pEntry, _fromName, _toName) do { \
262 crServerRpwEntryDbgVerify(_pEntry); \
263 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _fromName)); \
264 Assert(!CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _toName)); \
265 crServerXchgI8(&(_pEntry)->iTex##_fromName, &(_pEntry)->iTex##_toName); \
266 (_pEntry)->iTex##_fromName = -(_pEntry)->iTex##_fromName; \
267 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _fromName)); \
268 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(_pEntry, _toName)); \
269 crServerRpwEntryDbgVerify(_pEntry); \
270 } while (0)
271
272#define CR_SERVER_RPW_ENTRY_TEX(_pEntry, _name) ((_pEntry)->aidWorkerTexs[(_pEntry)->iTex##_name - 1])
273
274#define CR_SERVER_RPW_ENTRY_PBO_NEXT_ID(_i) (((_i) + 1) % 2)
275#define CR_SERVER_RPW_ENTRY_PBO_IS_ACTIVE(_pEntry) ((_pEntry)->iCurPBO >= 0)
276#define CR_SERVER_RPW_ENTRY_PBO_CUR(_pEntry) ((_pEntry)->aidPBOs[(_pEntry)->iCurPBO])
277#define CR_SERVER_RPW_ENTRY_PBO_COMPLETED(_pEntry) ((_pEntry)->aidPBOs[CR_SERVER_RPW_ENTRY_PBO_NEXT_ID((_pEntry)->iCurPBO)])
278#define CR_SERVER_RPW_ENTRY_PBO_FLIP(_pEntry) do { \
279 (_pEntry)->iCurPBO = CR_SERVER_RPW_ENTRY_PBO_NEXT_ID((_pEntry)->iCurPBO); \
280 } while (0)
281
282#ifdef CR_SERVER_RPW_DEBUG
283DECLINLINE(void) crServerRpwEntryDbgDoVerify(CR_SERVER_RPW_ENTRY *pEntry)
284{
285 int tstMask = 0;
286 int8_t iVal;
287 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pEntry, Draw));
288
289#define CR_VERVER_RPW_ENTRY_DBG_CHECKVAL(_v) do { \
290 iVal = RT_ABS(_v); \
291 Assert(iVal > 0); \
292 Assert(iVal < 5); \
293 Assert(!(tstMask & (1 << iVal))); \
294 tstMask |= (1 << iVal); \
295 } while (0)
296
297 CR_VERVER_RPW_ENTRY_DBG_CHECKVAL(pEntry->iTexDraw);
298 CR_VERVER_RPW_ENTRY_DBG_CHECKVAL(pEntry->iTexSubmitted);
299 CR_VERVER_RPW_ENTRY_DBG_CHECKVAL(pEntry->iTexWorker);
300 CR_VERVER_RPW_ENTRY_DBG_CHECKVAL(pEntry->iTexGpu);
301 Assert(tstMask == 0x1E);
302}
303#endif
304
305DECLINLINE(bool) crServerRpwIsInitialized(const CR_SERVER_RPW *pWorker)
306{
307 return !!pWorker->ctxId;
308}
309int crServerRpwInit(CR_SERVER_RPW *pWorker);
310int crServerRpwTerm(CR_SERVER_RPW *pWorker);
311DECLINLINE(bool) crServerRpwEntryIsInitialized(const CR_SERVER_RPW_ENTRY *pEntry)
312{
313 return !!pEntry->pfnData;
314}
315int crServerRpwEntryInit(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry, uint32_t width, uint32_t height, PFNCR_SERVER_RPW_DATA pfnData);
316int crServerRpwEntryCleanup(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry);
317int crServerRpwEntryResize(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry, uint32_t width, uint32_t height);
318int crServerRpwEntrySubmit(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry);
319int crServerRpwEntryWaitComplete(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry);
320int crServerRpwEntryCancel(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry);
321DECLINLINE(void) crServerRpwEntryDrawSettingsToTex(const CR_SERVER_RPW_ENTRY *pEntry, VBOXVR_TEXTURE *pTex)
322{
323 pTex->width = pEntry->Size.cx;
324 pTex->height = pEntry->Size.cy;
325 pTex->target = GL_TEXTURE_2D;
326 Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pEntry, Draw));
327 pTex->hwid = CR_SERVER_RPW_ENTRY_TEX(pEntry, Draw);
328}
329/**/
330
331typedef struct CR_SERVER_CTX_SWITCH
332{
333 GLuint idDrawFBO, idReadFBO;
334 CRContext *pNewCtx;
335 CRContext *pOldCtx;
336} CR_SERVER_CTX_SWITCH;
337
338DECLINLINE(void) crServerCtxSwitchPrepare(CR_SERVER_CTX_SWITCH *pData, CRContext *pNewCtx)
339{
340 CRMuralInfo *pCurrentMural = cr_server.currentMural;
341 CRContextInfo *pCurCtxInfo = cr_server.currentCtxInfo;
342 GLuint idDrawFBO, idReadFBO;
343 CRContext *pCurCtx = pCurCtxInfo ? pCurCtxInfo->pContext : NULL;
344
345 CRASSERT(pCurCtx == crStateGetCurrent());
346
347 if (pCurrentMural)
348 {
349 idDrawFBO = CR_SERVER_FBO_FOR_IDX(pCurrentMural, pCurrentMural->iCurDrawBuffer);
350 idReadFBO = CR_SERVER_FBO_FOR_IDX(pCurrentMural, pCurrentMural->iCurReadBuffer);
351 }
352 else
353 {
354 idDrawFBO = 0;
355 idReadFBO = 0;
356 }
357
358 crStateSwitchPrepare(pNewCtx, pCurCtx, idDrawFBO, idReadFBO);
359
360 pData->idDrawFBO = idDrawFBO;
361 pData->idReadFBO = idReadFBO;
362 pData->pNewCtx = pNewCtx;
363 pData->pOldCtx = pCurCtx;
364}
365
366DECLINLINE(void) crServerCtxSwitchPostprocess(CR_SERVER_CTX_SWITCH *pData)
367{
368 crStateSwitchPostprocess(pData->pOldCtx, pData->pNewCtx, pData->idDrawFBO, pData->idReadFBO);
369}
370
371void crServerInitTmpCtxDispatch();
372
373int crServerVBoxParseNumerics(const char *pszStr, const int defaultVal);
374
375typedef struct CR_FBMAP
376{
377 uint8_t Map[(CR_MAX_GUEST_MONITORS+7)/8];
378} CR_FBMAP;
379
380DECLINLINE(void) CrFBmInit(CR_FBMAP *pMap)
381{
382 memset(pMap, 0, sizeof (*pMap));
383}
384
385DECLINLINE(bool) CrFBmIsSet(CR_FBMAP *pMap, uint32_t i)
386{
387 return ASMBitTest(&pMap->Map, i);
388}
389
390DECLINLINE(void) CrFBmSet(CR_FBMAP *pMap, uint32_t i)
391{
392 ASMBitSet(&pMap->Map, i);
393}
394
395DECLINLINE(void) CrFBmSetAtomic(CR_FBMAP *pMap, uint32_t i)
396{
397 ASMAtomicBitSet(&pMap->Map, i);
398}
399
400DECLINLINE(void) CrFBmClear(CR_FBMAP *pMap, uint32_t i)
401{
402 ASMBitClear(&pMap->Map, i);
403}
404
405/*helper function that calls CrFbUpdateBegin for all enabled framebuffers */
406int CrPMgrHlpGlblUpdateBegin(CR_FBMAP *pMap);
407/*helper function that calls CrFbUpdateEnd for all framebuffers being updated */
408void CrPMgrHlpGlblUpdateEnd(CR_FBMAP *pMap);
409HCR_FRAMEBUFFER CrPMgrFbGetFirstEnabled();
410HCR_FRAMEBUFFER CrPMgrFbGetNextEnabled(HCR_FRAMEBUFFER hFb);
411HCR_FRAMEBUFFER CrPMgrFbGetEnabled(uint32_t idScreen);
412int CrPMgrModeVrdp(bool fEnable);
413int CrPMgrModeRootVr(bool fEnable);
414int CrPMgrModeWinVisible(bool fEnable);
415int CrPMgrRootVrUpdate();
416int CrPMgrViewportUpdate(uint32_t idScreen);
417int CrPMgrScreenChanged(uint32_t idScreen);
418int CrPMgrNotifyResize(HCR_FRAMEBUFFER hFb);
419int CrPMgrSaveState(PSSMHANDLE pSSM);
420int CrPMgrLoadState(PSSMHANDLE pSSM, uint32_t version);
421HCR_FRAMEBUFFER CrPMgrFbGet(uint32_t idScreen);
422/*cleanup stuff*/
423
424int CrPMgrInit();
425void CrPMgrTerm();
426
427typedef DECLCALLBACKPTR(bool, PFNCR_FRAMEBUFFER_ENTRIES_VISITOR_CB)(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext);
428
429bool CrFbHas3DData(HCR_FRAMEBUFFER hFb);
430void CrFbVisitCreatedEntries(HCR_FRAMEBUFFER hFb, PFNCR_FRAMEBUFFER_ENTRIES_VISITOR_CB pfnVisitorCb, void *pvContext);
431int CrFbResize(HCR_FRAMEBUFFER hFb, const struct VBVAINFOSCREEN * pScreen, void *pvVRAM);
432int CrFbBltGetContents(HCR_FRAMEBUFFER hFb, const RTRECT *pSrcRect, const RTRECT *pDstRect, uint32_t cRects, const RTRECT *pPrects, CR_BLITTER_IMG *pImg);
433bool CrFbIsEnabled(HCR_FRAMEBUFFER hFb);
434int CrFbEntryCreateForTexId(HCR_FRAMEBUFFER hFb, GLuint idTex, uint32_t fFlags, HCR_FRAMEBUFFER_ENTRY *phEntry);
435int CrFbEntryCreateForTexData(HCR_FRAMEBUFFER hFb, struct CR_TEXDATA *pTex, uint32_t fFlags, HCR_FRAMEBUFFER_ENTRY *phEntry);
436void CrFbEntryAddRef(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry);
437void CrFbEntryRelease(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry);
438const struct VBVAINFOSCREEN* CrFbGetScreenInfo(HCR_FRAMEBUFFER hFb);
439void* CrFbGetVRAM(HCR_FRAMEBUFFER hFb);
440const struct VBOXVR_SCR_COMPOSITOR* CrFbGetCompositor(HCR_FRAMEBUFFER hFb);
441const struct VBOXVR_SCR_COMPOSITOR_ENTRY* CrFbEntryGetCompositorEntry(HCR_FRAMEBUFFER_ENTRY hEntry);
442
443/* start doing modifications to the framebuffer */
444int CrFbUpdateBegin(HCR_FRAMEBUFFER hFb);
445/*below commands can only be used in Framebuffer update mode, i.e. after the CrFbUpdateBegin succeeded */
446int CrFbEntryRegions(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry);
447
448/* complete doing modifications to the framebuffer */
449void CrFbUpdateEnd(HCR_FRAMEBUFFER hFb);
450
451int CrFbEntryRegionsAdd(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated);
452int CrFbEntryRegionsSet(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated);
453
454int CrFbEntryTexDataUpdate(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY pEntry, struct CR_TEXDATA *pTex);
455
456CRHTABLE_HANDLE CrFbDDataAllocSlot(HCR_FRAMEBUFFER hFb);
457
458typedef DECLCALLBACKPTR(void, PFNCR_FRAMEBUFFER_SLOT_RELEASE_CB)(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext);
459
460void CrFbDDataReleaseSlot(HCR_FRAMEBUFFER hFb, CRHTABLE_HANDLE hSlot, PFNCR_FRAMEBUFFER_SLOT_RELEASE_CB pfnReleaseCb, void *pvContext);
461int CrFbDDataEntryPut(HCR_FRAMEBUFFER_ENTRY hEntry, CRHTABLE_HANDLE hSlot, void *pvData);
462void* CrFbDDataEntryClear(HCR_FRAMEBUFFER_ENTRY hEntry, CRHTABLE_HANDLE hSlot);
463void* CrFbDDataEntryGet(HCR_FRAMEBUFFER_ENTRY hEntry, CRHTABLE_HANDLE hSlot);
464
465CR_TEXDATA* CrFbTexDataCreate(const VBOXVR_TEXTURE *pTex);
466void CrFbTexDataInit(CR_TEXDATA* pFbTex, const VBOXVR_TEXTURE *pTex, PFNCRTEXDATA_RELEASED pfnTextureReleased);
467
468int8_t crVBoxServerCrCmdBltProcess(const VBOXCMDVBVA_BLT_HDR *pCmd, uint32_t cbCmd);
469int8_t crVBoxServerCrCmdFlipProcess(const VBOXCMDVBVA_FLIP *pFlip);
470
471//#define VBOX_WITH_CRSERVER_DUMPER
472#ifdef VBOX_WITH_CRSERVER_DUMPER
473void crServerDumpCheckTerm();
474int crServerDumpCheckInit();
475void crServerDumpBuffer(int idx);
476void crServerDumpTextures();
477void crServerDumpTexture(const VBOXVR_TEXTURE *pTex);
478void crServerDumpShader(GLint id);
479void crServerDumpProgram(GLint id);
480void crServerDumpCurrentProgram();
481void crServerDumpRecompileDumpCurrentProgram();
482void crServerRecompileCurrentProgram();
483void crServerDumpCurrentProgramUniforms();
484void crServerDumpCurrentProgramAttribs();
485void crServerDumpFramesCheck();
486void crServerDumpState();
487void crServerDumpDrawel(const char*pszFormat, ...);
488void crServerDumpDrawelv(GLuint idx, const char*pszElFormat, uint32_t cbEl, const void *pvVal, uint32_t cVal);
489
490extern int64_t g_CrDbgDumpPid;
491extern unsigned long g_CrDbgDumpEnabled;
492extern unsigned long g_CrDbgDumpDraw;
493extern unsigned long g_CrDbgDumpDrawFramesSettings;
494extern unsigned long g_CrDbgDumpDrawFramesAppliedSettings;
495extern unsigned long g_CrDbgDumpDrawFramesCount;
496
497extern uint32_t g_CrDbgDumpVertattrFixupOn;
498
499bool crServerDumpFilterDmp(unsigned long event, CR_DUMPER *pDumper);
500bool crServerDumpFilterOpEnter(unsigned long event, CR_DUMPER *pDumper);
501void crServerDumpFilterOpLeave(unsigned long event, CR_DUMPER *pDumper);
502
503//#define CR_SERVER_DUMP_MASK_OP 0x0000fffc
504//#define CR_SERVER_DUMP_OFF_OP 2
505//
506//#define CR_SERVER_DUMP_MASK_DIR 0x00000003
507//#define CR_SERVER_DUMP_OFF_DIR 0
508//
509//#define CR_SERVER_DUMP_MASK_DMP 0xffff0000
510//#define CR_SERVER_DUMP_OFF_DMP 16
511//
512//#define CR_SERVER_DUMP_MAKE_OP(_v) (1 << ((_v) + CR_SERVER_DUMP_OFF_OP))
513//#define CR_SERVER_DUMP_MAKE_DIR(_v) (1 << ((_v) + CR_SERVER_DUMP_OFF_DIR))
514//#define CR_SERVER_DUMP_MAKE_DMP(_v) (1 << ((_v) + CR_SERVER_DUMP_OFF_DMP))
515//
516//#define CR_SERVER_DUMP_GET_OP(_v) ((_v) & CR_SERVER_DUMP_MASK_OP)
517//#define CR_SERVER_DUMP_GET_DMP(_v) ((_v) & CR_SERVER_DUMP_MASK_DMP)
518//#define CR_SERVER_DUMP_GET_DIR(_v) ((_v) & CR_SERVER_DUMP_MASK_DIR)
519//
520//#define CR_SERVER_DUMP_ISANY_OP(_v1, _v2) (!!(CR_SERVER_DUMP_GET_OP(_v1) & CR_SERVER_DUMP_GET_OP(_v2)))
521//#define CR_SERVER_DUMP_ISANY_DIR(_v1, _v2) (!!(CR_SERVER_DUMP_GET_DIR(_v1) & CR_SERVER_DUMP_GET_DIR(_v2)))
522//#define CR_SERVER_DUMP_ISANY_DMP(_v1, _v2) (!!(CR_SERVER_DUMP_GET_DMP(_v1) & CR_SERVER_DUMP_GET_DMP(_v2)))
523//
524//#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))
525//#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))
526//#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))
527//
528//#define CR_SERVER_DUMP_F_DIR_ENTER CR_SERVER_DUMP_MAKE_DIR(0)
529//#define CR_SERVER_DUMP_F_DIR_LEAVE CR_SERVER_DUMP_MAKE_DIR(1)
530//
531//#define CR_SERVER_DUMP_F_OP_DRAW CR_SERVER_DUMP_MAKE_OP(0)
532//#define CR_SERVER_DUMP_F_OP_SWAPBUFFERS CR_SERVER_DUMP_MAKE_OP(1)
533//#define CR_SERVER_DUMP_F_OP_LINK_PROGRAM CR_SERVER_DUMP_MAKE_OP(2)
534//#define CR_SERVER_DUMP_F_OP_COMPILE_PROGRAM CR_SERVER_DUMP_MAKE_OP(3)
535//
536//#define CR_SERVER_DUMP_F_DMP_BUFF CR_SERVER_DUMP_MAKE_DMP(0)
537//#define CR_SERVER_DUMP_F_DMP_TEX CR_SERVER_DUMP_MAKE_DMP(0)
538//#define CR_SERVER_DUMP_F_DMP_PROGRAM CR_SERVER_DUMP_MAKE_DMP(0)
539//#define CR_SERVER_DUMP_F_DMP_PROGRAM_UNIFORMS CR_SERVER_DUMP_MAKE_DMP(0)
540//#define CR_SERVER_DUMP_F_DMP_STATE CR_SERVER_DUMP_MAKE_DMP(0)
541//
542//#define CR_SERVER_DUMP_GET_OP(_v) ((_v) & CR_SERVER_DUMP_MASK_OP)
543//#define CR_SERVER_DUMP_GET_DMP(_v) ((_v) & CR_SERVER_DUMP_MASK_DMP)
544//#define CR_SERVER_DUMP_GET_DIR(_v) ((_v) & CR_SERVER_DUMP_MASK_DIR)
545
546#define CR_SERVER_DUMP_F_DRAW_BUFF_ENTER 0x00000001
547#define CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE 0x00000002
548#define CR_SERVER_DUMP_F_DRAW_STATE_ENTER 0x00000004
549#define CR_SERVER_DUMP_F_DRAW_STATE_LEAVE 0x00000008
550#define CR_SERVER_DUMP_F_DRAW_TEX_ENTER 0x00000010
551#define CR_SERVER_DUMP_F_DRAW_TEX_LEAVE 0x00000020
552#define CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER 0x00000040
553#define CR_SERVER_DUMP_F_DRAW_PROGRAM_LEAVE 0x00000080
554#define CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_ENTER 0x00000100
555#define CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_LEAVE 0x00000200
556#define CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_ENTER 0x00000400
557#define CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_LEAVE 0x00000800
558
559#define CR_SERVER_DUMP_F_DRAW_ENTER_ALL (CR_SERVER_DUMP_F_DRAW_BUFF_ENTER \
560 | CR_SERVER_DUMP_F_DRAW_TEX_ENTER \
561 | CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER \
562 | CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_ENTER \
563 | CR_SERVER_DUMP_F_DRAW_STATE_ENTER \
564 | CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_ENTER)
565
566#define CR_SERVER_DUMP_F_DRAW_LEAVE_ALL (CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE \
567 | CR_SERVER_DUMP_F_DRAW_TEX_LEAVE \
568 | CR_SERVER_DUMP_F_DRAW_PROGRAM_LEAVE \
569 | CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_LEAVE \
570 | CR_SERVER_DUMP_F_DRAW_STATE_LEAVE \
571 | CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_LEAVE)
572
573#define CR_SERVER_DUMP_F_DRAW_ALL (CR_SERVER_DUMP_F_DRAW_ENTER_ALL | CR_SERVER_DUMP_F_DRAW_LEAVE_ALL)
574
575#define CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER 0x00010000
576#define CR_SERVER_DUMP_F_SWAPBUFFERS_LEAVE 0x00020000
577#define CR_SERVER_DUMP_F_TEXPRESENT 0x00040000
578#define CR_SERVER_DUMP_F_DRAWEL 0x00100000
579#define CR_SERVER_DUMP_F_COMPILE_SHADER 0x01000000
580#define CR_SERVER_DUMP_F_SHADER_SOURCE 0x02000000
581#define CR_SERVER_DUMP_F_LINK_PROGRAM 0x04000000
582
583
584#define CR_SERVER_DUMP_DEFAULT_FILTER_OP(_ev) ((((_ev) & g_CrDbgDumpDraw) != 0) \
585 || ((_ev) == CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER && g_CrDbgDumpDrawFramesCount))
586
587#define CR_SERVER_DUMP_DEFAULT_FILTER_DMP(_ev) (((_ev) & g_CrDbgDumpDraw) != 0)
588
589#define CR_SERVER_DUMP_FILTER_OP(_ev, _pDumper) (g_CrDbgDumpEnabled \
590 && (!g_CrDbgDumpPid \
591 || (g_CrDbgDumpPid > 0 && ((uint64_t)g_CrDbgDumpPid) == cr_server.curClient->pid) \
592 || (g_CrDbgDumpPid < 0 && ((uint64_t)(-g_CrDbgDumpPid)) != cr_server.curClient->pid)) \
593 && crServerDumpFilterOpEnter((_ev), (_pDumper)))
594#define CR_SERVER_DUMP_FILTER_DMP(_ev, _pDumper) (crServerDumpFilterDmp((_ev), (_pDumper)))
595
596#define CR_SERVER_DUMP_DRAW_ENTER() do { \
597 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAW_ENTER_ALL, cr_server.Recorder.pDumper)) break; \
598 crServerDumpCheckInit(); \
599 crDmpStrF(cr_server.Recorder.pDumper, "==ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
600 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_STATE_ENTER, cr_server.Recorder.pDumper)) { crServerDumpState(); } \
601 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgram(); } \
602 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_ENTER, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgramUniforms(); } \
603 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_ENTER, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgramAttribs(); } \
604 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_TEX_ENTER, cr_server.Recorder.pDumper)) { crServerDumpTextures(); } \
605 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_BUFF_ENTER, cr_server.Recorder.pDumper)) { crServerDumpBuffer(-1); } \
606 crDmpStrF(cr_server.Recorder.pDumper, "==Done ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
607 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_DRAW_ENTER_ALL, cr_server.Recorder.pDumper); \
608 } while (0)
609
610#define CR_SERVER_DUMP_DRAW_LEAVE() do { \
611 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAW_LEAVE_ALL, cr_server.Recorder.pDumper)) break; \
612 crServerDumpCheckInit(); \
613 crDmpStrF(cr_server.Recorder.pDumper, "==LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
614 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_TEX_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpTextures(); } \
615 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpBuffer(-1); } \
616 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgramUniforms(); } \
617 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgramAttribs(); } \
618 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgram(); } \
619 if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_STATE_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpState(); } \
620 crDmpStrF(cr_server.Recorder.pDumper, "==Done LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
621 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_DRAW_LEAVE_ALL, cr_server.Recorder.pDumper); \
622 } while (0)
623
624#define CR_SERVER_DUMP_COMPILE_SHADER(_id) do { \
625 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_COMPILE_SHADER, cr_server.Recorder.pDumper)) break; \
626 crServerDumpCheckInit(); \
627 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
628 crServerDumpShader((_id)); \
629 crDmpStrF(cr_server.Recorder.pDumper, "==Done[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
630 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_COMPILE_SHADER, cr_server.Recorder.pDumper); \
631 } while (0)
632
633#define CR_SERVER_DUMP_SHADER_SOURCE(_id) do { \
634 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_SHADER_SOURCE, cr_server.Recorder.pDumper)) break; \
635 crServerDumpCheckInit(); \
636 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
637 crServerDumpShader((_id)); \
638 crDmpStrF(cr_server.Recorder.pDumper, "==Done[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
639 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_SHADER_SOURCE, cr_server.Recorder.pDumper); \
640 } while (0)
641
642#define CR_SERVER_DUMP_LINK_PROGRAM(_id) do { \
643 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_LINK_PROGRAM, cr_server.Recorder.pDumper)) break; \
644 crServerDumpCheckInit(); \
645 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
646 crServerDumpProgram((_id)); \
647 crDmpStrF(cr_server.Recorder.pDumper, "==Done[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
648 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_LINK_PROGRAM, cr_server.Recorder.pDumper); \
649 } while (0)
650
651#define CR_SERVER_DUMP_SWAPBUFFERS_ENTER() do { \
652 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER, cr_server.Recorder.pDumper)) break; \
653 crServerDumpCheckInit(); \
654 crDmpStrF(cr_server.Recorder.pDumper, "==ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
655 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)); } \
656 if (g_CrDbgDumpDrawFramesCount) { crServerDumpFramesCheck(); } \
657 crDmpStrF(cr_server.Recorder.pDumper, "==Done ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
658 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER, cr_server.Recorder.pDumper); \
659 } while (0)
660
661#define CR_SERVER_DUMP_TEXPRESENT(_pTex) do { \
662 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_TEXPRESENT, cr_server.Recorder.pDumper)) break; \
663 crServerDumpCheckInit(); \
664 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
665 crServerDumpTexture((_pTex)); \
666 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_TEXPRESENT, cr_server.Recorder.pDumper); \
667 } while (0)
668
669#define CR_SERVER_DUMP_SWAPBUFFERS_LEAVE() do { \
670 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_SWAPBUFFERS_LEAVE, cr_server.Recorder.pDumper)) break; \
671 crDmpStrF(cr_server.Recorder.pDumper, "==LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
672 crServerDumpCheckInit(); \
673 crDmpStrF(cr_server.Recorder.pDumper, "==Done LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
674 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_SWAPBUFFERS_LEAVE, cr_server.Recorder.pDumper); \
675 } while (0)
676
677#define CR_SERVER_DUMP_DRAWEL_F(_msg) do { \
678 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper)) break; \
679 crServerDumpCheckInit(); \
680 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
681 crServerDumpDrawel _msg; \
682 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper); \
683 } while (0)
684
685#define CR_SERVER_DUMP_DRAWEL_V(_index, _pszElFormat, _cbEl, _pvVal, _cVal) do { \
686 if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper)) break; \
687 crServerDumpCheckInit(); \
688 crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
689 crServerDumpDrawelv((_index), (_pszElFormat), (_cbEl), (_pvVal), (_cVal)); \
690 crServerDumpFilterOpLeave(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper); \
691 } while (0)
692#else /* if !defined VBOX_WITH_CRSERVER_DUMPER */
693#define CR_SERVER_DUMP_DRAW_ENTER() do {} while (0)
694#define CR_SERVER_DUMP_DRAW_LEAVE() do {} while (0)
695#define CR_SERVER_DUMP_COMPILE_SHADER(_id) do {} while (0)
696#define CR_SERVER_DUMP_LINK_PROGRAM(_id) do {} while (0)
697#define CR_SERVER_DUMP_TEXPRESENT(_pTex) do {} while (0)
698#define CR_SERVER_DUMP_SWAPBUFFERS_ENTER() do {} while (0)
699#define CR_SERVER_DUMP_SWAPBUFFERS_LEAVE() do {} while (0)
700#define CR_SERVER_DUMP_SHADER_SOURCE(_id) do {} while (0)
701#define CR_SERVER_DUMP_DRAWEL_F(_msg) do {} while (0)
702#define CR_SERVER_DUMP_DRAWEL_V(_index, _pszElFormat, _cbEl, _pvVal, _cVal) do {} while (0)
703#endif /* !VBOX_WITH_CRSERVER_DUMPER */
704
705RT_C_DECLS_END
706
707#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