VirtualBox

Changeset 21422 in vbox for trunk/src/VBox/GuestHost


Ignore:
Timestamp:
Jul 9, 2009 10:03:37 AM (16 years ago)
Author:
vboxsync
Message:

crOpenGL: fix VBOs support on 32/64 or 64/32 guest/host combinations

Location:
trunk/src/VBox/GuestHost/OpenGL/packer
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_arrays.c

    r15532 r21422  
    2626         * arrays - GL_ARB_vertex_buffer_object.  Note that pointer will really
    2727         * be an offset into a server-side buffer.
     28     * @todo Because of that we'd only transfer lowest 32bit as there're no 4gb+VBOs (yet?).
     29     * Look at glgets regarding max vertices in arrays.
    2830         */
    2931        GET_PACKER_CONTEXT(pc);
    3032        unsigned char *data_ptr;
    31         int packet_length = 20 + sizeof(GLintptrARB);
     33        int packet_length = 24;
    3234        GET_BUFFERED_POINTER( pc, packet_length );
    3335        WRITE_DATA( 0, GLint, packet_length );
     
    3638        WRITE_DATA( 12, GLenum, type );
    3739        WRITE_DATA( 16, GLsizei, stride );
    38         WRITE_DATA( 20, GLintptrARB, (GLintptrARB) pointer );
     40        WRITE_DATA( 20, GLuint, (GLuint) pointer );
    3941        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    4042}
     
    4446        GET_PACKER_CONTEXT(pc);
    4547        unsigned char *data_ptr;
    46         int packet_length = 20 + sizeof(GLintptrARB);
     48        int packet_length = 24;
    4749        GET_BUFFERED_POINTER( pc, packet_length );
    4850        WRITE_DATA( 0, GLint, packet_length );
     
    5153        WRITE_DATA( 12, GLenum, type );
    5254        WRITE_DATA( 16, GLsizei, stride );
    53         WRITE_DATA( 20, GLintptrARB, (GLintptrARB) pointer );
     55        WRITE_DATA( 20, GLuint, (GLuint) pointer );
    5456        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    5557}
     
    5961        GET_PACKER_CONTEXT(pc);
    6062        unsigned char *data_ptr;
    61         int packet_length = 16 + sizeof(GLintptrARB);
     63        int packet_length = 20;
    6264        GET_BUFFERED_POINTER( pc, packet_length );
    6365        WRITE_DATA( 0, GLint, packet_length );
     
    6567        WRITE_DATA( 8, GLenum, type );
    6668        WRITE_DATA( 12, GLsizei, stride );
    67         WRITE_DATA( 16, GLintptrARB, (GLintptrARB) pointer );
     69        WRITE_DATA( 16, GLuint, (GLuint) pointer );
    6870        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    6971}
     
    7375        GET_PACKER_CONTEXT(pc);
    7476        unsigned char *data_ptr;
    75         int packet_length = 20 + sizeof(GLintptrARB);
     77        int packet_length = 24;
    7678        GET_BUFFERED_POINTER( pc, packet_length );
    7779        WRITE_DATA( 0, GLint, packet_length );
     
    8082        WRITE_DATA( 12, GLenum, type );
    8183        WRITE_DATA( 16, GLsizei, stride );
    82         WRITE_DATA( 20, GLintptrARB, (GLintptrARB) pointer );
     84        WRITE_DATA( 20, GLuint, (GLuint) pointer );
    8385        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    8486}
     
    8890        GET_PACKER_CONTEXT(pc);
    8991        unsigned char *data_ptr;
    90         int packet_length = 12 + sizeof(GLintptrARB);
     92        int packet_length = 16;
    9193        GET_BUFFERED_POINTER( pc, packet_length );
    9294        WRITE_DATA( 0, GLint, packet_length );
    9395        WRITE_DATA( 4, GLenum, CR_EDGEFLAGPOINTER_EXTEND_OPCODE );
    9496        WRITE_DATA( 8, GLsizei, stride );
    95         WRITE_DATA( 12, GLintptrARB, (GLintptrARB) pointer );
     97        WRITE_DATA( 12, GLuint, (GLuint) pointer );
    9698        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    9799}
     
    101103        GET_PACKER_CONTEXT(pc);
    102104        unsigned char *data_ptr;
    103         int packet_length = 16 + sizeof(GLintptrARB);
     105        int packet_length = 20;
    104106        GET_BUFFERED_POINTER( pc, packet_length );
    105107        WRITE_DATA( 0, GLint, packet_length );
     
    107109        WRITE_DATA( 8, GLenum, type );
    108110        WRITE_DATA( 12, GLsizei, stride );
    109         WRITE_DATA( 16, GLintptrARB, (GLintptrARB) pointer );
     111        WRITE_DATA( 16, GLuint, (GLuint) pointer );
    110112        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    111113}
     
    115117        GET_PACKER_CONTEXT(pc);
    116118        unsigned char *data_ptr;
    117         int packet_length = 20 + sizeof(GLintptrARB);
     119        int packet_length = 24;
    118120        GET_BUFFERED_POINTER( pc, packet_length );
    119121        WRITE_DATA( 0, GLint, packet_length );
     
    122124        WRITE_DATA( 12, GLenum, type );
    123125        WRITE_DATA( 16, GLsizei, stride );
    124         WRITE_DATA( 20, GLintptrARB, (GLintptrARB) pointer );
     126        WRITE_DATA( 20, GLuint, (GLuint) pointer );
    125127        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    126128}
     
    130132        GET_PACKER_CONTEXT(pc);
    131133        unsigned char *data_ptr;
    132         int packet_length = 16 + sizeof(GLintptrARB);
     134        int packet_length = 20;
    133135        GET_BUFFERED_POINTER( pc, packet_length );
    134136        WRITE_DATA( 0, GLint, packet_length );
     
    136138        WRITE_DATA( 8, GLenum, type );
    137139        WRITE_DATA( 12, GLsizei, stride );
    138         WRITE_DATA( 16, GLintptrARB, (GLintptrARB) pointer );
     140        WRITE_DATA( 16, GLuint, (GLuint) pointer );
    139141        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    140142}
     
    144146        GET_PACKER_CONTEXT(pc);
    145147        unsigned char *data_ptr;
    146         int packet_length = 28 + sizeof(GLintptrARB);
     148        int packet_length = 32;
    147149        GET_BUFFERED_POINTER( pc, packet_length );
    148150        WRITE_DATA( 0, GLint, packet_length );
     
    153155        WRITE_DATA( 20, GLboolean, normalized );
    154156        WRITE_DATA( 24, GLsizei, stride );
    155         WRITE_DATA( 28, GLintptrARB, (GLintptrARB) pointer );
     157        WRITE_DATA( 28, GLuint, (GLuint) pointer );
    156158        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    157159}
     
    161163        GET_PACKER_CONTEXT(pc);
    162164        unsigned char *data_ptr;
    163         int packet_length = 24 + sizeof(GLintptrARB);
     165        int packet_length = 28;
    164166        GET_BUFFERED_POINTER( pc, packet_length );
    165167        WRITE_DATA( 0, GLint, packet_length );
     
    169171        WRITE_DATA( 16, GLenum, type );
    170172        WRITE_DATA( 20, GLsizei, stride );
    171         WRITE_DATA( 24, GLintptrARB, (GLintptrARB) pointer );
     173        WRITE_DATA( 24, GLuint, (GLuint) pointer );
    172174        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    173175}
     
    177179        GET_PACKER_CONTEXT(pc);
    178180        unsigned char *data_ptr;
    179         int packet_length = 16 + sizeof(GLintptrARB);
     181        int packet_length = 20;
    180182        GET_BUFFERED_POINTER( pc, packet_length );
    181183        WRITE_DATA( 0, GLint, packet_length );
     
    183185        WRITE_DATA( 8, GLenum, format );
    184186        WRITE_DATA( 12, GLsizei, stride );
    185         WRITE_DATA( 16, GLintptrARB, (GLintptrARB) pointer );
     187        WRITE_DATA( 16, GLuint, (GLuint) pointer );
    186188        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    187189}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_bufferobject.c

    r21309 r21422  
    4141
    4242    packet_length = sizeof(GLenum)
    43         + sizeof(target) + sizeof(size) + sizeof(usage) + sizeof(GLboolean);
     43        + sizeof(target) + sizeof(GLuint) + sizeof(usage) + sizeof(GLboolean);
    4444
    4545    /*Note: it's valid to pass a NULL pointer here, which tells GPU drivers to allocate memory for the VBO*/
     
    5050    WRITE_DATA_AI(GLenum, CR_BUFFERDATAARB_EXTEND_OPCODE);
    5151    WRITE_DATA_AI(GLenum, target);
    52     WRITE_DATA_AI(GLsizeiptrARB, size);
     52    WRITE_DATA_AI(GLuint, (GLuint) size);
    5353    WRITE_DATA_AI(GLenum, usage);
    5454    WRITE_DATA_AI(GLboolean, (GLboolean) (data!=NULL));
     
    7272
    7373    packet_length = sizeof(GLenum)
    74         + sizeof(target) + sizeof(offset) + sizeof(size) + size;
     74        + sizeof(target) + sizeof(GLuint) + sizeof(GLuint) + size;
    7575
    7676    start_ptr = data_ptr = (unsigned char *) crPackAlloc(packet_length);
    7777    WRITE_DATA_AI(GLenum, CR_BUFFERSUBDATAARB_EXTEND_OPCODE);
    7878    WRITE_DATA_AI(GLenum, target);
    79     WRITE_DATA_AI(GLintptrARB, offset);
    80     WRITE_DATA_AI(GLsizeiptrARB, size);
     79    WRITE_DATA_AI(GLuint, (GLuint) offset);
     80    WRITE_DATA_AI(GLuint, (GLuint) size);
    8181    crMemcpy(data_ptr, data, size);
    8282
     
    8585}
    8686
     87void PACK_APIENTRY
     88crPackGetBufferSubDataARB( GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data, int * writeback )
     89{
     90        GET_PACKER_CONTEXT(pc);
     91        unsigned char *data_ptr;
     92        (void) pc;
     93        GET_BUFFERED_POINTER( pc, 36 );
     94        WRITE_DATA( 0, GLint, 36 );
     95        WRITE_DATA( 4, GLenum, CR_GETBUFFERSUBDATAARB_EXTEND_OPCODE );
     96        WRITE_DATA( 8, GLenum, target );
     97        WRITE_DATA( 12, GLuint, (GLuint) offset );
     98        WRITE_DATA( 16, GLuint, (GLuint) size );
     99        WRITE_NETWORK_POINTER( 20, (void *) data );
     100        WRITE_NETWORK_POINTER( 28, (void *) writeback );
     101        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     102}
    87103
    88104void PACK_APIENTRY
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_client.c

    r21308 r21422  
    464464{
    465465    unsigned char *data_ptr, *start_ptr;
    466     int packet_length = sizeof(int) + sizeof(mode) + sizeof(count) + sizeof(type) + sizeof(GLintptrARB);
     466    int packet_length = sizeof(int) + sizeof(mode) + sizeof(count) + sizeof(type) + sizeof(GLuint);
    467467    GLsizei indexsize;
    468468#ifdef CR_ARB_vertex_buffer_object
     
    492492    WRITE_DATA_AI(GLsizei, count);
    493493    WRITE_DATA_AI(GLenum, type);
    494     WRITE_DATA_AI(GLsizeiptrARB, (GLsizeiptrARB) indices );
    495 #ifdef CR_ARB_vertex_buffer_object
    496     WRITE_DATA_AI(GLboolean, (GLboolean) indexsize>0);
     494    WRITE_DATA_AI(GLuint, (GLuint) indices );
     495#ifdef CR_ARB_vertex_buffer_object
     496    WRITE_DATA_AI(GLboolean, (GLboolean)(indexsize>0));
    497497#endif
    498498    if (indexsize>0)
     
    510510    unsigned char *data_ptr, *start_ptr;
    511511    int packet_length = sizeof(int) + sizeof(mode) + sizeof(start)
    512         + sizeof(end) + sizeof(count) + sizeof(type) + sizeof(GLintptrARB);
     512        + sizeof(end) + sizeof(count) + sizeof(type) + sizeof(GLuint);
    513513    GLsizei indexsize;
    514514
     
    541541    WRITE_DATA_AI(GLsizei, count);
    542542    WRITE_DATA_AI(GLenum, type);
    543     WRITE_DATA_AI(GLsizeiptrARB, (GLsizeiptr) indices);
    544 #ifdef CR_ARB_vertex_buffer_object
    545     WRITE_DATA_AI(GLboolean, (GLboolean) indexsize>0);
     543    WRITE_DATA_AI(GLuint, (GLuint) indices);
     544#ifdef CR_ARB_vertex_buffer_object
     545    WRITE_DATA_AI(GLboolean, (GLboolean) (indexsize>0));
    546546#endif
    547547    if (indexsize>0)
  • trunk/src/VBox/GuestHost/OpenGL/packer/packer_special

    r20467 r21422  
    165165GetAttachedObjectsARB
    166166GetInfoLogARB
     167GetBufferSubDataARB
Note: See TracChangeset for help on using the changeset viewer.

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