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 crServerInitializeTiling(CRMuralInfo *mural);
|
---|
58 | void crServerInitDispatch(void);
|
---|
59 | void crServerReturnValue( const void *payload, unsigned int payload_len );
|
---|
60 | void crServerWriteback(void);
|
---|
61 | int crServerRecv( CRConnection *conn, CRMessage *msg, unsigned int len );
|
---|
62 | void crServerSerializeRemoteStreams(void);
|
---|
63 | void crServerAddToRunQueue( CRClient *client );
|
---|
64 | void crServerDeleteClient( CRClient *client );
|
---|
65 |
|
---|
66 |
|
---|
67 | void crServerApplyBaseProjection( const CRmatrix *baseProj );
|
---|
68 | void crServerApplyViewMatrix( const CRmatrix *view );
|
---|
69 | void crServerSetOutputBounds( const CRMuralInfo *mural, int extNum );
|
---|
70 | void crServerComputeViewportBounds( const CRViewportState *v, CRMuralInfo *mural );
|
---|
71 |
|
---|
72 | GLboolean crServerInitializeBucketing(CRMuralInfo *mural);
|
---|
73 |
|
---|
74 | void crServerNewMuralTiling(CRMuralInfo *mural, GLint muralWidth, GLint muralHeight, GLint numTiles, const GLint *tileBounds);
|
---|
75 |
|
---|
76 | void crComputeOverlapGeom(double *quads, int nquad, CRPoly ***res);
|
---|
77 | void crComputeKnockoutGeom(double *quads, int nquad, int my_quad_idx, CRPoly **res);
|
---|
78 |
|
---|
79 | int crServerGetCurrentEye(void);
|
---|
80 |
|
---|
81 | GLboolean crServerClientInBeginEnd(const CRClient *client);
|
---|
82 |
|
---|
83 | GLint crServerDispatchCreateContextEx(const char *dpyName, GLint visualBits, GLint shareCtx, GLint preloadCtxID, int32_t internalID);
|
---|
84 | GLint crServerDispatchWindowCreateEx(const char *dpyName, GLint visBits, GLint preloadWinID);
|
---|
85 |
|
---|
86 | void crServerCreateInfoDeleteCB(void *data);
|
---|
87 |
|
---|
88 | GLint crServerGenerateID(GLint *pCounter);
|
---|
89 |
|
---|
90 | GLint crServerSPUWindowID(GLint serverWindow);
|
---|
91 |
|
---|
92 | GLuint crServerTranslateTextureID(GLuint id);
|
---|
93 | GLuint crServerTranslateProgramID(GLuint id);
|
---|
94 |
|
---|
95 | #endif /* CR_SERVER_H */
|
---|