VirtualBox

Ignore:
Timestamp:
Jan 21, 2010 9:26:23 AM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: update to wine 1.1.36 and disable unnecessary fbo state poll

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/query.c

    r23571 r25949  
    44 * Copyright 2005 Oliver Stieber
    55 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers
     6 * Copyright 2009 Henri Verbeet for CodeWeavers.
    67 *
    78 * This library is free software; you can redistribute it and/or
     
    3940
    4041WINE_DEFAULT_DEBUG_CHANNEL(d3d);
    41 #define GLINFO_LOCATION This->wineD3DDevice->adapter->gl_info
     42#define GLINFO_LOCATION This->device->adapter->gl_info
    4243
    4344/* *******************************************
     
    9798   IWineD3DQuery IWineD3DQuery parts follow
    9899   ******************************************* */
    99 static HRESULT  WINAPI IWineD3DQueryImpl_GetParent(IWineD3DQuery *iface, IUnknown** parent){
    100     IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
    101 
    102     *parent= (IUnknown*) parent;
     100static HRESULT WINAPI IWineD3DQueryImpl_GetParent(IWineD3DQuery *iface, IUnknown **parent)
     101{
     102    TRACE("iface %p, parent %p.\n", iface, parent);
     103
     104    *parent = (IUnknown *)parent;
    103105    IUnknown_AddRef(*parent);
    104     TRACE("(%p) : returning %p\n", This, *parent);
     106
     107    TRACE("Returning %p.\n", *parent);
     108
    105109    return WINED3D_OK;
    106110}
    107 
    108 static HRESULT  WINAPI IWineD3DQueryImpl_GetDevice(IWineD3DQuery* iface, IWineD3DDevice **pDevice){
    109     IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
    110     IWineD3DDevice_AddRef((IWineD3DDevice *)This->wineD3DDevice);
    111     *pDevice = (IWineD3DDevice *)This->wineD3DDevice;
    112     TRACE("(%p) returning %p\n", This, *pDevice);
    113     return WINED3D_OK;
    114 }
    115 
    116111
    117112static HRESULT  WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pData, DWORD dwSize, DWORD dwGetDataFlags){
     
    280275    IWineD3DQueryImpl *This = (IWineD3DQueryImpl *) iface;
    281276    struct wined3d_occlusion_query *query = This->extendedData;
     277    IWineD3DDeviceImpl *device = This->device;
     278    const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
     279    struct wined3d_context *context;
    282280    DWORD* data = pData;
    283281    GLuint available;
     
    304302    }
    305303
    306     if (!GL_SUPPORT(ARB_OCCLUSION_QUERY))
     304    if (!gl_info->supported[ARB_OCCLUSION_QUERY])
    307305    {
    308306        WARN("(%p) : Occlusion queries not supported. Returning 1.\n", This);
     
    318316    }
    319317
    320     ActivateContext(This->wineD3DDevice, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
     318    context = context_acquire(This->device, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
    321319
    322320    ENTER_GL();
     
    344342    LEAVE_GL();
    345343
     344    context_release(context);
     345
    346346    return res;
    347347}
     
    350350    IWineD3DQueryImpl *This = (IWineD3DQueryImpl *) iface;
    351351    struct wined3d_event_query *query = This->extendedData;
    352     BOOL* data = pData;
     352    struct wined3d_context *context;
     353    BOOL *data = pData;
    353354
    354355    TRACE("(%p) : type D3DQUERY_EVENT, pData %p, dwSize %#x, dwGetDataFlags %#x\n", This, pData, dwSize, dwGetDataFlags);
     
    358359    if (!query->context)
    359360    {
    360         ERR("Query not started, returning TRUE.\n");
     361        TRACE("Query not started, returning TRUE.\n");
    361362        *data = TRUE;
    362363
     
    373374    }
    374375
    375     ActivateContext(This->wineD3DDevice, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
     376    context = context_acquire(This->device, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
    376377
    377378    ENTER_GL();
    378379
    379     if (GL_SUPPORT(APPLE_FENCE))
     380    if (context->gl_info->supported[APPLE_FENCE])
    380381    {
    381382        *data = GL_EXTCALL(glTestFenceAPPLE(query->id));
    382383        checkGLcall("glTestFenceAPPLE");
    383384    }
    384     else if (GL_SUPPORT(NV_FENCE))
     385    else if (context->gl_info->supported[NV_FENCE])
    385386    {
    386387        *data = GL_EXTCALL(glTestFenceNV(query->id));
     
    394395
    395396    LEAVE_GL();
     397
     398    context_release(context);
    396399
    397400    return S_OK;
     
    481484            {
    482485                context_free_event_query(query);
    483                 context = ActivateContext(This->wineD3DDevice, NULL, CTXUSAGE_RESOURCELOAD);
     486                context = context_acquire(This->device, NULL, CTXUSAGE_RESOURCELOAD);
    484487                context_alloc_event_query(context, query);
    485488            }
    486489            else
    487490            {
    488                 ActivateContext(This->wineD3DDevice, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
     491                context = context_acquire(This->device, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
    489492            }
    490493        }
    491494        else
    492495        {
    493             context = ActivateContext(This->wineD3DDevice, NULL, CTXUSAGE_RESOURCELOAD);
     496            context = context_acquire(This->device, NULL, CTXUSAGE_RESOURCELOAD);
    494497            context_alloc_event_query(context, query);
    495498        }
     
    497500        ENTER_GL();
    498501
    499         if (GL_SUPPORT(APPLE_FENCE))
     502        if (context->gl_info->supported[APPLE_FENCE])
    500503        {
    501504            GL_EXTCALL(glSetFenceAPPLE(query->id));
    502505            checkGLcall("glSetFenceAPPLE");
    503506        }
    504         else if (GL_SUPPORT(NV_FENCE))
     507        else if (context->gl_info->supported[NV_FENCE])
    505508        {
    506509            GL_EXTCALL(glSetFenceNV(query->id, GL_ALL_COMPLETED_NV));
     
    509512
    510513        LEAVE_GL();
     514
     515        context_release(context);
    511516    }
    512517    else if(dwIssueFlags & WINED3DISSUE_BEGIN)
     
    527532static HRESULT  WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface,  DWORD dwIssueFlags) {
    528533    IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
    529 
    530     if (GL_SUPPORT(ARB_OCCLUSION_QUERY))
     534    IWineD3DDeviceImpl *device = This->device;
     535    const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
     536
     537    if (gl_info->supported[ARB_OCCLUSION_QUERY])
    531538    {
    532539        struct wined3d_occlusion_query *query = This->extendedData;
     
    543550
    544551                    context_free_occlusion_query(query);
    545                     context = ActivateContext(This->wineD3DDevice, NULL, CTXUSAGE_RESOURCELOAD);
     552                    context = context_acquire(This->device, NULL, CTXUSAGE_RESOURCELOAD);
    546553                    context_alloc_occlusion_query(context, query);
    547554                }
    548555                else
    549556                {
    550                     ActivateContext(This->wineD3DDevice, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
     557                    context = context_acquire(This->device, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
    551558
    552559                    ENTER_GL();
     
    559566            {
    560567                if (query->context) context_free_occlusion_query(query);
    561                 context = ActivateContext(This->wineD3DDevice, NULL, CTXUSAGE_RESOURCELOAD);
     568                context = context_acquire(This->device, NULL, CTXUSAGE_RESOURCELOAD);
    562569                context_alloc_occlusion_query(context, query);
    563570            }
     
    567574            checkGLcall("glBeginQuery()");
    568575            LEAVE_GL();
     576
     577            context_release(context);
    569578        }
    570579        if (dwIssueFlags & WINED3DISSUE_END) {
     
    581590                else
    582591                {
    583                     ActivateContext(This->wineD3DDevice, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
     592                    context = context_acquire(This->device, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
    584593
    585594                    ENTER_GL();
     
    587596                    checkGLcall("glEndQuery()");
    588597                    LEAVE_GL();
     598
     599                    context_release(context);
    589600                }
    590601            }
     
    632643     /*** IWineD3Dquery methods ***/
    633644    IWineD3DQueryImpl_GetParent,
    634     IWineD3DQueryImpl_GetDevice,
    635645    IWineD3DQueryImpl_GetData,
    636646    IWineD3DQueryImpl_GetDataSize,
     
    647657    /*** IWineD3Dquery methods ***/
    648658    IWineD3DQueryImpl_GetParent,
    649     IWineD3DQueryImpl_GetDevice,
    650659    IWineD3DEventQueryImpl_GetData,
    651660    IWineD3DEventQueryImpl_GetDataSize,
     
    662671    /*** IWineD3Dquery methods ***/
    663672    IWineD3DQueryImpl_GetParent,
    664     IWineD3DQueryImpl_GetDevice,
    665673    IWineD3DOcclusionQueryImpl_GetData,
    666674    IWineD3DOcclusionQueryImpl_GetDataSize,
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