Changeset 23274 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Timestamp:
- Sep 24, 2009 9:31:32 AM (15 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c
r22220 r23274 2 2 3 3 /** @file 4 * VBox OpenGL GLSL related functions4 * VBox OpenGL GLSL related get functions 5 5 */ 6 6 … … 49 49 crServerReturnValue(&zero, sizeof(zero)); 50 50 } 51 cr_server.head_spu->dispatch_table.GetActiveAttrib( program, index, bufSize, &pLocal->length, &pLocal->size, &pLocal->type, (char*)&pLocal[1]);51 cr_server.head_spu->dispatch_table.GetActiveAttrib(crStateGetProgramHWID(program), index, bufSize, &pLocal->length, &pLocal->size, &pLocal->type, (char*)&pLocal[1]); 52 52 crServerReturnValue(pLocal, pLocal->length+1+sizeof(crGetActive_t)); 53 53 crFree(pLocal); … … 65 65 crServerReturnValue(&zero, sizeof(zero)); 66 66 } 67 cr_server.head_spu->dispatch_table.GetActiveUniform( program, index, bufSize, &pLocal->length, &pLocal->size, &pLocal->type, (char*)&pLocal[1]);67 cr_server.head_spu->dispatch_table.GetActiveUniform(crStateGetProgramHWID(program), index, bufSize, &pLocal->length, &pLocal->size, &pLocal->type, (char*)&pLocal[1]); 68 68 crServerReturnValue(pLocal, pLocal->length+1+sizeof(crGetActive_t)); 69 69 crFree(pLocal); … … 80 80 crServerReturnValue(&zero, sizeof(zero)); 81 81 } 82 cr_server.head_spu->dispatch_table.GetAttachedShaders(program, maxCount, pLocal, (GLuint*)&pLocal[1]); 82 cr_server.head_spu->dispatch_table.GetAttachedShaders(crStateGetProgramHWID(program), maxCount, pLocal, (GLuint*)&pLocal[1]); 83 84 { 85 GLsizei i; 86 GLuint *ids=(GLuint*)&pLocal[1]; 87 88 for (i=0; i<*pLocal; ++i); 89 ids[i] = crStateGLSLShaderHWIDtoID(ids[i]); 90 } 91 83 92 crServerReturnValue(pLocal, (*pLocal)*sizeof(GLuint)+sizeof(GLsizei)); 84 93 crFree(pLocal); … … 95 104 crServerReturnValue(&zero, sizeof(zero)); 96 105 } 97 cr_server.head_spu->dispatch_table.GetAttachedObjectsARB(containerObj, maxCount, pLocal, (GLhandleARB*)&pLocal[1]); 106 cr_server.head_spu->dispatch_table.GetAttachedObjectsARB(crStateGetProgramHWID(containerObj), maxCount, pLocal, (GLhandleARB*)&pLocal[1]); 107 108 { 109 GLsizei i; 110 GLuint *ids=(GLuint*)&pLocal[1]; 111 112 for (i=0; i<*pLocal; ++i); 113 ids[i] = crStateGLSLShaderHWIDtoID(ids[i]); 114 } 115 98 116 crServerReturnValue(pLocal, (*pLocal)*sizeof(GLhandleARB)+sizeof(GLsizei)); 99 117 crFree(pLocal); … … 103 121 { 104 122 GLsizei *pLocal; 123 GLuint hwid; 105 124 106 125 pLocal = (GLsizei*) crAlloc(maxLength+sizeof(GLsizei)); … … 110 129 crServerReturnValue(&zero, sizeof(zero)); 111 130 } 112 cr_server.head_spu->dispatch_table.GetInfoLogARB(obj, maxLength, pLocal, (char*)&pLocal[1]); 131 /*@todo: recheck*/ 132 hwid = crStateGetProgramHWID(obj); 133 if (!hwid) hwid = crStateGetShaderHWID(obj); 134 cr_server.head_spu->dispatch_table.GetInfoLogARB(hwid, maxLength, pLocal, (char*)&pLocal[1]); 113 135 crServerReturnValue(pLocal, (*pLocal)+1+sizeof(GLsizei)); 114 136 crFree(pLocal); … … 125 147 crServerReturnValue(&zero, sizeof(zero)); 126 148 } 127 cr_server.head_spu->dispatch_table.GetShaderInfoLog( shader, bufSize, pLocal, (char*)&pLocal[1]);149 cr_server.head_spu->dispatch_table.GetShaderInfoLog(crStateGetShaderHWID(shader), bufSize, pLocal, (char*)&pLocal[1]); 128 150 crServerReturnValue(pLocal, (*pLocal)+1+sizeof(GLsizei)); 129 151 crFree(pLocal); … … 140 162 crServerReturnValue(&zero, sizeof(zero)); 141 163 } 142 cr_server.head_spu->dispatch_table.GetProgramInfoLog( program, bufSize, pLocal, (char*)&pLocal[1]);164 cr_server.head_spu->dispatch_table.GetProgramInfoLog(crStateGetProgramHWID(program), bufSize, pLocal, (char*)&pLocal[1]); 143 165 crServerReturnValue(pLocal, (*pLocal)+1+sizeof(GLsizei)); 144 166 crFree(pLocal); … … 155 177 crServerReturnValue(&zero, sizeof(zero)); 156 178 } 157 cr_server.head_spu->dispatch_table.GetShaderSource( shader, bufSize, pLocal, (char*)pLocal+1);179 cr_server.head_spu->dispatch_table.GetShaderSource(crStateGetShaderHWID(shader), bufSize, pLocal, (char*)pLocal+1); 158 180 crServerReturnValue(pLocal, (*pLocal)+1+sizeof(GLsizei)); 159 181 crFree(pLocal); … … 166 188 167 189 /*@todo: check if index and location is the same*/ 168 cr_server.head_spu->dispatch_table.GetActiveUniform(program, location, 0, NULL, &size, &type, NULL); 169 170 switch (type) 171 { 172 case GL_FLOAT: 173 size = 1; 174 break; 175 case GL_FLOAT_VEC2: 176 size = 2; 177 break; 178 case GL_FLOAT_VEC3: 179 size = 3; 180 break; 181 case GL_FLOAT_VEC4: 182 size = 4; 183 break; 184 case GL_INT: 185 size = 1; 186 break; 187 case GL_INT_VEC2: 188 size = 2; 189 break; 190 case GL_INT_VEC3: 191 size = 3; 192 break; 193 case GL_INT_VEC4: 194 size = 4; 195 break; 196 case GL_BOOL: 197 size = 1; 198 break; 199 case GL_BOOL_VEC2: 200 size = 2; 201 break; 202 case GL_BOOL_VEC3: 203 size = 3; 204 break; 205 case GL_BOOL_VEC4: 206 size = 4; 207 break; 208 case GL_FLOAT_MAT2: 209 size = 8; 210 break; 211 case GL_FLOAT_MAT3: 212 size = 12; 213 break; 214 case GL_FLOAT_MAT4: 215 size = 16; 216 break; 217 case GL_SAMPLER_1D: 218 case GL_SAMPLER_2D: 219 case GL_SAMPLER_3D: 220 case GL_SAMPLER_CUBE: 221 case GL_SAMPLER_1D_SHADOW: 222 case GL_SAMPLER_2D_SHADOW: 223 size = 1; 224 break; 225 #ifdef CR_OPENGL_VERSION_2_1 226 case GL_FLOAT_MAT2x3: 227 size = 8; 228 break; 229 case GL_FLOAT_MAT2x4: 230 size = 8; 231 break; 232 case GL_FLOAT_MAT3x2: 233 size = 12; 234 break; 235 case GL_FLOAT_MAT3x4: 236 size = 12; 237 break; 238 case GL_FLOAT_MAT4x2: 239 size = 16; 240 break; 241 case GL_FLOAT_MAT4x3: 242 size = 16; 243 break; 244 #endif 245 default: 246 crWarning("__GetUniformSize: unknown uniform type 0x%x", (GLint)type); 247 size = 16; 248 break; 249 } 250 251 return size; 190 cr_server.head_spu->dispatch_table.GetActiveUniform(crStateGetProgramHWID(program), location, 0, NULL, &size, &type, NULL); 191 192 return crStateGetUniformSize(type); 252 193 } 253 194 … … 264 205 } 265 206 266 cr_server.head_spu->dispatch_table.GetUniformfv( program, location, pLocal);207 cr_server.head_spu->dispatch_table.GetUniformfv(crStateGetProgramHWID(program), location, pLocal); 267 208 268 209 crServerReturnValue(pLocal, size); … … 282 223 } 283 224 284 cr_server.head_spu->dispatch_table.GetUniformiv( program, location, pLocal);225 cr_server.head_spu->dispatch_table.GetUniformiv(crStateGetProgramHWID(program), location, pLocal); 285 226 286 227 crServerReturnValue(pLocal, size); … … 288 229 } 289 230 231 GLuint SERVER_DISPATCH_APIENTRY crServerDispatchCreateShader(GLenum type) 232 { 233 GLuint retval; 234 retval = cr_server.head_spu->dispatch_table.CreateShader(type); 235 crStateCreateShader(retval, type); 236 crServerReturnValue(&retval, sizeof(retval)); 237 return retval; /* ignored */ 238 } 239 240 GLuint SERVER_DISPATCH_APIENTRY crServerDispatchCreateProgram(void) 241 { 242 GLuint retval; 243 retval = cr_server.head_spu->dispatch_table.CreateProgram(); 244 crStateCreateProgram(retval); 245 crServerReturnValue(&retval, sizeof(retval)); 246 return retval; /* ignored */ 247 } 248 249 GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsShader(GLuint shader) 250 { 251 GLboolean retval; 252 retval = cr_server.head_spu->dispatch_table.IsShader(crStateGetShaderHWID(shader)); 253 crServerReturnValue(&retval, sizeof(retval)); 254 return retval; /* ignored */ 255 } 256 257 GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsProgram(GLuint program) 258 { 259 GLboolean retval; 260 retval = cr_server.head_spu->dispatch_table.IsProgram(crStateGetProgramHWID(program)); 261 crServerReturnValue(&retval, sizeof(retval)); 262 return retval; /* ignored */ 263 } 264 290 265 #endif /* #ifdef CR_OPENGL_VERSION_2_0 */ -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_simpleget.py
r21308 r23274 61 61 CRASSERT(tablesize/sizeof(%s)==1); 62 62 texid = (GLuint) *get_values; 63 *get_values = (%s) crServerTranslateTextureID(texid);63 *get_values = (%s) (texid - cr_server.curClient->number * 100000); 64 64 } 65 """ % (types[index], types[index]) 65 else if (GL_CURRENT_PROGRAM==pname) 66 { 67 GLuint programid; 68 CRASSERT(tablesize/sizeof(%s)==1); 69 programid = (GLuint) *get_values; 70 *get_values = (%s) crStateGLSLProgramHWIDtoID(programid); 71 } 72 """ % (types[index], types[index], types[index], types[index]) 66 73 print '\tcrServerReturnValue( get_values, tablesize );' 67 74 print '\tcrFree(get_values);' -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_special
r23094 r23274 204 204 FramebufferRenderbufferEXT 205 205 GetFramebufferAttachmentParameterivEXT 206 CreateShader 207 CreateProgram 208 ShaderSource 209 IsShader 210 IsProgram 211 CompileShader 212 DeleteShader 213 AttachShader 214 DetachShader 215 LinkProgram 216 UseProgram 217 DeleteProgram 218 ValidateProgram 219 BindAttribLocation 220 DeleteObjectARB
Note:
See TracChangeset
for help on using the changeset viewer.