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 | /*
|
---|
19 | * This is the base number for window and context IDs
|
---|
20 | */
|
---|
21 | #define MAGIC_OFFSET 5000
|
---|
22 |
|
---|
23 | extern CRServer cr_server;
|
---|
24 |
|
---|
25 | /* Semaphore wait queue node */
|
---|
26 | typedef struct _wqnode {
|
---|
27 | RunQueue *q;
|
---|
28 | struct _wqnode *next;
|
---|
29 | } wqnode;
|
---|
30 |
|
---|
31 | typedef struct {
|
---|
32 | GLuint count;
|
---|
33 | GLuint num_waiting;
|
---|
34 | RunQueue **waiting;
|
---|
35 | } CRServerBarrier;
|
---|
36 |
|
---|
37 | typedef struct {
|
---|
38 | GLuint count;
|
---|
39 | wqnode *waiting, *tail;
|
---|
40 | } CRServerSemaphore;
|
---|
41 |
|
---|
42 | typedef struct {
|
---|
43 | GLuint id;
|
---|
44 | GLint projParamStart;
|
---|
45 | GLfloat projMat[16]; /* projection matrix, accumulated via calls to */
|
---|
46 | /* glProgramLocalParameterARB, glProgramParameterNV */
|
---|
47 | } CRServerProgram;
|
---|
48 |
|
---|
49 | typedef struct {
|
---|
50 | char *pszDpyName;
|
---|
51 | GLint visualBits;
|
---|
52 | int32_t internalID;
|
---|
53 | } CRCreateInfo_t;
|
---|
54 |
|
---|
55 | void crServerSetVBoxConfiguration();
|
---|
56 | void crServerSetVBoxConfigurationHGCM();
|
---|
57 | void crServerInitDispatch(void);
|
---|
58 | void crServerReturnValue( const void *payload, unsigned int payload_len );
|
---|
59 | void crServerWriteback(void);
|
---|
60 | int crServerRecv( CRConnection *conn, CRMessage *msg, unsigned int len );
|
---|
61 | void crServerSerializeRemoteStreams(void);
|
---|
62 | void crServerAddToRunQueue( CRClient *client );
|
---|
63 | void crServerDeleteClient( CRClient *client );
|
---|
64 |
|
---|
65 |
|
---|
66 | void crServerApplyBaseProjection( const CRmatrix *baseProj );
|
---|
67 | void crServerApplyViewMatrix( const CRmatrix *view );
|
---|
68 | void crServerSetOutputBounds( const CRMuralInfo *mural, int extNum );
|
---|
69 | void crServerComputeViewportBounds( const CRViewportState *v, CRMuralInfo *mural );
|
---|
70 |
|
---|
71 | GLboolean crServerInitializeBucketing(CRMuralInfo *mural);
|
---|
72 |
|
---|
73 | void crComputeOverlapGeom(double *quads, int nquad, CRPoly ***res);
|
---|
74 | void crComputeKnockoutGeom(double *quads, int nquad, int my_quad_idx, CRPoly **res);
|
---|
75 |
|
---|
76 | int crServerGetCurrentEye(void);
|
---|
77 |
|
---|
78 | GLboolean crServerClientInBeginEnd(const CRClient *client);
|
---|
79 |
|
---|
80 | GLint crServerDispatchCreateContextEx(const char *dpyName, GLint visualBits, GLint shareCtx, GLint preloadCtxID, int32_t internalID);
|
---|
81 | GLint crServerDispatchWindowCreateEx(const char *dpyName, GLint visBits, GLint preloadWinID);
|
---|
82 |
|
---|
83 | void crServerCreateInfoDeleteCB(void *data);
|
---|
84 |
|
---|
85 | GLint crServerGenerateID(GLint *pCounter);
|
---|
86 |
|
---|
87 | GLint crServerSPUWindowID(GLint serverWindow);
|
---|
88 |
|
---|
89 | GLuint crServerTranslateProgramID(GLuint id);
|
---|
90 |
|
---|
91 | void crServerCheckMuralGeometry(CRMuralInfo *mural);
|
---|
92 | GLboolean crServerSupportRedirMuralFBO(void);
|
---|
93 | void crServerRedirMuralFBO(CRMuralInfo *mural, GLboolean redir);
|
---|
94 | void crServerCreateMuralFBO(CRMuralInfo *mural);
|
---|
95 | void crServerDeleteMuralFBO(CRMuralInfo *mural);
|
---|
96 | void crServerPresentFBO(CRMuralInfo *mural);
|
---|
97 | GLboolean crServerIsRedirectedToFBO();
|
---|
98 |
|
---|
99 | #endif /* CR_SERVER_H */
|
---|