1 | /* $Id: server_glsl.c 23277 2009-09-24 09:38:23Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox OpenGL: GLSL related fucntions
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #include "cr_spu.h"
|
---|
24 | #include "chromium.h"
|
---|
25 | #include "cr_error.h"
|
---|
26 | #include "cr_mem.h"
|
---|
27 | #include "cr_net.h"
|
---|
28 | #include "server_dispatch.h"
|
---|
29 | #include "server.h"
|
---|
30 |
|
---|
31 | #ifdef CR_OPENGL_VERSION_2_0
|
---|
32 |
|
---|
33 | void SERVER_DISPATCH_APIENTRY crServerDispatchShaderSource(GLuint shader, GLsizei count, const char ** string, const GLint * length)
|
---|
34 | {
|
---|
35 | /*@todo?crStateShaderSource(shader...);*/
|
---|
36 | cr_server.head_spu->dispatch_table.ShaderSource(crStateGetShaderHWID(shader), count, string, length);
|
---|
37 | }
|
---|
38 |
|
---|
39 | void SERVER_DISPATCH_APIENTRY crServerDispatchCompileShader(GLuint shader)
|
---|
40 | {
|
---|
41 | crStateCompileShader(shader);
|
---|
42 | cr_server.head_spu->dispatch_table.CompileShader(crStateGetShaderHWID(shader));
|
---|
43 | }
|
---|
44 |
|
---|
45 | void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteShader(GLuint shader)
|
---|
46 | {
|
---|
47 | crStateDeleteShader(shader);
|
---|
48 | cr_server.head_spu->dispatch_table.DeleteShader(crStateGetShaderHWID(shader));
|
---|
49 | }
|
---|
50 |
|
---|
51 | void SERVER_DISPATCH_APIENTRY crServerDispatchAttachShader(GLuint program, GLuint shader)
|
---|
52 | {
|
---|
53 | crStateAttachShader(program, shader);
|
---|
54 | cr_server.head_spu->dispatch_table.AttachShader(crStateGetProgramHWID(program), crStateGetShaderHWID(shader));
|
---|
55 | }
|
---|
56 |
|
---|
57 | void SERVER_DISPATCH_APIENTRY crServerDispatchDetachShader(GLuint program, GLuint shader)
|
---|
58 | {
|
---|
59 | crStateDetachShader(program, shader);
|
---|
60 | cr_server.head_spu->dispatch_table.DetachShader(crStateGetProgramHWID(program), crStateGetShaderHWID(shader));
|
---|
61 | }
|
---|
62 |
|
---|
63 | void SERVER_DISPATCH_APIENTRY crServerDispatchLinkProgram(GLuint program)
|
---|
64 | {
|
---|
65 | crStateLinkProgram(program);
|
---|
66 | cr_server.head_spu->dispatch_table.LinkProgram(crStateGetProgramHWID(program));
|
---|
67 | }
|
---|
68 |
|
---|
69 | void SERVER_DISPATCH_APIENTRY crServerDispatchUseProgram(GLuint program)
|
---|
70 | {
|
---|
71 | crStateUseProgram(program);
|
---|
72 | cr_server.head_spu->dispatch_table.UseProgram(crStateGetProgramHWID(program));
|
---|
73 | }
|
---|
74 |
|
---|
75 | void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteProgram(GLuint program)
|
---|
76 | {
|
---|
77 | crStateDeleteProgram(program);
|
---|
78 | cr_server.head_spu->dispatch_table.DeleteProgram(crStateGetProgramHWID(program));
|
---|
79 | }
|
---|
80 |
|
---|
81 | void SERVER_DISPATCH_APIENTRY crServerDispatchValidateProgram(GLuint program)
|
---|
82 | {
|
---|
83 | crStateValidateProgram(program);
|
---|
84 | cr_server.head_spu->dispatch_table.ValidateProgram(crStateGetProgramHWID(program));
|
---|
85 | }
|
---|
86 |
|
---|
87 | void SERVER_DISPATCH_APIENTRY crServerDispatchBindAttribLocation(GLuint program, GLuint index, const char * name)
|
---|
88 | {
|
---|
89 | crStateBindAttribLocation(program, index, name);
|
---|
90 | cr_server.head_spu->dispatch_table.BindAttribLocation(crStateGetProgramHWID(program), index, name);
|
---|
91 | }
|
---|
92 |
|
---|
93 | void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteObjectARB(GLhandleARB obj)
|
---|
94 | {
|
---|
95 | GLuint hwid = crStateGetProgramHWID(obj);
|
---|
96 |
|
---|
97 | if (!hwid)
|
---|
98 | {
|
---|
99 | hwid = crStateGetShaderHWID(obj);
|
---|
100 | crStateDeleteShader(obj);
|
---|
101 | }
|
---|
102 | else
|
---|
103 | {
|
---|
104 | crStateDeleteProgram(obj);
|
---|
105 | }
|
---|
106 |
|
---|
107 | cr_server.head_spu->dispatch_table.DeleteObjectARB(hwid);
|
---|
108 | }
|
---|
109 |
|
---|
110 | #endif /* #ifdef CR_OPENGL_VERSION_2_0 */
|
---|