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 | #include "chromium.h"
|
---|
8 | #include "cr_error.h"
|
---|
9 | #include "cr_mem.h"
|
---|
10 | #include "server_dispatch.h"
|
---|
11 | #include "server.h"
|
---|
12 |
|
---|
13 | void * SERVER_DISPATCH_APIENTRY
|
---|
14 | crServerDispatchMapBufferARB( GLenum target, GLenum access )
|
---|
15 | {
|
---|
16 | return NULL;
|
---|
17 | }
|
---|
18 |
|
---|
19 | GLboolean SERVER_DISPATCH_APIENTRY
|
---|
20 | crServerDispatchUnmapBufferARB( GLenum target )
|
---|
21 | {
|
---|
22 | return GL_FALSE;
|
---|
23 | }
|
---|
24 |
|
---|
25 | void SERVER_DISPATCH_APIENTRY
|
---|
26 | crServerDispatchGenBuffersARB(GLsizei n, GLuint *buffers)
|
---|
27 | {
|
---|
28 | GLuint *local_buffers;
|
---|
29 | (void) buffers;
|
---|
30 |
|
---|
31 | if (n >= INT32_MAX / sizeof(GLuint))
|
---|
32 | {
|
---|
33 | crError("crServerDispatchGenBuffersARB: parameter 'n' is out of range");
|
---|
34 | return;
|
---|
35 | }
|
---|
36 |
|
---|
37 | local_buffers = (GLuint *)crCalloc(n * sizeof(*local_buffers));
|
---|
38 |
|
---|
39 | if (!local_buffers)
|
---|
40 | {
|
---|
41 | crError("crServerDispatchGenBuffersARB: out of memory");
|
---|
42 | return;
|
---|
43 | }
|
---|
44 |
|
---|
45 | crStateGenBuffersARB(n, local_buffers);
|
---|
46 |
|
---|
47 | crServerReturnValue( local_buffers, n * sizeof(*local_buffers) );
|
---|
48 | crFree( local_buffers );
|
---|
49 | }
|
---|
50 |
|
---|
51 | void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteBuffersARB( GLsizei n, const GLuint * buffer )
|
---|
52 | {
|
---|
53 | crStateDeleteBuffersARB( n, buffer );
|
---|
54 | }
|
---|
55 |
|
---|
56 | void SERVER_DISPATCH_APIENTRY
|
---|
57 | crServerDispatchGetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params)
|
---|
58 | {
|
---|
59 | crError( "glGetBufferPointervARB isn't *ever* allowed to be on the wire!" );
|
---|
60 | (void) target;
|
---|
61 | (void) pname;
|
---|
62 | (void) params;
|
---|
63 | }
|
---|
64 |
|
---|
65 | void SERVER_DISPATCH_APIENTRY
|
---|
66 | crServerDispatchGetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data)
|
---|
67 | {
|
---|
68 | void *b;
|
---|
69 |
|
---|
70 | b = crCalloc(size);
|
---|
71 | if (b) {
|
---|
72 | cr_server.head_spu->dispatch_table.GetBufferSubDataARB( target, offset, size, b );
|
---|
73 |
|
---|
74 | crServerReturnValue( b, size );
|
---|
75 | crFree( b );
|
---|
76 | }
|
---|
77 | else {
|
---|
78 | crError("Out of memory in crServerDispatchGetBufferSubDataARB");
|
---|
79 | }
|
---|
80 | }
|
---|
81 |
|
---|
82 | void SERVER_DISPATCH_APIENTRY
|
---|
83 | crServerDispatchBindBufferARB(GLenum target, GLuint buffer)
|
---|
84 | {
|
---|
85 | crStateBindBufferARB(target, buffer);
|
---|
86 | cr_server.head_spu->dispatch_table.BindBufferARB(target, crStateGetBufferHWID(buffer));
|
---|
87 | }
|
---|
88 |
|
---|
89 | GLboolean SERVER_DISPATCH_APIENTRY
|
---|
90 | crServerDispatchIsBufferARB(GLuint buffer)
|
---|
91 | {
|
---|
92 | /* since GenBuffersARB issued to host ogl only on bind + some other ops, the host drivers may not know about them
|
---|
93 | * so use state data*/
|
---|
94 | GLboolean retval = crStateIsBufferARB(buffer);
|
---|
95 | crServerReturnValue( &retval, sizeof(retval) );
|
---|
96 | return retval; /* WILL PROBABLY BE IGNORED */
|
---|
97 | }
|
---|