- Timestamp:
- Jun 9, 2009 1:06:48 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/Makefile.kmk
r20253 r20437 374 374 pack/packspu_pixel.c \ 375 375 pack/packspu_texture.c \ 376 pack/packspu_getshaders.c \ 376 377 $(VBOX_PATH_CROGL_GENFILES)/packspu.c \ 377 378 $(VBOX_PATH_CROGL_GENFILES)/packspu_get.c \ -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_special
r20084 r20437 64 64 DrawBuffer 65 65 Flush 66 GetActiveAttrib 67 GetActiveUniform 68 GetAttachedShaders 69 GetShaderInfoLog 70 GetProgramInfoLog 71 GetShaderSource -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_shaders.c
r20327 r20437 263 263 } 264 264 265 /*@todo next 5 functions are bit hacky, 266 * we expect packspu to pass a single structure with all output parameters via first output pointer. 267 * it'd be better to add CRMessageMultiReadback one day. 268 */ 269 void PACK_APIENTRY crPackGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback) 270 { 271 GET_PACKER_CONTEXT(pc); 272 unsigned char *data_ptr; 273 (void) pc; 274 (void) size; 275 (void) type; 276 (void) name; 277 GET_BUFFERED_POINTER(pc, 36); 278 WRITE_DATA(0, GLint, 36); 279 WRITE_DATA(4, GLenum, CR_GETACTIVEATTRIB_EXTEND_OPCODE); 280 WRITE_DATA(8, GLuint, program); 281 WRITE_DATA(12, GLuint, index); 282 WRITE_DATA(16, GLsizei, bufSize); 283 WRITE_NETWORK_POINTER(20, (void *) length); 284 WRITE_NETWORK_POINTER(28, (void *) writeback); 285 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 286 } 287 288 void PACK_APIENTRY crPackGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback) 289 { 290 GET_PACKER_CONTEXT(pc); 291 unsigned char *data_ptr; 292 (void) pc; 293 (void) size; 294 (void) type; 295 (void) name; 296 GET_BUFFERED_POINTER(pc, 36); 297 WRITE_DATA(0, GLint, 36); 298 WRITE_DATA(4, GLenum, CR_GETACTIVEUNIFORM_EXTEND_OPCODE); 299 WRITE_DATA(8, GLuint, program); 300 WRITE_DATA(12, GLuint, index); 301 WRITE_DATA(16, GLsizei, bufSize); 302 WRITE_NETWORK_POINTER(20, (void *) length); 303 WRITE_NETWORK_POINTER(28, (void *) writeback); 304 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 305 } 306 307 void PACK_APIENTRY crPackGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders, int * writeback) 308 { 309 GET_PACKER_CONTEXT(pc); 310 unsigned char *data_ptr; 311 (void) pc; 312 (void) shaders; 313 GET_BUFFERED_POINTER(pc, 32); 314 WRITE_DATA(0, GLint, 32); 315 WRITE_DATA(4, GLenum, CR_GETATTACHEDSHADERS_EXTEND_OPCODE); 316 WRITE_DATA(8, GLuint, program); 317 WRITE_DATA(12, GLsizei, maxCount); 318 WRITE_NETWORK_POINTER(16, (void *) count); 319 WRITE_NETWORK_POINTER(24, (void *) writeback); 320 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 321 } 322 323 void PACK_APIENTRY crPackGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback) 324 { 325 GET_PACKER_CONTEXT(pc); 326 unsigned char *data_ptr; 327 (void) pc; 328 (void) infoLog; 329 GET_BUFFERED_POINTER(pc, 32); 330 WRITE_DATA(0, GLint, 32); 331 WRITE_DATA(4, GLenum, CR_GETPROGRAMINFOLOG_EXTEND_OPCODE); 332 WRITE_DATA(8, GLuint, program); 333 WRITE_DATA(12, GLsizei, bufSize); 334 WRITE_NETWORK_POINTER(16, (void *) length); 335 WRITE_NETWORK_POINTER(24, (void *) writeback); 336 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 337 } 338 339 void PACK_APIENTRY crPackGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback) 340 { 341 GET_PACKER_CONTEXT(pc); 342 unsigned char *data_ptr; 343 (void) pc; 344 (void) infoLog; 345 GET_BUFFERED_POINTER(pc, 32); 346 WRITE_DATA(0, GLint, 32); 347 WRITE_DATA(4, GLenum, CR_GETSHADERINFOLOG_EXTEND_OPCODE); 348 WRITE_DATA(8, GLuint, shader); 349 WRITE_DATA(12, GLsizei, bufSize); 350 WRITE_NETWORK_POINTER(16, (void *) length); 351 WRITE_NETWORK_POINTER(24, (void *) writeback); 352 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 353 } 354 355 void PACK_APIENTRY crPackGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, char * source, int * writeback) 356 { 357 GET_PACKER_CONTEXT(pc); 358 unsigned char *data_ptr; 359 (void) pc; 360 (void) source; 361 GET_BUFFERED_POINTER(pc, 32); 362 WRITE_DATA(0, GLint, 32); 363 WRITE_DATA(4, GLenum, CR_GETSHADERSOURCE_EXTEND_OPCODE); 364 WRITE_DATA(8, GLuint, shader); 365 WRITE_DATA(12, GLsizei, bufSize); 366 WRITE_NETWORK_POINTER(16, (void *) length); 367 WRITE_NETWORK_POINTER(24, (void *) writeback); 368 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 369 } 370 371 void PACK_APIENTRY crPackGetAttribLocation(GLuint program, const char * name, GLint * return_value, int * writeback) 372 { 373 GET_PACKER_CONTEXT(pc); 374 unsigned char *data_ptr; 375 int cbName = crStrlen(name)+1; 376 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+cbName*sizeof(*name)+16; 377 378 GET_BUFFERED_POINTER(pc, packet_length); 379 WRITE_DATA_AI(int, packet_length); 380 WRITE_DATA_AI(GLenum, CR_GETATTRIBLOCATION_EXTEND_OPCODE); 381 WRITE_DATA_AI(GLuint, program); 382 crMemcpy(data_ptr, name, cbName*sizeof(*name)); 383 data_ptr += cbName*sizeof(*name); 384 WRITE_NETWORK_POINTER(0, (void *) return_value ); 385 WRITE_NETWORK_POINTER(8, (void *) writeback ); 386 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 387 } 388 389 void PACK_APIENTRY crPackGetUniformLocation( GLuint program, const char * name, GLint * return_value, int * writeback ) 390 { 391 GET_PACKER_CONTEXT(pc); 392 unsigned char *data_ptr; 393 int cbName = crStrlen(name)+1; 394 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+cbName*sizeof(*name)+16; 395 396 GET_BUFFERED_POINTER(pc, packet_length); 397 WRITE_DATA_AI(int, packet_length); 398 WRITE_DATA_AI(GLenum, CR_GETUNIFORMLOCATION_EXTEND_OPCODE); 399 WRITE_DATA_AI(GLuint, program); 400 crMemcpy(data_ptr, name, cbName*sizeof(*name)); 401 data_ptr += cbName*sizeof(*name); 402 WRITE_NETWORK_POINTER(0, (void *) return_value ); 403 WRITE_NETWORK_POINTER(8, (void *) writeback ); 404 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 405 } 406 265 407 void PACK_APIENTRY crPackBindAttribLocationSWAP(GLuint program, GLuint index, const char *name) 266 408 { … … 406 548 (void) pc; 407 549 } 550 551 void PACK_APIENTRY crPackGetAttribLocationSWAP(GLuint program, const char * name, GLint * return_value, int * writeback) 552 { 553 GET_PACKER_CONTEXT(pc); 554 (void)program; 555 (void)name; 556 (void)return_value; 557 (void)writeback; 558 crError ("No swap version"); 559 (void) pc; 560 } 561 562 void PACK_APIENTRY crPackGetUniformLocationSWAP( GLuint program, const char * name, GLint * return_value, int * writeback ) 563 { 564 GET_PACKER_CONTEXT(pc); 565 (void)program; 566 (void)name; 567 (void)return_value; 568 (void)writeback; 569 crError ("No swap version"); 570 (void) pc; 571 } -
trunk/src/VBox/GuestHost/OpenGL/packer/packer_special
r20327 r20437 155 155 UniformMatrix4fv 156 156 DrawBuffers 157 GetActiveAttrib 158 GetActiveUniform 159 GetAttachedShaders 160 GetShaderInfoLog 161 GetProgramInfoLog 162 GetShaderSource 163 GetAttribLocation 164 GetUniformLocation -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c
r20179 r20437 29 29 } crGetActive_t; 30 30 31 /*@todo: most of those functions would fail. Either need to support more than 1 cr_server.return_ptr(s) or32 * change pack_spu to pack output args into single buffer.33 */34 35 31 void SERVER_DISPATCH_APIENTRY crServerDispatchGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, char *name) 36 32 { -
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_shaders.c
r20327 r20437 159 159 cr_unpackDispatch.DrawBuffers(n, bufs); 160 160 } 161 162 void crUnpackExtendGetActiveAttrib(void) 163 { 164 GLuint program = READ_DATA(8, GLuint); 165 GLuint index = READ_DATA(12, GLuint); 166 GLsizei bufSize = READ_DATA(16, GLsizei); 167 SET_RETURN_PTR(20); 168 SET_WRITEBACK_PTR(28); 169 cr_unpackDispatch.GetActiveAttrib(program, index, bufSize, NULL, NULL, NULL, NULL); 170 } 171 172 void crUnpackExtendGetActiveUniform(void) 173 { 174 GLuint program = READ_DATA(8, GLuint); 175 GLuint index = READ_DATA(12, GLuint); 176 GLsizei bufSize = READ_DATA(16, GLsizei); 177 SET_RETURN_PTR(20); 178 SET_WRITEBACK_PTR(28); 179 cr_unpackDispatch.GetActiveUniform(program, index, bufSize, NULL, NULL, NULL, NULL); 180 } 181 182 void crUnpackExtendGetAttachedShaders(void) 183 { 184 GLuint program = READ_DATA(8, GLuint); 185 GLsizei maxCount = READ_DATA(12, GLsizei); 186 SET_RETURN_PTR(16); 187 SET_WRITEBACK_PTR(24); 188 cr_unpackDispatch.GetAttachedShaders(program, maxCount, NULL, NULL); 189 } 190 191 void crUnpackExtendGetProgramInfoLog(void) 192 { 193 GLuint program = READ_DATA(8, GLuint); 194 GLsizei bufSize = READ_DATA(12, GLsizei); 195 SET_RETURN_PTR(16); 196 SET_WRITEBACK_PTR(24); 197 cr_unpackDispatch.GetProgramInfoLog(program, bufSize, NULL, NULL); 198 } 199 200 void crUnpackExtendGetShaderInfoLog(void) 201 { 202 GLuint shader = READ_DATA(8, GLuint); 203 GLsizei bufSize = READ_DATA(12, GLsizei); 204 SET_RETURN_PTR(16); 205 SET_WRITEBACK_PTR(24); 206 cr_unpackDispatch.GetShaderInfoLog(shader, bufSize, NULL, NULL); 207 } 208 209 void crUnpackExtendGetShaderSource(void) 210 { 211 GLuint shader = READ_DATA(8, GLuint); 212 GLsizei bufSize = READ_DATA(12, GLsizei); 213 SET_RETURN_PTR(16); 214 SET_WRITEBACK_PTR(24); 215 cr_unpackDispatch.GetShaderSource(shader, bufSize, NULL, NULL); 216 } 217 218 void crUnpackExtendGetAttribLocation(void) 219 { 220 int packet_length = READ_DATA(0, int); 221 GLuint program = READ_DATA(8, GLuint); 222 const char *name = DATA_POINTER(12, const char); 223 SET_RETURN_PTR(packet_length-16); 224 SET_WRITEBACK_PTR(packet_length-8); 225 cr_unpackDispatch.GetAttribLocation(program, name); 226 } 227 228 void crUnpackExtendGetUniformLocation(void) 229 { 230 int packet_length = READ_DATA(0, int); 231 GLuint program = READ_DATA(8, GLuint); 232 const char *name = DATA_POINTER(12, const char); 233 SET_RETURN_PTR(packet_length-16); 234 SET_WRITEBACK_PTR(packet_length-8); 235 cr_unpackDispatch.GetUniformLocation(program, name); 236 } -
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpacker_special
r20327 r20437 153 153 UniformMatrix4fv 154 154 DrawBuffers 155 GetActiveAttrib 156 GetActiveUniform 157 GetAttachedShaders 158 GetShaderInfoLog 159 GetProgramInfoLog 160 GetShaderSource 161 GetAttribLocation 162 GetUniformLocation
Note:
See TracChangeset
for help on using the changeset viewer.