VirtualBox

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

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

wddm/graphics/crogl: more new command submission fixes

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