VirtualBox

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

最後變更 在這個檔案從43287是 40691,由 vboxsync 提交於 13 年 前

crOpenGL: basics for using multiple contexts on host

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 4.0 KB
 
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
21extern uint8_t* g_pvVRamBase;
22extern uint32_t g_cbVRam;
23extern HCRHGSMICMDCOMPLETION g_hCrHgsmiCompletion;
24extern PFNCRHGSMICMDCOMPLETION g_pfnCrHgsmiCompletion;
25
26#define VBOXCRHGSMI_PTR(_off, _t) ((_t*)(g_pvVRamBase + (_off)))
27#define VBOXCRHGSMI_PTR_SAFE(_off, _cb, _t) ((_t*)crServerCrHgsmiPtrGet(_off, _cb))
28
29DECLINLINE(void*) crServerCrHgsmiPtrGet(VBOXVIDEOOFFSET offBuffer, uint32_t cbBuffer)
30{
31 return ((offBuffer) + (cbBuffer) <= g_cbVRam ? VBOXCRHGSMI_PTR(offBuffer, void) : NULL);
32}
33
34DECLINLINE(void) crServerCrHgsmiCmdComplete(struct VBOXVDMACMD_CHROMIUM_CMD *pCmd, int cmdProcessingRc)
35{
36 g_pfnCrHgsmiCompletion(g_hCrHgsmiCompletion, pCmd, cmdProcessingRc);
37}
38
39#define VBOXCRHGSMI_CMD_COMPLETE(_pData, _rc) do { \
40 CRVBOXHGSMI_CMDDATA_ASSERT_ISSET(_pData); \
41 CRVBOXHGSMI_CMDDATA_RC(_pData, _rc); \
42 crServerCrHgsmiCmdComplete((_pData)->pCmd, VINF_SUCCESS); \
43 } while (0)
44
45#define VBOXCRHGSMI_CMD_CHECK_COMPLETE(_pData, _rc) do { \
46 if (CRVBOXHGSMI_CMDDATA_IS_SET(_pData)) { \
47 VBOXCRHGSMI_CMD_COMPLETE(_pData, _rc); \
48 } \
49 } while (0)
50
51#endif
52
53/*
54 * This is the base number for window and context IDs
55 */
56#define MAGIC_OFFSET 5000
57
58extern CRServer cr_server;
59
60/* Semaphore wait queue node */
61typedef struct _wqnode {
62 RunQueue *q;
63 struct _wqnode *next;
64} wqnode;
65
66typedef struct {
67 GLuint count;
68 GLuint num_waiting;
69 RunQueue **waiting;
70} CRServerBarrier;
71
72typedef struct {
73 GLuint count;
74 wqnode *waiting, *tail;
75} CRServerSemaphore;
76
77typedef struct {
78 GLuint id;
79 GLint projParamStart;
80 GLfloat projMat[16]; /* projection matrix, accumulated via calls to */
81 /* glProgramLocalParameterARB, glProgramParameterNV */
82} CRServerProgram;
83
84void crServerSetVBoxConfiguration();
85void crServerSetVBoxConfigurationHGCM();
86void crServerInitDispatch(void);
87void crServerReturnValue( const void *payload, unsigned int payload_len );
88void crServerWriteback(void);
89int crServerRecv( CRConnection *conn, CRMessage *msg, unsigned int len );
90void crServerSerializeRemoteStreams(void);
91void crServerAddToRunQueue( CRClient *client );
92void crServerDeleteClient( CRClient *client );
93
94
95void crServerApplyBaseProjection( const CRmatrix *baseProj );
96void crServerApplyViewMatrix( const CRmatrix *view );
97void crServerSetOutputBounds( const CRMuralInfo *mural, int extNum );
98void crServerComputeViewportBounds( const CRViewportState *v, CRMuralInfo *mural );
99
100GLboolean crServerInitializeBucketing(CRMuralInfo *mural);
101
102void crComputeOverlapGeom(double *quads, int nquad, CRPoly ***res);
103void crComputeKnockoutGeom(double *quads, int nquad, int my_quad_idx, CRPoly **res);
104
105int crServerGetCurrentEye(void);
106
107GLboolean crServerClientInBeginEnd(const CRClient *client);
108
109GLint crServerDispatchCreateContextEx(const char *dpyName, GLint visualBits, GLint shareCtx, GLint preloadCtxID, int32_t internalID);
110GLint crServerDispatchWindowCreateEx(const char *dpyName, GLint visBits, GLint preloadWinID);
111
112void crServerCreateInfoDeleteCB(void *data);
113
114GLint crServerGenerateID(GLint *pCounter);
115
116GLint crServerSPUWindowID(GLint serverWindow);
117
118GLuint crServerTranslateProgramID(GLuint id);
119
120void crServerSetupOutputRedirect(CRMuralInfo *mural);
121void crServerCheckMuralGeometry(CRMuralInfo *mural);
122GLboolean crServerSupportRedirMuralFBO(void);
123void crServerRedirMuralFBO(CRMuralInfo *mural, GLboolean redir);
124void crServerCreateMuralFBO(CRMuralInfo *mural);
125void crServerDeleteMuralFBO(CRMuralInfo *mural);
126void crServerPresentFBO(CRMuralInfo *mural);
127GLboolean crServerIsRedirectedToFBO();
128
129int32_t crVBoxServerInternalClientRead(CRClient *pClient, uint8_t *pBuffer, uint32_t *pcbBuffer);
130
131#endif /* CR_SERVER_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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