VirtualBox

Changeset 78116 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 12, 2019 10:03:24 AM (6 years ago)
Author:
vboxsync
Message:

GuestHost/OpenGL,HostServices/SharedOpenGL: Updates bugref:9407

Location:
trunk/src/VBox
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py

    r69392 r78116  
    558558#======================================================================
    559559
     560def _needPointerOrigin(name, type):
     561        return type == 'const GLvoid *' and (name == 'pointer' or name == 'NULL');
     562
    560563def MakeCallString(params):
    561564        """Given a list of (name, type, vectorSize) parameters, make a C-style
     
    575578#enddef
    576579
     580def MakeCallStringForDispatcher(params):
     581        """Same as MakeCallString, but with 'pointer' origin hack for bugref:9407."""
     582        strResult = ''
     583        fFirst    = True;
     584        for (name, type, vecSize) in params:
     585                if not fFirst:  strResult += ', ';
     586                else:           fFirst     = False;
     587                strResult += name;
     588                if _needPointerOrigin(name, type):
     589                        if name != 'NULL': strResult += ', fRealPtr';
     590                        else:                      strResult += ', 0 /*fRealPtr*/';
     591        return strResult;
     592
    577593
    578594def MakeDeclarationString(params):
     
    596612        #endif
    597613#enddef
     614
     615def MakeDeclarationStringForDispatcher(params):
     616        """Same as MakeDeclarationString, but with 'pointer' origin hack for bugref:9407."""
     617        if len(params) == 0:
     618                return 'void';
     619        strResult = '';
     620        fFirst    = True;
     621        for (name, type, vecSize) in params:
     622                if not fFirst:  strResult += ', ';
     623                else:           fFirst     = False;
     624                strResult = strResult + type + ' ' + name;
     625                if _needPointerOrigin(name, type):
     626                        strResult = strResult + ' CRVBOX_HOST_ONLY_PARAM(int fRealPtr)';
     627        return strResult;
    598628
    599629def MakeDeclarationStringWithContext(ctx_macro_prefix, params):
     
    632662        #endif
    633663#enddef
     664
     665def MakePrototypeStringForDispatcher(params):
     666        """Same as MakePrototypeString, but with 'pointer' origin hack for bugref:9407."""
     667        if len(params) == 0:
     668                return 'void'
     669        strResult = ''
     670        fFirst    = True;
     671        for (name, type, vecSize) in params:
     672                if not fFirst:  strResult += ', ';
     673                else:           fFirst     = False;
     674                strResult = strResult + type
     675                if _needPointerOrigin(name, type):
     676                        strResult += ' CRVBOX_HOST_ONLY_PARAM(int)';
     677        return strResult;
    634678
    635679
  • trunk/src/VBox/GuestHost/OpenGL/include/chromium.h

    r76563 r78116  
    138138#ifndef APIENTRY
    139139#define APIENTRY
     140#endif
     141
     142/** For the pointer hack, bugref:9407. */
     143#ifdef IN_GUEST
     144# define CRVBOX_HOST_ONLY_PARAM(a_Stuff)
     145#else
     146# define CRVBOX_HOST_ONLY_PARAM(a_Stuff)    , a_Stuff
    140147#endif
    141148
  • trunk/src/VBox/GuestHost/OpenGL/include/state/cr_client.h

    r69474 r78116  
    6262    GLboolean enabled;
    6363    GLboolean normalized; /* Added with GL_ARB_vertex_program */
     64# ifndef IN_GUEST
     65    GLboolean fRealPtr;   /**< @bugref{9407} */
     66# endif
    6467    int bytesPerIndex;
    6568#ifdef CR_ARB_vertex_buffer_object
     
    6871#ifdef CR_EXT_compiled_vertex_array
    6972    GLboolean locked;
     73# ifndef IN_GUEST
     74    GLboolean fPrevRealPtr; /**< @bugref{9407} */
     75# endif
    7076    unsigned char *prevPtr;
    7177    GLint   prevStride;
  • trunk/src/VBox/GuestHost/OpenGL/spu_loader/dispatchheader.py

    r69392 r78116  
    4545        params = apiutil.Parameters(func_name)
    4646
    47         print('typedef %s (SPU_APIENTRY *%sFunc_t)(%s);' % (return_type, func_name, apiutil.MakePrototypeString(params)))
     47        print('typedef %s (SPU_APIENTRY *%sFunc_t)(%s);' % (return_type, func_name, apiutil.MakePrototypeStringForDispatcher(params)))
    4848print('')
    4949
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_bufferobject.c

    r69392 r78116  
    10411041        {
    10421042            diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->hwid);
    1043             diff_api.VertexPointer(cp->size, cp->type, cp->stride, cp->p);
     1043            diff_api.VertexPointer(cp->size, cp->type, cp->stride, cp->p CRVBOX_HOST_ONLY_PARAM(-1 /*fRealPtr*/));
    10441044        }
    10451045
     
    10481048        {
    10491049            diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->hwid);
    1050             diff_api.ColorPointer(cp->size, cp->type, cp->stride, cp->p);
     1050            diff_api.ColorPointer(cp->size, cp->type, cp->stride, cp->p CRVBOX_HOST_ONLY_PARAM(-1 /*fRealPtr*/));
    10511051        }
    10521052
     
    10551055        {
    10561056            diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->hwid);
    1057             diff_api.FogCoordPointerEXT(cp->type, cp->stride, cp->p);
     1057            diff_api.FogCoordPointerEXT(cp->type, cp->stride, cp->p CRVBOX_HOST_ONLY_PARAM(-1 /*fRealPtr*/));
    10581058        }
    10591059
     
    10621062        {
    10631063            diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->hwid);
    1064             diff_api.SecondaryColorPointerEXT(cp->size, cp->type, cp->stride, cp->p);
     1064            diff_api.SecondaryColorPointerEXT(cp->size, cp->type, cp->stride, cp->p CRVBOX_HOST_ONLY_PARAM(-1 /*fRealPtr*/));
    10651065        }
    10661066
     
    10691069        {
    10701070            diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->hwid);
    1071             diff_api.EdgeFlagPointer(cp->stride, cp->p);
     1071            diff_api.EdgeFlagPointer(cp->stride, cp->p CRVBOX_HOST_ONLY_PARAM(-1 /*fRealPtr*/));
    10721072        }
    10731073
     
    10761076        {
    10771077            diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->hwid);
    1078             diff_api.IndexPointer(cp->type, cp->stride, cp->p);
     1078            diff_api.IndexPointer(cp->type, cp->stride, cp->p CRVBOX_HOST_ONLY_PARAM(-1 /*fRealPtr*/));
    10791079        }
    10801080
     
    10831083        {
    10841084            diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->hwid);
    1085             diff_api.NormalPointer(cp->type, cp->stride, cp->p);
     1085            diff_api.NormalPointer(cp->type, cp->stride, cp->p CRVBOX_HOST_ONLY_PARAM(-1 /*fRealPtr*/));
    10861086        }
    10871087
     
    10941094                    diff_api.ActiveTextureARB(i+GL_TEXTURE0_ARB);
    10951095                diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->hwid);
    1096                 diff_api.TexCoordPointer(cp->size, cp->type, cp->stride, cp->p);
     1096                diff_api.TexCoordPointer(cp->size, cp->type, cp->stride, cp->p CRVBOX_HOST_ONLY_PARAM(-1 /*fRealPtr*/));
    10971097            }
    10981098        }
     
    11081108            {
    11091109                diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->hwid);
    1110                 diff_api.VertexAttribPointerARB(i, cp->size, cp->type, cp->normalized, cp->stride, cp->p);
     1110                diff_api.VertexAttribPointerARB(i, cp->size, cp->type, cp->normalized, cp->stride, cp->p CRVBOX_HOST_ONLY_PARAM(-1 /*fRealPtr*/));
    11111111            }
    11121112        }
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_client.c

    r71903 r78116  
    7373}
    7474
    75 static void crStateUnlockClientPointer(CRClientPointer* cp)
     75static void crStateUnlockClientPointer(CRClientPointer* cp, int fFreePointer)
    7676{
    7777    if (cp->locked)
    7878    {
    7979#ifndef IN_GUEST
    80         if (cp->p) crFree(cp->p);
     80        if (cp->p && fFreePointer != 0)
     81        {
     82            if (cp->fRealPtr)
     83            {
     84                crFree(cp->p);
     85                cp->fRealPtr = 0;
     86            }
     87            cp->p = NULL;
     88        }
     89#else
     90        RT_NOREF(fFreePointer);
    8191#endif
    8292        cp->locked = GL_FALSE;
     
    92102        unsigned int i;
    93103
    94         crStateUnlockClientPointer(&c->array.v);
    95         crStateUnlockClientPointer(&c->array.c);
    96         crStateUnlockClientPointer(&c->array.f);
    97         crStateUnlockClientPointer(&c->array.s);
    98         crStateUnlockClientPointer(&c->array.e);
    99         crStateUnlockClientPointer(&c->array.i);
    100         crStateUnlockClientPointer(&c->array.n);
     104        crStateUnlockClientPointer(&c->array.v, 1 /*fFreePointer*/);
     105        crStateUnlockClientPointer(&c->array.c, 1 /*fFreePointer*/);
     106        crStateUnlockClientPointer(&c->array.f, 1 /*fFreePointer*/);
     107        crStateUnlockClientPointer(&c->array.s, 1 /*fFreePointer*/);
     108        crStateUnlockClientPointer(&c->array.e, 1 /*fFreePointer*/);
     109        crStateUnlockClientPointer(&c->array.i, 1 /*fFreePointer*/);
     110        crStateUnlockClientPointer(&c->array.n, 1 /*fFreePointer*/);
    101111        for (i = 0 ; i < CR_MAX_TEXTURE_UNITS ; i++)
    102112        {
    103             crStateUnlockClientPointer(&c->array.t[i]);
     113            crStateUnlockClientPointer(&c->array.t[i], 1 /*fFreePointer*/);
    104114        }
    105115        for (i = 0; i < CR_MAX_VERTEX_ATTRIBS; i++)
    106116        {
    107             crStateUnlockClientPointer(&c->array.a[i]);
     117            crStateUnlockClientPointer(&c->array.a[i], 1 /*fFreePointer*/);
    108118        }
    109119    }
     
    152162    c->array.v.stride = 0;
    153163    c->array.v.enabled = 0;
     164#ifndef IN_GUEST
     165    c->array.v.fRealPtr = 0;
     166#endif
    154167#ifdef CR_ARB_vertex_buffer_object
    155168    c->array.v.buffer = ctx->bufferobject.arrayBuffer;
     
    161174    c->array.v.prevPtr = NULL;
    162175    c->array.v.prevStride = 0;
     176# ifndef IN_GUEST
     177    c->array.v.fPrevRealPtr = 0;
     178# endif
    163179#endif
    164180
     
    169185    c->array.c.stride = 0;
    170186    c->array.c.enabled = 0;
     187#ifndef IN_GUEST
     188    c->array.c.fRealPtr = 0;
     189#endif
    171190#ifdef CR_ARB_vertex_buffer_object
    172191    c->array.c.buffer = ctx->bufferobject.arrayBuffer;
     
    178197    c->array.c.prevPtr = NULL;
    179198    c->array.c.prevStride = 0;
     199# ifndef IN_GUEST
     200    c->array.c.fPrevRealPtr = 0;
     201# endif
    180202#endif
    181203
     
    186208    c->array.f.stride = 0;
    187209    c->array.f.enabled = 0;
     210#ifndef IN_GUEST
     211    c->array.f.fRealPtr = 0;
     212#endif
    188213#ifdef CR_ARB_vertex_buffer_object
    189214    c->array.f.buffer = ctx->bufferobject.arrayBuffer;
     
    195220    c->array.f.prevPtr = NULL;
    196221    c->array.f.prevStride = 0;
     222# ifndef IN_GUEST
     223    c->array.f.fPrevRealPtr = 0;
     224# endif
    197225#endif
    198226
     
    203231    c->array.s.stride = 0;
    204232    c->array.s.enabled = 0;
     233#ifndef IN_GUEST
     234    c->array.s.fRealPtr = 0;
     235#endif
    205236#ifdef CR_ARB_vertex_buffer_object
    206237    c->array.s.buffer = ctx->bufferobject.arrayBuffer;
     
    212243    c->array.s.prevPtr = NULL;
    213244    c->array.s.prevStride = 0;
     245# ifndef IN_GUEST
     246    c->array.s.fPrevRealPtr = 0;
     247# endif
    214248#endif
    215249
     
    220254    c->array.e.stride = 0;
    221255    c->array.e.enabled = 0;
     256#ifndef IN_GUEST
     257    c->array.e.fRealPtr = 0;
     258#endif
    222259#ifdef CR_ARB_vertex_buffer_object
    223260    c->array.e.buffer = ctx->bufferobject.arrayBuffer;
     
    229266    c->array.e.prevPtr = NULL;
    230267    c->array.e.prevStride = 0;
     268# ifndef IN_GUEST
     269    c->array.e.fPrevRealPtr = 0;
     270# endif
    231271#endif
    232272
     
    237277    c->array.i.stride = 0;
    238278    c->array.i.enabled = 0;
     279#ifndef IN_GUEST
     280    c->array.i.fRealPtr = 0;
     281#endif
    239282#ifdef CR_ARB_vertex_buffer_object
    240283    c->array.i.buffer = ctx->bufferobject.arrayBuffer;
     
    246289    c->array.i.prevPtr = NULL;
    247290    c->array.i.prevStride = 0;
     291# ifndef IN_GUEST
     292    c->array.i.fPrevRealPtr = 0;
     293# endif
    248294#endif
    249295
     
    254300    c->array.n.stride = 0;
    255301    c->array.n.enabled = 0;
     302#ifndef IN_GUEST
     303    c->array.n.fRealPtr = 0;
     304#endif
    256305#ifdef CR_ARB_vertex_buffer_object
    257306    c->array.n.buffer = ctx->bufferobject.arrayBuffer;
     
    263312    c->array.n.prevPtr = NULL;
    264313    c->array.n.prevStride = 0;
     314# ifndef IN_GUEST
     315    c->array.n.fPrevRealPtr = 0;
     316# endif
    265317#endif
    266318
     
    273325        c->array.t[i].stride = 0;
    274326        c->array.t[i].enabled = 0;
     327#ifndef IN_GUEST
     328        c->array.t[i].fRealPtr = 0;
     329#endif
    275330#ifdef CR_ARB_vertex_buffer_object
    276331        c->array.t[i].buffer = ctx->bufferobject.arrayBuffer;
     
    283338        c->array.t[i].prevStride = 0;
    284339#endif
     340# ifndef IN_GUEST
     341        c->array.t[i].fPrevRealPtr = 0;
     342# endif
    285343    }
    286344
     
    292350        c->array.a[i].size = 4;
    293351        c->array.a[i].stride = 0;
     352# ifndef IN_GUEST
     353        c->array.a[i].fRealPtr = 0;
     354# endif
    294355#ifdef CR_ARB_vertex_buffer_object
    295356        c->array.a[i].buffer = ctx->bufferobject.arrayBuffer;
     
    301362        c->array.a[i].prevPtr = NULL;
    302363        c->array.a[i].prevStride = 0;
     364#  ifndef IN_GUEST
     365        c->array.a[i].fPrevRealPtr = 0;
     366#  endif
    303367#endif
    304368    }
     
    586650
    587651static void
    588 crStateClientSetPointer(CRClientPointer *cp, GLint size,
    589                                                 GLenum type, GLboolean normalized,
    590                                                 GLsizei stride, const GLvoid *pointer)
     652crStateClientSetPointer(CRClientPointer *cp, GLint size, GLenum type, GLboolean normalized, GLsizei stride,
     653                        const GLvoid *pointer  CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    591654{
    592655    CRContext *g = GetCurrentContext();
    593656
    594657#ifdef CR_EXT_compiled_vertex_array
    595     crStateUnlockClientPointer(cp);
     658    crStateUnlockClientPointer(cp, 0 /*fFreePointer*/);
     659# ifndef IN_GUEST
     660    if (cp->prevPtr && cp->fPrevRealPtr)
     661    {
     662        crFree(cp->prevPtr);
     663        cp->fPrevRealPtr = 0;
     664    }
     665# endif
    596666    cp->prevPtr = cp->p;
    597667    cp->prevStride = cp->stride;
     668# ifndef IN_GUEST
     669    cp->fPrevRealPtr = cp->fRealPtr;
     670# endif
    598671#endif
    599672
     
    602675    cp->type = type;
    603676    cp->normalized = normalized;
     677#ifndef IN_GUEST
     678    cp->fRealPtr = fRealPtr;
     679#endif
    604680
    605681    /* Calculate the bytes per index for address calculation */
     
    653729}
    654730
    655 void STATE_APIENTRY crStateVertexPointer(GLint size, GLenum type,
    656         GLsizei stride, const GLvoid *p)
     731void STATE_APIENTRY crStateVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *p CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    657732{
    658733    CRContext *g = GetCurrentContext();
     
    680755    }
    681756
    682     crStateClientSetPointer(&(c->array.v), size, type, GL_FALSE, stride, p);
     757    crStateClientSetPointer(&(c->array.v), size, type, GL_FALSE, stride, p CRVBOX_HOST_ONLY_PARAM(fRealPtr));
    683758    DIRTY(cb->dirty, g->neg_bitid);
    684759    DIRTY(cb->clientPointer, g->neg_bitid);
     
    686761}
    687762
    688 void STATE_APIENTRY crStateColorPointer(GLint size, GLenum type,
    689         GLsizei stride, const GLvoid *p)
     763void STATE_APIENTRY crStateColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *p CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    690764{
    691765    CRContext *g = GetCurrentContext();
     
    715789    }
    716790
    717     crStateClientSetPointer(&(c->array.c), size, type, GL_TRUE, stride, p);
     791    crStateClientSetPointer(&(c->array.c), size, type, GL_TRUE, stride, p CRVBOX_HOST_ONLY_PARAM(fRealPtr));
    718792    DIRTY(cb->dirty, g->neg_bitid);
    719793    DIRTY(cb->clientPointer, g->neg_bitid);
     
    721795}
    722796
    723 void STATE_APIENTRY crStateSecondaryColorPointerEXT(GLint size,
    724         GLenum type, GLsizei stride, const GLvoid *p)
     797void STATE_APIENTRY crStateSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid *p CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    725798{
    726799    CRContext *g = GetCurrentContext();
     
    765838    }
    766839
    767     crStateClientSetPointer(&(c->array.s), size, type, GL_TRUE, stride, p);
     840    crStateClientSetPointer(&(c->array.s), size, type, GL_TRUE, stride, p CRVBOX_HOST_ONLY_PARAM(fRealPtr));
    768841    DIRTY(cb->dirty, g->neg_bitid);
    769842    DIRTY(cb->clientPointer, g->neg_bitid);
     
    771844}
    772845
    773 void STATE_APIENTRY crStateIndexPointer(GLenum type, GLsizei stride,
    774         const GLvoid *p)
     846void STATE_APIENTRY crStateIndexPointer(GLenum type, GLsizei stride, const GLvoid *p CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    775847{
    776848    CRContext *g = GetCurrentContext();
     
    793865    }
    794866
    795     crStateClientSetPointer(&(c->array.i), 1, type, GL_TRUE, stride, p);
     867    crStateClientSetPointer(&(c->array.i), 1, type, GL_TRUE, stride, p CRVBOX_HOST_ONLY_PARAM(fRealPtr));
    796868    DIRTY(cb->dirty, g->neg_bitid);
    797869    DIRTY(cb->clientPointer, g->neg_bitid);
     
    799871}
    800872
    801 void STATE_APIENTRY crStateNormalPointer(GLenum type, GLsizei stride,
    802         const GLvoid *p)
     873void STATE_APIENTRY crStateNormalPointer(GLenum type, GLsizei stride, const GLvoid *p CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    803874{
    804875    CRContext *g = GetCurrentContext();
     
    822893    }
    823894
    824     crStateClientSetPointer(&(c->array.n), 3, type, GL_TRUE, stride, p);
     895    crStateClientSetPointer(&(c->array.n), 3, type, GL_TRUE, stride, p CRVBOX_HOST_ONLY_PARAM(fRealPtr));
    825896    DIRTY(cb->dirty, g->neg_bitid);
    826897    DIRTY(cb->clientPointer, g->neg_bitid);
     
    828899}
    829900
    830 void STATE_APIENTRY crStateTexCoordPointer(GLint size, GLenum type,
    831         GLsizei stride, const GLvoid *p)
     901void STATE_APIENTRY crStateTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *p CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    832902{
    833903    CRContext *g = GetCurrentContext();
     
    855925    }
    856926
    857     crStateClientSetPointer(&(c->array.t[c->curClientTextureUnit]), size, type, GL_FALSE, stride, p);
     927    crStateClientSetPointer(&(c->array.t[c->curClientTextureUnit]), size, type, GL_FALSE, stride, p CRVBOX_HOST_ONLY_PARAM(fRealPtr));
    858928    DIRTY(cb->dirty, g->neg_bitid);
    859929    DIRTY(cb->clientPointer, g->neg_bitid);
     
    861931}
    862932
    863 void STATE_APIENTRY crStateEdgeFlagPointer(GLsizei stride, const GLvoid *p)
     933void STATE_APIENTRY crStateEdgeFlagPointer(GLsizei stride, const GLvoid *p CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    864934{
    865935    CRContext *g = GetCurrentContext();
     
    876946    }
    877947
    878     crStateClientSetPointer(&(c->array.e), 1, GL_UNSIGNED_BYTE, GL_FALSE, stride, p);
     948    crStateClientSetPointer(&(c->array.e), 1, GL_UNSIGNED_BYTE, GL_FALSE, stride, p CRVBOX_HOST_ONLY_PARAM(fRealPtr));
    879949    DIRTY(cb->dirty, g->neg_bitid);
    880950    DIRTY(cb->clientPointer, g->neg_bitid);
     
    882952}
    883953
    884 void STATE_APIENTRY crStateFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *p)
     954void STATE_APIENTRY crStateFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *p CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    885955{
    886956    CRContext *g = GetCurrentContext();
     
    905975    }
    906976
    907     crStateClientSetPointer(&(c->array.f), 1, type, GL_FALSE, stride, p);
     977    crStateClientSetPointer(&(c->array.f), 1, type, GL_FALSE, stride, p CRVBOX_HOST_ONLY_PARAM(fRealPtr));
    908978    DIRTY(cb->dirty, g->neg_bitid);
    909979    DIRTY(cb->clientPointer, g->neg_bitid);
     
    912982
    913983
    914 void STATE_APIENTRY crStateVertexAttribPointerNV(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *p)
     984void STATE_APIENTRY crStateVertexAttribPointerNV(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *p CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    915985{
    916986    GLboolean normalized = GL_FALSE;
     
    922992        return;
    923993    }
    924     crStateVertexAttribPointerARB(index, size, type, normalized, stride, p);
    925 }
    926 
    927 
    928 void STATE_APIENTRY crStateVertexAttribPointerARB(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *p)
     994    crStateVertexAttribPointerARB(index, size, type, normalized, stride, p CRVBOX_HOST_ONLY_PARAM(fRealPtr));
     995}
     996
     997
     998void STATE_APIENTRY crStateVertexAttribPointerARB(GLuint index, GLint size, GLenum type, GLboolean normalized,
     999                                                  GLsizei stride, const GLvoid *p CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    9291000{
    9301001    CRContext *g = GetCurrentContext();
     
    9591030    }
    9601031
    961     crStateClientSetPointer(&(c->array.a[index]), size, type, normalized, stride, p);
     1032    crStateClientSetPointer(&(c->array.a[index]), size, type, normalized, stride, p CRVBOX_HOST_ONLY_PARAM(fRealPtr));
    9621033    DIRTY(cb->dirty, g->neg_bitid);
    9631034    DIRTY(cb->clientPointer, g->neg_bitid);
     
    10051076** lets me use the same glDrawArrays method.
    10061077*/
    1007 void STATE_APIENTRY crStateInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *p)
     1078void STATE_APIENTRY crStateInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *p CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    10081079{
    10091080    CRContext *g = GetCurrentContext();
     
    10631134
    10641135#ifdef CR_EXT_compiled_vertex_array
    1065     crStateUnlockClientPointer(cp);
     1136    crStateUnlockClientPointer(cp, 1 /*fFreePointer*/);
    10661137#endif
    10671138
     
    11431214    cp->stride = stride;
    11441215#ifdef CR_EXT_compiled_vertex_array
    1145     crStateUnlockClientPointer(cp);
     1216    crStateUnlockClientPointer(cp, 1 /*fFreePointer*/);
    11461217#endif
    11471218
     
    11941265    cp->stride = stride;
    11951266#ifdef CR_EXT_compiled_vertex_array
    1196     crStateUnlockClientPointer(cp);
     1267    crStateUnlockClientPointer(cp, 1 /*fFreePointer*/);
    11971268#endif
    11981269
     
    12681339    cp->stride = stride;
    12691340#ifdef CR_EXT_compiled_vertex_array
    1270     crStateUnlockClientPointer(cp);
     1341    crStateUnlockClientPointer(cp, 1 /*fFreePointer*/);
    12711342#endif
    12721343
     
    14641535static void crStateLockClientPointer(CRClientPointer* cp)
    14651536{
    1466     crStateUnlockClientPointer(cp);
     1537    crStateUnlockClientPointer(cp, 1 /*fFreePointer*/);
    14671538    if (cp->enabled)
    14681539    {
     
    15271598    for (i=0; i<CRSTATECLIENT_MAX_VERTEXARRAYS; ++i)
    15281599    {
    1529         crStateUnlockClientPointer(crStateGetClientPointerByIndex(i, &c->array));
    1530     }
    1531 }
    1532 
    1533 void STATE_APIENTRY crStateVertexArrayRangeNV(GLsizei length, const GLvoid *pointer)
     1600        crStateUnlockClientPointer(crStateGetClientPointerByIndex(i, &c->array), 1 /*fFreePointer*/);
     1601    }
     1602}
     1603
     1604void STATE_APIENTRY crStateVertexArrayRangeNV(GLsizei length, const GLvoid *pointer CRVBOX_HOST_ONLY_PARAM(int fRealPtr))
    15341605{
    15351606  /* XXX todo */
    15361607    crWarning("crStateVertexArrayRangeNV not implemented");
    1537     (void)length; (void)pointer;
     1608    (void)length; (void)pointer CRVBOX_HOST_ONLY_PARAM((void)fRealPtr);
    15381609}
    15391610
     
    17361807                    idHwArrayBuffer = idHwArrayBufferUsed;
    17371808                }
    1738                 diff_api.VertexPointer(to->array.v.size, to->array.v.type,
    1739                                                              to->array.v.stride, to->array.v.p);
     1809                diff_api.VertexPointer(to->array.v.size, to->array.v.type, to->array.v.stride, to->array.v.p CRVBOX_HOST_ONLY_PARAM(to->array.v.fRealPtr));
    17401810                from->array.v.size = to->array.v.size;
    17411811                from->array.v.type = to->array.v.type;
     
    17581828                    idHwArrayBuffer = idHwArrayBufferUsed;
    17591829                }
    1760                 diff_api.NormalPointer(to->array.n.type,
    1761                                                              to->array.n.stride, to->array.n.p);
     1830                diff_api.NormalPointer(to->array.n.type, to->array.n.stride, to->array.n.p CRVBOX_HOST_ONLY_PARAM(to->array.n.fRealPtr));
    17621831                from->array.n.type = to->array.n.type;
    17631832                from->array.n.stride = to->array.n.stride;
     
    17801849                    idHwArrayBuffer = idHwArrayBufferUsed;
    17811850                }
    1782                 diff_api.ColorPointer(to->array.c.size, to->array.c.type,
    1783                                                             to->array.c.stride, to->array.c.p);
     1851                diff_api.ColorPointer(to->array.c.size, to->array.c.type, to->array.c.stride, to->array.c.p CRVBOX_HOST_ONLY_PARAM(to->array.c.fRealPtr));
    17841852                from->array.c.size = to->array.c.size;
    17851853                from->array.c.type = to->array.c.type;
     
    18021870                    idHwArrayBuffer = idHwArrayBufferUsed;
    18031871                }
    1804                 diff_api.IndexPointer(to->array.i.type,
    1805                                                             to->array.i.stride, to->array.i.p);
     1872                diff_api.IndexPointer(to->array.i.type, to->array.i.stride, to->array.i.p CRVBOX_HOST_ONLY_PARAM(to->array.i.fRealPtr));
    18061873                from->array.i.type = to->array.i.type;
    18071874                from->array.i.stride = to->array.i.stride;
     
    18271894                    diff_api.ClientActiveTextureARB(GL_TEXTURE0_ARB + i);
    18281895                    curClientTextureUnit = i;
    1829                     diff_api.TexCoordPointer(to->array.t[i].size, to->array.t[i].type,
    1830                                                                 to->array.t[i].stride, to->array.t[i].p);
     1896                    diff_api.TexCoordPointer(to->array.t[i].size, to->array.t[i].type, to->array.t[i].stride, to->array.t[i].p CRVBOX_HOST_ONLY_PARAM(to->array.t[i].fRealPtr));
    18311897                    from->array.t[i].size = to->array.t[i].size;
    18321898                    from->array.t[i].type = to->array.t[i].type;
     
    18491915                    idHwArrayBuffer = idHwArrayBufferUsed;
    18501916                }
    1851                 diff_api.EdgeFlagPointer(to->array.e.stride, to->array.e.p);
     1917                diff_api.EdgeFlagPointer(to->array.e.stride, to->array.e.p CRVBOX_HOST_ONLY_PARAM(to->array.e.fRealPtr));
    18521918                from->array.e.stride = to->array.e.stride;
    18531919                from->array.e.p = to->array.e.p;
     
    18691935                    idHwArrayBuffer = idHwArrayBufferUsed;
    18701936                }
    1871                 diff_api.SecondaryColorPointerEXT(to->array.s.size, to->array.s.type,
    1872                                                                                     to->array.s.stride, to->array.s.p);
     1937                diff_api.SecondaryColorPointerEXT(to->array.s.size, to->array.s.type, to->array.s.stride, to->array.s.p CRVBOX_HOST_ONLY_PARAM(to->array.s.fRealPtr));
    18731938                from->array.s.size = to->array.s.size;
    18741939                from->array.s.type = to->array.s.type;
     
    18911956                    idHwArrayBuffer = idHwArrayBufferUsed;
    18921957                }
    1893                 diff_api.FogCoordPointerEXT(to->array.f.type,
    1894                                                                         to->array.f.stride, to->array.f.p);
     1958                diff_api.FogCoordPointerEXT(to->array.f.type, to->array.f.stride, to->array.f.p CRVBOX_HOST_ONLY_PARAM(to->array.f.fRealPtr));
    18951959                from->array.f.type = to->array.f.type;
    18961960                from->array.f.stride = to->array.f.stride;
     
    19161980                        idHwArrayBuffer = idHwArrayBufferUsed;
    19171981                    }
    1918                     diff_api.VertexAttribPointerARB(i, to->array.a[i].size,
    1919                                                                                     to->array.a[i].type,
    1920                                                                                     to->array.a[i].normalized,
    1921                                                                                     to->array.a[i].stride,
    1922                                                                                     to->array.a[i].p);
     1982                    diff_api.VertexAttribPointerARB(i, to->array.a[i].size, to->array.a[i].type, to->array.a[i].normalized,
     1983                                                    to->array.a[i].stride, to->array.a[i].p CRVBOX_HOST_ONLY_PARAM(to->array.a[i].fRealPtr));
    19231984                    from->array.a[i].size = to->array.a[i].size;
    19241985                    from->array.a[i].type = to->array.a[i].type;
     
    20322093                    idHwArrayBuffer = idHwArrayBufferUsed;
    20332094                }
    2034                 diff_api.VertexPointer(to->array.v.size, to->array.v.type,
    2035                                                              to->array.v.stride, to->array.v.p);
     2095                diff_api.VertexPointer(to->array.v.size, to->array.v.type, to->array.v.stride, to->array.v.p CRVBOX_HOST_ONLY_PARAM(to->array.v.fRealPtr));
    20362096                FILLDIRTY(cb->v);
    20372097                FILLDIRTY(cb->clientPointer);
     
    20522112                    idHwArrayBuffer = idHwArrayBufferUsed;
    20532113                }
    2054                 diff_api.NormalPointer(to->array.n.type,
    2055                                                              to->array.n.stride, to->array.n.p);
     2114                diff_api.NormalPointer(to->array.n.type, to->array.n.stride, to->array.n.p CRVBOX_HOST_ONLY_PARAM(to->array.n.fRealPtr));
    20562115                FILLDIRTY(cb->n);
    20572116                FILLDIRTY(cb->clientPointer);
     
    20732132                    idHwArrayBuffer = idHwArrayBufferUsed;
    20742133                }
    2075                 diff_api.ColorPointer(to->array.c.size, to->array.c.type,
    2076                                                             to->array.c.stride, to->array.c.p);
     2134                diff_api.ColorPointer(to->array.c.size, to->array.c.type, to->array.c.stride, to->array.c.p CRVBOX_HOST_ONLY_PARAM(to->array.c.fRealPtr));
    20772135                FILLDIRTY(cb->c);
    20782136                FILLDIRTY(cb->clientPointer);
     
    20932151                    idHwArrayBuffer = idHwArrayBufferUsed;
    20942152                }
    2095                 diff_api.IndexPointer(to->array.i.type,
    2096                                                             to->array.i.stride, to->array.i.p);
     2153                diff_api.IndexPointer(to->array.i.type, to->array.i.stride, to->array.i.p CRVBOX_HOST_ONLY_PARAM(to->array.i.fRealPtr));
    20972154                FILLDIRTY(cb->i);
    20982155                FILLDIRTY(cb->dirty);
     
    21172174                    diff_api.ClientActiveTextureARB(GL_TEXTURE0_ARB + i);
    21182175                    curClientTextureUnit = i;
    2119                     diff_api.TexCoordPointer(to->array.t[i].size, to->array.t[i].type,
    2120                                                                 to->array.t[i].stride, to->array.t[i].p);
     2176                    diff_api.TexCoordPointer(to->array.t[i].size, to->array.t[i].type, to->array.t[i].stride, to->array.t[i].p CRVBOX_HOST_ONLY_PARAM(to->array.t[i].fRealPtr));
    21212177                    FILLDIRTY(cb->t[i]);
    21222178                    FILLDIRTY(cb->clientPointer);
     
    21372193                    idHwArrayBuffer = idHwArrayBufferUsed;
    21382194                }
    2139                 diff_api.EdgeFlagPointer(to->array.e.stride, to->array.e.p);
     2195                diff_api.EdgeFlagPointer(to->array.e.stride, to->array.e.p CRVBOX_HOST_ONLY_PARAM(to->array.e.fRealPtr));
    21402196                FILLDIRTY(cb->e);
    21412197                FILLDIRTY(cb->clientPointer);
     
    21572213                    idHwArrayBuffer = idHwArrayBufferUsed;
    21582214                }
    2159                 diff_api.SecondaryColorPointerEXT(to->array.s.size, to->array.s.type,
    2160                                                                                     to->array.s.stride, to->array.s.p);
     2215                diff_api.SecondaryColorPointerEXT(to->array.s.size, to->array.s.type, to->array.s.stride, to->array.s.p CRVBOX_HOST_ONLY_PARAM(to->array.s.fRealPtr));
    21612216                FILLDIRTY(cb->s);
    21622217                FILLDIRTY(cb->clientPointer);
     
    21772232                    idHwArrayBuffer = idHwArrayBufferUsed;
    21782233                }
    2179                 diff_api.FogCoordPointerEXT(to->array.f.type,
    2180                                                                         to->array.f.stride, to->array.f.p);
     2234                diff_api.FogCoordPointerEXT(to->array.f.type, to->array.f.stride, to->array.f.p CRVBOX_HOST_ONLY_PARAM(to->array.f.fRealPtr));
    21812235                FILLDIRTY(cb->f);
    21822236                FILLDIRTY(cb->clientPointer);
     
    22012255                        idHwArrayBuffer = idHwArrayBufferUsed;
    22022256                    }
    2203                     diff_api.VertexAttribPointerARB(i, to->array.a[i].size,
    2204                                                                                     to->array.a[i].type,
    2205                                                                                     to->array.a[i].normalized,
    2206                                                                                     to->array.a[i].stride,
    2207                                                                                     to->array.a[i].p);
     2257                    diff_api.VertexAttribPointerARB(i, to->array.a[i].size, to->array.a[i].type, to->array.a[i].normalized,
     2258                                                    to->array.a[i].stride, to->array.a[i].p  CRVBOX_HOST_ONLY_PARAM(to->array.a[i].fRealPtr));
    22082259                    FILLDIRTY(cb->a[i]);
    22092260                    FILLDIRTY(cb->clientPointer);
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_funcs.py

    r69392 r78116  
    4141        return_type = apiutil.ReturnType(func_name)
    4242        params = apiutil.Parameters(func_name)
    43         print('DECLEXPORT(%s) STATE_APIENTRY crState%s(%s);' % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     43        print('DECLEXPORT(%s) STATE_APIENTRY crState%s(%s);' % (return_type, func_name, apiutil.MakeDeclarationStringForDispatcher(params)))
    4444
    4545for func_name in apiutil.AllSpecials( "state_feedback" ):
    4646        return_type = apiutil.ReturnType(func_name)
    4747        params = apiutil.Parameters(func_name)
    48         print('DECLEXPORT(%s) STATE_APIENTRY crStateFeedback%s(%s);' % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     48        print('DECLEXPORT(%s) STATE_APIENTRY crStateFeedback%s(%s);' % (return_type, func_name, apiutil.MakeDeclarationStringForDispatcher(params)))
    4949
    5050for func_name in apiutil.AllSpecials( "state_select" ):
    5151        return_type = apiutil.ReturnType(func_name)
    5252        params = apiutil.Parameters(func_name)
    53         print('DECLEXPORT(%s) STATE_APIENTRY crStateSelect%s(%s);' % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     53        print('DECLEXPORT(%s) STATE_APIENTRY crStateSelect%s(%s);' % (return_type, func_name, apiutil.MakeDeclarationStringForDispatcher(params)))
    5454
    5555
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_snapshot.c

    r76553 r78116  
    12591259    {
    12601260        CRASSERT(cp->p);
    1261         rc = SSMR3PutMem(pSSM, cp->p, cp->stride*(pArrays->lockFirst+pArrays->lockCount));
    1262         AssertRCReturn(rc, rc);
     1261        if (cp->fRealPtr)
     1262        {
     1263            rc = SSMR3PutMem(pSSM, cp->p, cp->stride*(pArrays->lockFirst+pArrays->lockCount));
     1264            AssertRCReturn(rc, rc);
     1265        }
     1266        else
     1267        {
     1268            crError("crStateSaveClientPointer: cp=%#p doesn't point to host memory!\n", cp);
     1269            return VERR_INVALID_STATE;
     1270        }
    12631271    }
    12641272#endif
  • trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp

    r76553 r78116  
    767767
    768768        pBlitter->pDispatch->EnableClientState(GL_VERTEX_ARRAY);
    769         pBlitter->pDispatch->VertexPointer(2, GL_FLOAT, 0, pVerticies);
     769        pBlitter->pDispatch->VertexPointer(2, GL_FLOAT, 0, pVerticies CRVBOX_HOST_ONLY_PARAM(1 /*fRealPtr*/));
    770770
    771771        pBlitter->pDispatch->EnableClientState(GL_TEXTURE_COORD_ARRAY);
    772         pBlitter->pDispatch->TexCoordPointer(2, GL_FLOAT, 0, pTexCoords);
     772        pBlitter->pDispatch->TexCoordPointer(2, GL_FLOAT, 0, pTexCoords CRVBOX_HOST_ONLY_PARAM(1 /*fRealPtr*/));
    773773
    774774        pBlitter->pDispatch->Enable(pSrc->target);
     
    795795
    796796        pBlitter->pDispatch->EnableClientState(GL_VERTEX_ARRAY);
    797         pBlitter->pDispatch->VertexPointer(2, GL_FLOAT, 0, pVerticies);
     797        pBlitter->pDispatch->VertexPointer(2, GL_FLOAT, 0, pVerticies CRVBOX_HOST_ONLY_PARAM(1 /*fRealPtr*/));
    798798
    799799        pBlitter->pDispatch->EnableClientState(GL_TEXTURE_COORD_ARRAY);
    800         pBlitter->pDispatch->TexCoordPointer(2, GL_FLOAT, 0, pTexCoords);
     800        pBlitter->pDispatch->TexCoordPointer(2, GL_FLOAT, 0, pTexCoords CRVBOX_HOST_ONLY_PARAM(1 /*fRealPtr*/));
    801801
    802802        pBlitter->pDispatch->Enable(pSrc->target);
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch.py

    r69390 r78116  
    3535    if wrap:
    3636        print('#if defined(CR_%s)' % wrap)
    37     print('void SERVER_DISPATCH_APIENTRY crServerDispatch%s(%s)' % ( func_name, apiutil.MakeDeclarationString( params ) ))
     37    print('void SERVER_DISPATCH_APIENTRY crServerDispatch%s(%s)' % ( func_name, apiutil.MakeDeclarationStringForDispatcher( params ) ))
    3838    print('{')
    39     print('\tcrState%s(%s);' % (func_name, apiutil.MakeCallString( params ) ))
    40     print('\tcr_server.head_spu->dispatch_table.%s(%s);' % (func_name, apiutil.MakeCallString( params ) ))
     39    print('\tcrState%s(%s);' % (func_name, apiutil.MakeCallStringForDispatcher( params ) ))
     40    print('\tcr_server.head_spu->dispatch_table.%s(%s);' % (func_name, apiutil.MakeCallStringForDispatcher( params ) ))
    4141    print('}')
    4242    if wrap:
     
    109109        print('\t%s' % (condition))
    110110        print('\t{')
    111         print('\t\tcr_server.head_spu->dispatch_table.%s(%s);' % (func_name, apiutil.MakeCallString(params) ))
     111        print('\t\tcr_server.head_spu->dispatch_table.%s(%s);' % (func_name, apiutil.MakeCallStringForDispatcher(params) ))
    112112        print("\t\tcr_server.current.c.%s.%s%s = cr_unpackData;" % (name,type,array))
    113113        print('\t}')
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch_header.py

    r69390 r78116  
    4141        return_type = apiutil.ReturnType(func_name)
    4242       
    43         print('%s SERVER_DISPATCH_APIENTRY crServerDispatch%s(%s);' % (return_type, func_name, apiutil.MakeDeclarationString( params )))
     43        print('%s SERVER_DISPATCH_APIENTRY crServerDispatch%s(%s);' % (return_type, func_name, apiutil.MakeDeclarationStringForDispatcher( params )))
    4444
    4545print("""
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack.py

    r78086 r78116  
    122122    else:
    123123        print("\t", end="")
    124     print("cr_unpackDispatch.%s(%s);" % (func_name, apiutil.MakeCallString(params)))
     124    print("cr_unpackDispatch.%s(%s);" % (func_name, apiutil.MakeCallStringForDispatcher(params)))
    125125
    126126
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_arrays.c

    r71903 r78116  
    2626    GLsizei stride = READ_DATA( 16, GLsizei );
    2727    GLintptrARB pointer = (GLintptrARB) READ_DATA( 20, GLuint );
    28     cr_unpackDispatch.VertexPointer( size, type, stride, (void *) pointer );
     28    cr_unpackDispatch.VertexPointer( size, type, stride, (void *) pointer, false /*fRealPtr*/ );
    2929}
    3030
     
    3535    GLsizei stride = READ_DATA( 16, GLsizei );
    3636    GLintptrARB pointer = READ_DATA( 20, GLuint );
    37     cr_unpackDispatch.TexCoordPointer( size, type, stride, (void *) pointer );
     37    cr_unpackDispatch.TexCoordPointer( size, type, stride, (void *) pointer, false /*fRealPtr*/ );
    3838}
    3939
     
    4343    GLsizei stride = READ_DATA( 12, GLsizei );
    4444    GLintptrARB pointer = READ_DATA( 16, GLuint );
    45     cr_unpackDispatch.NormalPointer( type, stride, (void *) pointer );
     45    cr_unpackDispatch.NormalPointer( type, stride, (void *) pointer, false /*fRealPtr*/ );
    4646}
    4747
     
    5151    GLsizei stride = READ_DATA( 12, GLsizei );
    5252    GLintptrARB pointer = READ_DATA( 16, GLuint );
    53     cr_unpackDispatch.IndexPointer( type, stride, (void *) pointer );
     53    cr_unpackDispatch.IndexPointer( type, stride, (void *) pointer, false /*fRealPtr*/ );
    5454}
    5555
     
    5858    GLsizei stride = READ_DATA( 8, GLsizei );
    5959    GLintptrARB pointer = READ_DATA( 12, GLuint );
    60     cr_unpackDispatch.EdgeFlagPointer( stride, (void *) pointer );
     60    cr_unpackDispatch.EdgeFlagPointer( stride, (void *) pointer, false /*fRealPtr*/ );
    6161}
    6262
     
    6767    GLsizei stride = READ_DATA( 16, GLsizei );
    6868    GLintptrARB pointer = READ_DATA( 20, GLuint );
    69     cr_unpackDispatch.ColorPointer( size, type, stride, (void *) pointer );
     69    cr_unpackDispatch.ColorPointer( size, type, stride, (void *) pointer, false /*fRealPtr*/ );
    7070}
    7171
     
    7575    GLsizei stride = READ_DATA( 12, GLsizei );
    7676    GLintptrARB pointer = READ_DATA( 16, GLuint );
    77     cr_unpackDispatch.FogCoordPointerEXT( type, stride, (void *) pointer );
     77    cr_unpackDispatch.FogCoordPointerEXT( type, stride, (void *) pointer, false /*fRealPtr*/ );
    7878}
    7979
     
    8484    GLsizei stride = READ_DATA( 16, GLsizei );
    8585    GLintptrARB pointer = READ_DATA( 20, GLuint );
    86     cr_unpackDispatch.SecondaryColorPointerEXT( size, type, stride, (void *) pointer );
     86    cr_unpackDispatch.SecondaryColorPointerEXT( size, type, stride, (void *) pointer, false /*fRealPtr*/ );
    8787}
    8888
     
    9595    GLsizei stride = READ_DATA( 24, GLsizei );
    9696    GLintptrARB pointer = READ_DATA( 28, GLuint );
    97     cr_unpackDispatch.VertexAttribPointerARB( index, size, type, normalized, stride, (void *) pointer );
     97    cr_unpackDispatch.VertexAttribPointerARB( index, size, type, normalized, stride, (void *) pointer, false /*fRealPtr*/ );
    9898}
    9999
     
    105105    GLsizei stride = READ_DATA( 20, GLsizei );
    106106    GLintptrARB pointer = READ_DATA( 24, GLuint );
    107     cr_unpackDispatch.VertexAttribPointerNV( index, size, type, stride, (void *) pointer );
     107    cr_unpackDispatch.VertexAttribPointerNV( index, size, type, stride, (void *) pointer, false /*fRealPtr*/ );
    108108}
    109109
     
    113113    GLsizei stride = READ_DATA( 12, GLsizei );
    114114    GLintptrARB pointer = READ_DATA( 16, GLuint );
    115     cr_unpackDispatch.InterleavedArrays( format, stride, (void *) pointer );
     115    cr_unpackDispatch.InterleavedArrays( format, stride, (void *) pointer, false /*fRealPtr*/ );
    116116}
    117117
     
    162162static void crUnpackSetClientPointerByIndex(int index, GLint size,
    163163                                            GLenum type, GLboolean normalized,
    164                                             GLsizei stride, const GLvoid *pointer, CRClientState *c)
     164                                            GLsizei stride, const GLvoid *pointer, CRClientState *c, int fRealPtr)
    165165{
    166166    /*crDebug("crUnpackSetClientPointerByIndex: %i(s=%i, t=0x%x, n=%i, str=%i) -> %p", index, size, type, normalized, stride, pointer);*/
     
    171171        {
    172172            case 0:
    173                 cr_unpackDispatch.VertexPointer(size, type, stride, pointer);
     173                cr_unpackDispatch.VertexPointer(size, type, stride, pointer, fRealPtr);
    174174                break;
    175175            case 1:
    176                 cr_unpackDispatch.ColorPointer(size, type, stride, pointer);
     176                cr_unpackDispatch.ColorPointer(size, type, stride, pointer, fRealPtr);
    177177                break;
    178178            case 2:
    179                 cr_unpackDispatch.FogCoordPointerEXT(type, stride, pointer);
     179                cr_unpackDispatch.FogCoordPointerEXT(type, stride, pointer, fRealPtr);
    180180                break;
    181181            case 3:
    182                 cr_unpackDispatch.SecondaryColorPointerEXT(size, type, stride, pointer);
     182                cr_unpackDispatch.SecondaryColorPointerEXT(size, type, stride, pointer, fRealPtr);
    183183                break;
    184184            case 4:
    185                 cr_unpackDispatch.EdgeFlagPointer(stride, pointer);
     185                cr_unpackDispatch.EdgeFlagPointer(stride, pointer, fRealPtr);
    186186                break;
    187187            case 5:
    188                 cr_unpackDispatch.IndexPointer(type, stride, pointer);
     188                cr_unpackDispatch.IndexPointer(type, stride, pointer, fRealPtr);
    189189                break;
    190190            case 6:
    191                 cr_unpackDispatch.NormalPointer(type, stride, pointer);
     191                cr_unpackDispatch.NormalPointer(type, stride, pointer, fRealPtr);
    192192                break;
    193193        }
     
    200200            cr_unpackDispatch.ClientActiveTextureARB(GL_TEXTURE0_ARB+index-7);
    201201        }
    202         cr_unpackDispatch.TexCoordPointer(size, type, stride, pointer);
     202        cr_unpackDispatch.TexCoordPointer(size, type, stride, pointer, fRealPtr);
    203203        if ((index-7)!=curTexUnit)
    204204        {
     
    209209    {
    210210        cr_unpackDispatch.VertexAttribPointerARB(index-7-CR_MAX_TEXTURE_UNITS,
    211                                                  size, type, normalized, stride, pointer);
     211                                                 size, type, normalized, stride, pointer, fRealPtr);
    212212    }
    213213}
     
    265265                /*crDebug("crUnpackExtendLockArraysEXT: old cp(%i): en/l=%i(%i) p=%p size=%i type=0x%x n=%i str=%i pp=%p pstr=%i",
    266266                        index, cp->enabled, cp->locked, cp->p, cp->size, cp->type, cp->normalized, cp->stride, cp->prevPtr, cp->prevStride);*/
    267                 crUnpackSetClientPointerByIndex(index, cp->size, cp->type, cp->normalized, 0, data, c);
     267                crUnpackSetClientPointerByIndex(index, cp->size, cp->type, cp->normalized, 0, data, c, 1 /*fRealPtr*/);
    268268                /*crDebug("crUnpackExtendLockArraysEXT: new cp(%i): en/l=%i(%i) p=%p size=%i type=0x%x n=%i str=%i pp=%p pstr=%i",
    269269                        index, cp->enabled, cp->locked, cp->p, cp->size, cp->type, cp->normalized, cp->stride, cp->prevPtr, cp->prevStride);*/
     
    305305            /*crDebug("crUnpackExtendUnlockArraysEXT: old cp(%i): en/l=%i(%i) p=%p size=%i type=0x%x n=%i str=%i pp=%p pstr=%i",
    306306                    i, cp->enabled, cp->locked, cp->p, cp->size, cp->type, cp->normalized, cp->stride, cp->prevPtr, cp->prevStride);*/
    307             crUnpackSetClientPointerByIndex(i, cp->size, cp->type, cp->normalized, cp->prevStride, cp->prevPtr, c);
     307            unsigned char *prevPtr = cp->prevPtr;
     308            int fRealPtr = cp->fPrevRealPtr;
     309            cp->prevPtr = NULL;
     310            cp->fPrevRealPtr = 0;
     311            crUnpackSetClientPointerByIndex(i, cp->size, cp->type, cp->normalized, cp->prevStride, prevPtr, c, cp->fPrevRealPtr);
    308312            /*crDebug("crUnpackExtendUnlockArraysEXT: new cp(%i): en/l=%i(%i) p=%p size=%i type=0x%x n=%i str=%i pp=%p pstr=%i",
    309313                    i, cp->enabled, cp->locked, cp->p, cp->size, cp->type, cp->normalized, cp->stride, cp->prevPtr, cp->prevStride);*/
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