Changeset 55013 in vbox
- Timestamp:
- Mar 30, 2015 5:03:12 PM (9 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Files:
-
- 2 edited
-
server_lists.c (modified) (3 diffs)
-
server_texture.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_lists.c
r54934 r55013 281 281 282 282 283 void SERVER_DISPATCH_APIENTRY crServerDispatchBindTexture( GLenum target, GLuint texture )284 {285 crStateBindTexture( target, texture );286 cr_server.head_spu->dispatch_table.BindTexture(target, crStateGetTextureHWID(texture));287 }288 289 void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteTextures( GLsizei n, const GLuint *textures)290 {291 GLuint *newTextures = (GLuint *) crAlloc(n * sizeof(GLuint));292 GLint i;293 294 if (!newTextures)295 {296 crError("crServerDispatchDeleteTextures: out of memory");297 return;298 }299 300 for (i = 0; i < n; i++)301 {302 newTextures[i] = crStateGetTextureHWID(textures[i]);303 }304 305 // for (i = 0; i < n; ++i)306 // {307 // crDebug("DeleteTexture: %d, pid %d, ctx %d", textures[i], (uint32_t)cr_server.curClient->pid, cr_server.currentCtxInfo->pContext->id);308 // }309 310 311 crStateDeleteTextures(n, textures);312 cr_server.head_spu->dispatch_table.DeleteTextures(n, newTextures);313 crFree(newTextures);314 }315 316 void SERVER_DISPATCH_APIENTRY crServerDispatchPrioritizeTextures( GLsizei n, const GLuint * textures, const GLclampf * priorities )317 {318 GLuint *newTextures = (GLuint *) crAlloc(n * sizeof(GLuint));319 GLint i;320 321 if (!newTextures)322 {323 crError("crServerDispatchDeleteTextures: out of memory");324 return;325 }326 327 crStatePrioritizeTextures(n, textures, priorities);328 329 for (i = 0; i < n; i++)330 {331 newTextures[i] = crStateGetTextureHWID(textures[i]);332 }333 334 cr_server.head_spu->dispatch_table.PrioritizeTextures(n, newTextures, priorities);335 crFree(newTextures);336 }337 338 283 void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteProgramsARB(GLsizei n, const GLuint * programs) 339 284 { … … 352 297 } 353 298 354 /*@todo will fail for textures loaded from snapshot */355 GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsTexture( GLuint texture )356 {357 GLboolean retval;358 retval = cr_server.head_spu->dispatch_table.IsTexture(crStateGetTextureHWID(texture));359 crServerReturnValue( &retval, sizeof(retval) );360 return retval; /* WILL PROBABLY BE IGNORED */361 }362 363 299 /*@todo will fail for progs loaded from snapshot */ 364 300 GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsProgramARB( GLuint program ) … … 368 304 retval = cr_server.head_spu->dispatch_table.IsProgramARB( program ); 369 305 crServerReturnValue( &retval, sizeof(retval) ); 370 return retval; /* WILL PROBABLY BE IGNORED */371 }372 373 GLboolean SERVER_DISPATCH_APIENTRY374 crServerDispatchAreTexturesResident(GLsizei n, const GLuint *textures,375 GLboolean *residences)376 {377 GLboolean retval;378 GLsizei i;379 GLboolean *res = (GLboolean *) crAlloc(n * sizeof(GLboolean));380 GLuint *textures2 = (GLuint *) crAlloc(n * sizeof(GLuint));381 382 (void) residences;383 384 for (i = 0; i < n; i++)385 {386 textures2[i] = crStateGetTextureHWID(textures[i]);387 }388 retval = cr_server.head_spu->dispatch_table.AreTexturesResident(n, textures2, res);389 390 crFree(textures2);391 392 crServerReturnValue(res, n * sizeof(GLboolean));393 394 crFree(res);395 396 306 return retval; /* WILL PROBABLY BE IGNORED */ 397 307 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_texture.c
r50041 r55013 21 21 #include "server_dispatch.h" 22 22 #include "server.h" 23 #include "cr_mem.h" 23 24 24 25 #define CR_NOTHING() … … 190 191 crServerReturnValue( &(local_params[0]), crStateHlpComponentsCount(pname)*sizeof (GLint) ); 191 192 } 193 194 void SERVER_DISPATCH_APIENTRY crServerDispatchBindTexture( GLenum target, GLuint texture ) 195 { 196 crStateBindTexture( target, texture ); 197 cr_server.head_spu->dispatch_table.BindTexture(target, crStateGetTextureHWID(texture)); 198 } 199 200 201 void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteTextures( GLsizei n, const GLuint *textures) 202 { 203 GLuint *newTextures = (GLuint *) crAlloc(n * sizeof(GLuint)); 204 GLint i; 205 206 if (!newTextures) 207 { 208 crError("crServerDispatchDeleteTextures: out of memory"); 209 return; 210 } 211 212 for (i = 0; i < n; i++) 213 { 214 newTextures[i] = crStateGetTextureHWID(textures[i]); 215 } 216 217 // for (i = 0; i < n; ++i) 218 // { 219 // crDebug("DeleteTexture: %d, pid %d, ctx %d", textures[i], (uint32_t)cr_server.curClient->pid, cr_server.currentCtxInfo->pContext->id); 220 // } 221 222 223 crStateDeleteTextures(n, textures); 224 cr_server.head_spu->dispatch_table.DeleteTextures(n, newTextures); 225 crFree(newTextures); 226 } 227 228 229 void SERVER_DISPATCH_APIENTRY crServerDispatchPrioritizeTextures( GLsizei n, const GLuint * textures, const GLclampf * priorities ) 230 { 231 GLuint *newTextures = (GLuint *) crAlloc(n * sizeof(GLuint)); 232 GLint i; 233 234 if (!newTextures) 235 { 236 crError("crServerDispatchDeleteTextures: out of memory"); 237 return; 238 } 239 240 crStatePrioritizeTextures(n, textures, priorities); 241 242 for (i = 0; i < n; i++) 243 { 244 newTextures[i] = crStateGetTextureHWID(textures[i]); 245 } 246 247 cr_server.head_spu->dispatch_table.PrioritizeTextures(n, newTextures, priorities); 248 crFree(newTextures); 249 } 250 251 252 /*@todo will fail for textures loaded from snapshot */ 253 GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsTexture( GLuint texture ) 254 { 255 GLboolean retval; 256 retval = cr_server.head_spu->dispatch_table.IsTexture(crStateGetTextureHWID(texture)); 257 crServerReturnValue( &retval, sizeof(retval) ); 258 return retval; /* WILL PROBABLY BE IGNORED */ 259 } 260 261 262 GLboolean SERVER_DISPATCH_APIENTRY 263 crServerDispatchAreTexturesResident(GLsizei n, const GLuint *textures, 264 GLboolean *residences) 265 { 266 GLboolean retval; 267 GLsizei i; 268 GLboolean *res = (GLboolean *) crAlloc(n * sizeof(GLboolean)); 269 GLuint *textures2 = (GLuint *) crAlloc(n * sizeof(GLuint)); 270 271 (void) residences; 272 273 for (i = 0; i < n; i++) 274 { 275 textures2[i] = crStateGetTextureHWID(textures[i]); 276 } 277 retval = cr_server.head_spu->dispatch_table.AreTexturesResident(n, textures2, res); 278 279 crFree(textures2); 280 281 crServerReturnValue(res, n * sizeof(GLboolean)); 282 283 crFree(res); 284 285 return retval; /* WILL PROBABLY BE IGNORED */ 286 } 287
Note:
See TracChangeset
for help on using the changeset viewer.

