VirtualBox

Ignore:
Timestamp:
Jun 5, 2014 9:18:41 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94217
Message:

crOpenGL: wglShareLists support

Location:
trunk/src/VBox/Additions/common/crOpenGL/pack
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu.h

    r51313 r51559  
    158158extern ThreadInfo *packspuNewCtxThread( struct VBOXUHGSMI *pHgsmi );
    159159
     160
     161
     162#define MAGIC_OFFSET 3000
     163
    160164#endif /* CR_PACKSPU_H */
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c

    r51319 r51559  
    1010#include "cr_string.h"
    1111#include "packspu_proto.h"
    12 
    13 #define MAGIC_OFFSET 3000
    1412
    1513/*
     
    231229
    232230    packspu_ChromiumParameteriCR(param, value);
     231
     232#ifdef CHROMIUM_THREADSAFE
     233    crUnlockMutex(&_PackMutex);
     234#endif
     235
     236    if (CRPACKSPU_IS_WDDM_CRHGSMI())
     237    {
     238        /* restore the packer context to the tls */
     239        crPackSetContext(curPacker);
     240    }
     241}
     242
     243GLvoid PACKSPU_APIENTRY
     244packspu_VBoxConChromiumParametervCR(GLint con, GLenum target, GLenum type, GLsizei count, const GLvoid *values)
     245{
     246    GET_THREAD(thread);
     247    CRPackContext * curPacker = crPackGetContext();
     248    ThreadInfo *curThread = thread;
     249    int writeback = 1;
     250    GLint serverCtx = (GLint) -1;
     251
     252    CRASSERT(!curThread == !curPacker);
     253    CRASSERT(!curThread || !curPacker || curThread->packer == curPacker);
     254#ifdef CHROMIUM_THREADSAFE
     255    crLockMutex(&_PackMutex);
     256#endif
     257
     258#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
     259    CRASSERT(!con == !CRPACKSPU_IS_WDDM_CRHGSMI());
     260#endif
     261
     262    if (CRPACKSPU_IS_WDDM_CRHGSMI())
     263    {
     264        if (!con)
     265        {
     266            crError("connection should be specified!");
     267            return;
     268        }
     269        thread = GET_THREAD_VAL_ID(con);
     270    }
     271    else
     272    {
     273        CRASSERT(!con);
     274        if (!thread)
     275        {
     276            thread = packspuNewThread(
     277#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
     278                NULL
     279#endif
     280                );
     281        }
     282    }
     283    CRASSERT(thread);
     284    CRASSERT(thread->packer);
     285
     286    crPackSetContext( thread->packer );
     287
     288    packspu_ChromiumParametervCR(target, type, count, values);
    233289
    234290#ifdef CHROMIUM_THREADSAFE
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c

    r51313 r51559  
    1515    CRMessage msg;
    1616    int len;
    17    
     17    GLint ai32ServerValues[2];
     18    GLboolean fFlush = GL_FALSE;
    1819    GET_THREAD(thread);
    1920
     
    3031            len = sizeof(CRMessageGather);
    3132            crNetSend(thread->netServer.conn, NULL, &msg, len);
    32             break;
    33            
     33            return;
     34
     35        case GL_SHARE_LISTS_CR:
     36        {
     37            ContextInfo *pCtx[2];
     38            GLint *ai32Values;
     39            int i;
     40            if (count != 2)
     41            {
     42                WARN(("GL_SHARE_LISTS_CR invalid cound %d", count));
     43                return;
     44            }
     45
     46            if (type != GL_UNSIGNED_INT && type != GL_INT)
     47            {
     48                WARN(("GL_SHARE_LISTS_CR invalid type %d", type));
     49                return;
     50            }
     51
     52            ai32Values = (GLint*)values;
     53
     54            for (i = 0; i < 2; ++i)
     55            {
     56                const int slot = ai32Values[i] - MAGIC_OFFSET;
     57
     58                if (slot < 0 || slot >= pack_spu.numContexts)
     59                {
     60                    WARN(("GL_SHARE_LISTS_CR invalid value[%d] %d", i, ai32Values[i]));
     61                    return;
     62                }
     63
     64                pCtx[i] = &pack_spu.context[slot];
     65                if (!pCtx[i]->clientState)
     66                {
     67                    WARN(("GL_SHARE_LISTS_CR invalid pCtx1 for value[%d] %d", i, ai32Values[i]));
     68                    return;
     69                }
     70
     71                ai32ServerValues[i] = pCtx[i]->serverCtx;
     72            }
     73
     74            crStateShareLists(pCtx[0]->clientState, pCtx[1]->clientState);
     75
     76            values = ai32ServerValues;
     77
     78            fFlush = GL_TRUE;
     79
     80            break;
     81        }
     82
    3483        default:
    35             if (pack_spu.swap)
    36                 crPackChromiumParametervCRSWAP(target, type, count, values);
    37             else
    38                 crPackChromiumParametervCR(target, type, count, values);
    39     }
    40 
    41 
     84            break;
     85    }
     86
     87    if (pack_spu.swap)
     88        crPackChromiumParametervCRSWAP(target, type, count, values);
     89    else
     90        crPackChromiumParametervCR(target, type, count, values);
     91
     92    if (fFlush)
     93        packspuFlush( (void *) thread );
    4294}
    4395
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_special

    r51200 r51559  
    111111VBoxCreateContext
    112112VBoxConChromiumParameteriCR
     113VBoxConChromiumParametervCR
    113114VBoxWindowCreate
    114115VBoxWindowDestroy
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