VirtualBox

Ignore:
Timestamp:
Mar 5, 2010 2:13:31 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
58419
Message:

crOpenGL: add GL_ARB_pixel_buffer_object support

Location:
trunk/src/VBox/HostServices/SharedOpenGL/unpacker
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_drawpixels.c

    r27088 r27091  
    1414    GLenum format  = READ_DATA( sizeof( int ) + 8, GLenum );
    1515    GLenum type    = READ_DATA( sizeof( int ) + 12, GLenum );
    16     GLvoid *pixels = DATA_POINTER( sizeof( int ) + 16, GLvoid );
     16    GLint noimagedata = READ_DATA( sizeof( int ) + 16, GLint );
     17    GLvoid *pixels;
     18
     19    if (noimagedata)
     20        pixels = (void*) READ_DATA( sizeof( int ) + 20, uintptr_t);
     21    else
     22        pixels = DATA_POINTER( sizeof( int ) + 24, GLvoid );
    1723
    1824    cr_unpackDispatch.PixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
     
    3440    GLfloat xmove   = READ_DATA( sizeof( int ) + 16, GLfloat );
    3541    GLfloat ymove   = READ_DATA( sizeof( int ) + 20, GLfloat );
    36     GLuint  is_null = READ_DATA( sizeof( int ) + 24, GLuint );
    37     GLubyte *bitmap = NULL;
     42    GLuint noimagedata = READ_DATA( sizeof( int ) + 24, GLuint );
     43    GLubyte *bitmap;
    3844
    39     if ( !is_null )
    40     {
    41         bitmap = DATA_POINTER( sizeof(int) + 28, GLubyte );
    42     }
     45    if (noimagedata)
     46        bitmap = (void*) READ_DATA(sizeof(int) + 28, uintptr_t);
     47    else
     48        bitmap = DATA_POINTER( sizeof(int) + 32, GLubyte );
    4349
    4450    cr_unpackDispatch.PixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_misc.c

    r21845 r27091  
    99void crUnpackExtendChromiumParametervCR( void  )
    1010{
    11         GLenum target = READ_DATA( 8, GLenum );
    12         GLenum type = READ_DATA( 12, GLenum );
    13         GLsizei count = READ_DATA( 16, GLsizei );
    14         GLvoid *values = DATA_POINTER( 20, GLvoid );
     11    GLenum target = READ_DATA( 8, GLenum );
     12    GLenum type = READ_DATA( 12, GLenum );
     13    GLsizei count = READ_DATA( 16, GLsizei );
     14    GLvoid *values = DATA_POINTER( 20, GLvoid );
    1515
    16         cr_unpackDispatch.ChromiumParametervCR(target, type, count, values);
     16    cr_unpackDispatch.ChromiumParametervCR(target, type, count, values);
    1717
    1818
    19         /*
    20         INCR_VAR_PTR();
    21         */
     19    /*
     20    INCR_VAR_PTR();
     21    */
    2222}
    2323
    2424void crUnpackExtendDeleteQueriesARB(void)
    2525{
    26         GLsizei n = READ_DATA( 8, GLsizei );
     26    GLsizei n = READ_DATA( 8, GLsizei );
    2727    const GLuint *ids = DATA_POINTER(12, GLuint);
    28         cr_unpackDispatch.DeleteQueriesARB(n, ids);
     28    cr_unpackDispatch.DeleteQueriesARB(n, ids);
    2929}
     30
     31void crUnpackExtendGetPolygonStipple(void)
     32{
     33    GLubyte *mask;
     34
     35    SET_RETURN_PTR( 8 );
     36    SET_WRITEBACK_PTR( 16 );
     37    mask = DATA_POINTER(8, GLubyte);
     38
     39    cr_unpackDispatch.GetPolygonStipple( mask );
     40}
     41
     42void crUnpackExtendGetPixelMapfv(void)
     43{
     44    GLenum map = READ_DATA( 8, GLenum );
     45    GLfloat *values;
     46
     47    SET_RETURN_PTR( 12 );
     48    SET_WRITEBACK_PTR( 20 );
     49    values = DATA_POINTER(12, GLfloat);
     50
     51    cr_unpackDispatch.GetPixelMapfv( map, values );
     52}
     53
     54void crUnpackExtendGetPixelMapuiv(void)
     55{
     56    GLenum map = READ_DATA( 8, GLenum );
     57    GLuint *values;
     58
     59    SET_RETURN_PTR( 12 );
     60    SET_WRITEBACK_PTR( 20 );
     61    values = DATA_POINTER(12, GLuint);
     62
     63    cr_unpackDispatch.GetPixelMapuiv( map, values );
     64}
     65
     66void crUnpackExtendGetPixelMapusv(void)
     67{
     68    GLenum map = READ_DATA( 8, GLenum );
     69    GLushort *values;
     70
     71    SET_RETURN_PTR( 12 );
     72    SET_WRITEBACK_PTR( 20 );
     73    values = DATA_POINTER(12, GLushort);
     74
     75    cr_unpackDispatch.GetPixelMapusv( map, values );
     76}
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_pixelmap.c

    r27074 r27091  
    1111    GLenum map = READ_DATA( sizeof( int ) + 0, GLenum );
    1212    GLsizei mapsize = READ_DATA( sizeof( int ) + 4, GLsizei );
    13     GLfloat *values = DATA_POINTER( sizeof( int ) + 8, GLfloat );
     13    int nodata = READ_DATA( sizeof(int) + 8, int);
     14    GLfloat *values;
     15
     16    if (nodata)
     17        values = (GLfloat*) READ_DATA(sizeof(int) + 12, uintptr_t);
     18    else
     19        values = DATA_POINTER( sizeof( int ) + 16, GLfloat );
    1420
    1521    cr_unpackDispatch.PixelMapfv( map, mapsize, values );
     
    2127    GLenum map = READ_DATA( sizeof( int ) + 0, GLenum );
    2228    GLsizei mapsize = READ_DATA( sizeof( int ) + 4, GLsizei );
    23     GLuint *values = DATA_POINTER( sizeof( int ) + 8, GLuint );
     29    int nodata = READ_DATA( sizeof(int) + 8, int);
     30    GLuint *values;
     31
     32    if (nodata)
     33        values = (GLuint*) READ_DATA(sizeof(int) + 12, uintptr_t);
     34    else
     35        values = DATA_POINTER( sizeof( int ) + 16, GLuint );
    2436       
    2537    cr_unpackDispatch.PixelMapuiv( map, mapsize, values );
     
    3143    GLenum map = READ_DATA( sizeof( int ) + 0, GLenum );
    3244    GLsizei mapsize = READ_DATA( sizeof( int ) + 4, GLsizei );
    33     GLushort *values = DATA_POINTER( sizeof( int ) + 8, GLushort );
     45    int nodata = READ_DATA( sizeof(int) + 8, int);
     46    GLushort *values;
     47
     48    if (nodata)
     49        values = (GLushort*) READ_DATA(sizeof(int) + 12, uintptr_t);
     50    else
     51        values = DATA_POINTER( sizeof( int ) + 16, GLushort );
    3452
    3553    cr_unpackDispatch.PixelMapusv( map, mapsize, values );
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_readpixels.c

    r15532 r27091  
    4343        cr_unpackDispatch.ReadPixels( x, y, width, height, format, type, pixels);
    4444
    45         INCR_VAR_PTR();
     45        INCR_DATA_PTR(48+sizeof(CRNetworkPointer));
    4646}
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_stipple.c

    r15532 r27091  
    99void crUnpackPolygonStipple( void  )
    1010{
    11         GLubyte *mask = DATA_POINTER( 0, GLubyte );
     11    int nodata = READ_DATA(0, int);
     12    GLubyte *mask;
    1213
    13         cr_unpackDispatch.PolygonStipple( mask );
    14         INCR_DATA_PTR( 32*32/8 );
     14    if (nodata)
     15        mask = (void*) READ_DATA(4, uintptr_t);
     16    else
     17        mask = DATA_POINTER( 4, GLubyte );
     18
     19    cr_unpackDispatch.PolygonStipple(mask);
     20
     21    if (nodata)
     22        INCR_DATA_PTR(8);
     23    else
     24        INCR_DATA_PTR(4 + 32*32/8);
    1525}
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_texture.c

    r27088 r27091  
    2323    GLenum format = READ_DATA( sizeof( int ) + 28, GLenum );
    2424    GLenum type = READ_DATA( sizeof( int ) + 32, GLenum );
    25     int is_null = READ_DATA( sizeof( int ) + 36, int );
    26     GLvoid *pixels;
    27 
    28     if ( is_null )
    29         pixels = NULL;
    30     else
    31         pixels = DATA_POINTER( sizeof( int ) + 40, GLvoid );
     25    int noimagedata = READ_DATA( sizeof( int ) + 36, int );
     26    GLvoid *pixels;
     27
     28    /*If there's no imagedata send, it's either that passed pointer was NULL or
     29      there was GL_PIXEL_UNPACK_BUFFER_ARB bound, in both cases 4bytes of passed
     30      pointer would convert to either NULL or offset in the bound buffer.
     31     */
     32    if ( noimagedata )
     33        pixels = (void*) READ_DATA(sizeof(int)+40, uintptr_t);
     34    else
     35        pixels = DATA_POINTER( sizeof( int ) + 44, GLvoid );
    3236
    3337    cr_unpackDispatch.TexImage3DEXT(target, level, internalformat, width,
     
    5054    GLenum format = READ_DATA( sizeof( int ) + 28, GLenum );
    5155    GLenum type = READ_DATA( sizeof( int ) + 32, GLenum );
    52     int is_null = READ_DATA( sizeof( int ) + 36, int );
     56    int noimagedata = READ_DATA( sizeof( int ) + 36, int );
    5357    GLvoid *pixels;
    5458   
    55     if ( is_null )
    56         pixels = NULL;
    57     else
    58         pixels = DATA_POINTER( sizeof( int ) + 40, GLvoid );
     59    if ( noimagedata )
     60        pixels = (void*) READ_DATA(sizeof(int)+40, uintptr_t);
     61    else
     62        pixels = DATA_POINTER( sizeof( int ) + 44, GLvoid );
    5963   
    6064    cr_unpackDispatch.TexImage3D( target, level, internalformat, width, height,
     
    7478    GLenum format = READ_DATA( sizeof( int ) + 24, GLenum );
    7579    GLenum type = READ_DATA( sizeof( int ) + 28, GLenum );
    76     int is_null = READ_DATA( sizeof( int ) + 32, int );
    77     GLvoid *pixels;
    78 
    79     if ( is_null )
    80         pixels = NULL;
     80    int noimagedata = READ_DATA( sizeof( int ) + 32, int );
     81    GLvoid *pixels;
     82
     83    if ( noimagedata )
     84        pixels = (void*) READ_DATA(sizeof(int)+36, uintptr_t);
    8185    else
    82         pixels = DATA_POINTER( sizeof( int ) + 36, GLvoid );
     86        pixels = DATA_POINTER( sizeof( int ) + 40, GLvoid );
    8387
    8488    cr_unpackDispatch.TexImage2D( target, level, internalformat, width, height,
     
    96100    GLenum format = READ_DATA( sizeof( int ) + 20, GLenum );
    97101    GLenum type = READ_DATA( sizeof( int ) + 24, GLenum );
    98     int is_null = READ_DATA( sizeof( int ) + 28, int );
    99     GLvoid *pixels;
    100 
    101     if ( is_null )
    102         pixels = NULL;
     102    int noimagedata = READ_DATA( sizeof( int ) + 28, int );
     103    GLvoid *pixels;
     104
     105    if ( noimagedata )
     106        pixels = (void*) READ_DATA(sizeof(int)+32, uintptr_t);
    103107    else
    104         pixels = DATA_POINTER( sizeof( int ) + 32, GLvoid );
     108        pixels = DATA_POINTER( sizeof( int ) + 36, GLvoid );
    105109
    106110    cr_unpackDispatch.TexImage1D( target, level, internalformat, width, border,
     
    183187    GLenum format = READ_DATA( sizeof( int ) + 32, GLenum );
    184188    GLenum type = READ_DATA( sizeof( int ) + 36, GLenum );
    185     GLvoid *pixels = DATA_POINTER( sizeof( int ) + 40, GLvoid );
     189    int noimagedata = READ_DATA( sizeof( int ) + 40, int );
     190    GLvoid *pixels;
     191
     192    if ( noimagedata )
     193        pixels = (void*) READ_DATA(sizeof(int)+44, uintptr_t);
     194    else
     195        pixels = DATA_POINTER( sizeof( int ) + 48, GLvoid );
    186196
    187197    cr_unpackDispatch.PixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
     
    206216    GLenum format = READ_DATA( sizeof( int ) + 24, GLenum );
    207217    GLenum type = READ_DATA( sizeof( int ) + 28, GLenum );
    208     GLvoid *pixels = DATA_POINTER( sizeof( int ) + 32, GLvoid );
     218    int noimagedata = READ_DATA( sizeof( int ) + 32, int );
     219    GLvoid *pixels;
     220
     221    if ( noimagedata )
     222        pixels = (void*) READ_DATA(sizeof(int)+36, uintptr_t);
     223    else
     224        pixels = DATA_POINTER( sizeof( int ) + 40, GLvoid );
    209225
    210226    cr_unpackDispatch.PixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
     
    226242    GLenum format = READ_DATA( sizeof( int ) + 16, GLenum );
    227243    GLenum type = READ_DATA( sizeof( int ) + 20, GLenum );
    228     GLvoid *pixels = DATA_POINTER( sizeof( int ) + 24, GLvoid );
     244    int noimagedata = READ_DATA( sizeof( int ) + 24, int );
     245    GLvoid *pixels;
     246
     247    if ( noimagedata )
     248        pixels = (void*) READ_DATA(sizeof(int)+28, uintptr_t);
     249    else
     250        pixels = DATA_POINTER( sizeof( int ) + 32, GLvoid );
    229251
    230252    cr_unpackDispatch.PixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
     
    317339    GLint   border         = READ_DATA( 4 + sizeof(int) + 24, GLint );
    318340    GLsizei imagesize      = READ_DATA( 4 + sizeof(int) + 28, GLsizei );
    319     int     is_null        = READ_DATA( 4 + sizeof(int) + 32, int );
     341    int     noimagedata        = READ_DATA( 4 + sizeof(int) + 32, int );
    320342    GLvoid  *pixels;
    321343
    322     if( is_null )
    323         pixels = NULL;
    324     else
    325         pixels = DATA_POINTER( 4 + sizeof(int) + 36, GLvoid );
     344    if( noimagedata )
     345        pixels = (void*) READ_DATA(4+sizeof(int)+36, uintptr_t);
     346    else
     347        pixels = DATA_POINTER( 4 + sizeof(int) + 40, GLvoid );
    326348
    327349    cr_unpackDispatch.CompressedTexImage3DARB(target, level, internalformat,
     
    340362    GLint border =          READ_DATA( 4 + sizeof( int ) + 20, GLint );
    341363    GLsizei imagesize =     READ_DATA( 4 + sizeof( int ) + 24, GLsizei );
    342     int is_null =           READ_DATA( 4 + sizeof( int ) + 28, int );
    343     GLvoid *pixels;
    344 
    345     if ( is_null )
    346         pixels = NULL;
    347     else
    348         pixels = DATA_POINTER( 4 + sizeof( int ) + 32, GLvoid );
     364    int noimagedata =           READ_DATA( 4 + sizeof( int ) + 28, int );
     365    GLvoid *pixels;
     366
     367    if ( noimagedata )
     368        pixels = (void*) READ_DATA(4+sizeof(int)+32, uintptr_t);
     369    else
     370        pixels = DATA_POINTER( 4 + sizeof( int ) + 36, GLvoid );
    349371
    350372    cr_unpackDispatch.CompressedTexImage2DARB( target, level, internalformat,
     
    362384    GLint   border         = READ_DATA( 4 + sizeof(int) + 16, GLint );
    363385    GLsizei imagesize      = READ_DATA( 4 + sizeof(int) + 20, GLsizei );
    364     int     is_null        = READ_DATA( 4 + sizeof(int) + 24, int );
     386    int     noimagedata        = READ_DATA( 4 + sizeof(int) + 24, int );
    365387    GLvoid  *pixels;
    366388
    367     if( is_null )
    368         pixels = NULL;
    369     else
    370         pixels = DATA_POINTER( 4 + sizeof(int) + 28, GLvoid );
     389    if( noimagedata )
     390        pixels = (void*) READ_DATA(4+sizeof(int)+28, uintptr_t);
     391    else
     392        pixels = DATA_POINTER( 4 + sizeof(int) + 32, GLvoid );
    371393
    372394    cr_unpackDispatch.CompressedTexImage1DARB(target, level, internalformat,
     
    387409    GLenum  format    = READ_DATA( 4 + sizeof(int) + 32, GLenum );
    388410    GLsizei imagesize = READ_DATA( 4 + sizeof(int) + 36, GLsizei );
    389     int     is_null   = READ_DATA( 4 + sizeof(int) + 40, int );
     411    int     noimagedata   = READ_DATA( 4 + sizeof(int) + 40, int );
    390412    GLvoid  *pixels;
    391413
    392     if( is_null )
    393         pixels = NULL;
    394     else
    395         pixels = DATA_POINTER( 4 + sizeof(int) + 44, GLvoid );
     414    if( noimagedata )
     415        pixels = (void*) READ_DATA(4+sizeof(int)+44, uintptr_t);
     416    else
     417        pixels = DATA_POINTER( 4 + sizeof(int) + 48, GLvoid );
    396418
    397419    cr_unpackDispatch.CompressedTexSubImage3DARB(target, level, xoffset,
     
    412434    GLenum  format    = READ_DATA( 4 + sizeof(int) + 24, GLenum );
    413435    GLsizei imagesize = READ_DATA( 4 + sizeof(int) + 28, GLsizei );
    414     int     is_null   = READ_DATA( 4 + sizeof(int) + 32, int );
     436    int     noimagedata   = READ_DATA( 4 + sizeof(int) + 32, int );
    415437    GLvoid  *pixels;
    416438
    417     if( is_null )
    418         pixels = NULL;
    419     else
    420         pixels = DATA_POINTER( 4 + sizeof(int) + 36, GLvoid );
     439    if( noimagedata )
     440        pixels = (void*) READ_DATA(4+sizeof(int)+36, uintptr_t);
     441    else
     442        pixels = DATA_POINTER( 4 + sizeof(int) + 40, GLvoid );
    421443
    422444    cr_unpackDispatch.CompressedTexSubImage2DARB(target, level, xoffset,
     
    434456    GLenum  format    = READ_DATA( 4 + sizeof(int) + 16, GLenum );
    435457    GLsizei imagesize = READ_DATA( 4 + sizeof(int) + 20, GLsizei );
    436     int     is_null   = READ_DATA( 4 + sizeof(int) + 24, int );
     458    int     noimagedata   = READ_DATA( 4 + sizeof(int) + 24, int );
    437459    GLvoid  *pixels;
    438460
    439     if( is_null )
    440         pixels = NULL;
    441     else
    442         pixels = DATA_POINTER( 4 + sizeof(int) + 28, GLvoid );
     461    if( noimagedata )
     462        pixels = (void*) READ_DATA(4+sizeof(int)+28, uintptr_t);
     463    else
     464        pixels = DATA_POINTER( 4 + sizeof(int) + 32, GLvoid );
    443465
    444466    cr_unpackDispatch.CompressedTexSubImage1DARB(target, level, xoffset, width,
    445467                                                 format, imagesize, pixels);
    446468}
     469
     470void crUnpackExtendGetTexImage(void)
     471{
     472    GLenum target = READ_DATA( 8, GLenum );
     473    GLint level   = READ_DATA( 12, GLint );
     474    GLenum format = READ_DATA( 16, GLenum );
     475    GLenum type   = READ_DATA( 20, GLenum );
     476    GLvoid *pixels;
     477
     478    SET_RETURN_PTR(24);
     479    SET_WRITEBACK_PTR(32);
     480    pixels = DATA_POINTER(24, GLvoid);
     481
     482    cr_unpackDispatch.GetTexImage(target, level, format, type, pixels);
     483}
     484
     485void crUnpackExtendGetCompressedTexImageARB(void)
     486{
     487    GLenum target = READ_DATA( 8, GLenum );
     488    GLint level   = READ_DATA( 12, GLint );
     489    GLvoid *img;
     490
     491    SET_RETURN_PTR( 16 );
     492    SET_WRITEBACK_PTR( 24 );
     493    img = DATA_POINTER(16, GLvoid);
     494
     495    cr_unpackDispatch.GetCompressedTexImageARB( target, level, img );
     496}
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpacker_special

    r23399 r27091  
    169169UnlockArraysEXT
    170170GetUniformsLocations
     171GetTexImage
     172GetCompressedTexImageARB
     173GetPolygonStipple
     174GetPixelMapfv
     175GetPixelMapuiv
     176GetPixelMapusv
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette