VirtualBox

Changeset 35825 in vbox


Ignore:
Timestamp:
Feb 2, 2011 2:11:24 PM (14 years ago)
Author:
vboxsync
Message:

wined3d: bit less ifdefs

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d
Files:
4 edited

Legend:

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

    r35822 r35825  
    588588static void shader_arb_load_constants(const struct wined3d_context *context, char usePixelShader, char useVertexShader)
    589589{
    590 #ifdef VBOX_WITH_WDDM
    591     IWineD3DDeviceImpl *device = context->device;
    592 #else
    593     IWineD3DDeviceImpl *device = context->swapchain->device;
    594 #endif
     590    IWineD3DDeviceImpl *device = context_get_device(context);
    595591    IWineD3DStateBlockImpl* stateBlock = device->stateBlock;
     592
    596593    const struct wined3d_gl_info *gl_info = context->gl_info;
    597594
     
    622619    /* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active
    623620     * context. On a context switch the old context will be fully dirtified */
    624 #ifdef VBOX_WITH_WDDM
    625     if (!context || context->device != This) return;
    626 #else
    627     if (!context || context->swapchain->device != This) return;
    628 #endif
     621    if (!context || context_get_device(context) != This) return;
    629622
    630623    memset(context->vshader_const_dirty + start, 1, sizeof(*context->vshader_const_dirty) * count);
     
    639632    /* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active
    640633     * context. On a context switch the old context will be fully dirtified */
    641 #ifdef VBOX_WITH_WDDM
    642     if (!context || context->device != This) return;
    643 #else
    644     if (!context || context->swapchain->device != This) return;
    645 #endif
     634    if (!context || context_get_device(context) != This) return;
    646635
    647636    memset(context->pshader_const_dirty + start, 1, sizeof(*context->pshader_const_dirty) * count);
     
    43694358static void shader_arb_select(const struct wined3d_context *context, BOOL usePS, BOOL useVS)
    43704359{
    4371 #ifdef VBOX_WITH_WDDM
    4372     IWineD3DDeviceImpl *This = context->device;
    4373 #else
    4374     IWineD3DDeviceImpl *This = context->swapchain->device;
    4375 #endif
     4360    IWineD3DDeviceImpl *This = context_get_device(context);
    43764361    struct shader_arb_priv *priv = This->shader_priv;
    43774362    const struct wined3d_gl_info *gl_info = context->gl_info;
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/context.c

    r34290 r35825  
    331331{
    332332    const struct wined3d_gl_info *gl_info = context->gl_info;
    333 #ifdef VBOX_WITH_WDDM
    334     IWineD3DDeviceImpl *device = context->device;
    335 #else
    336     IWineD3DDeviceImpl *device = context->swapchain->device;
    337 #endif
     333    IWineD3DDeviceImpl *device = context_get_device(context);
    338334    struct fbo_entry *entry;
    339335
     
    352348{
    353349    const struct wined3d_gl_info *gl_info = context->gl_info;
    354 #ifdef VBOX_WITH_WDDM
    355     IWineD3DDeviceImpl *device = context->device;
    356 #else
    357     IWineD3DDeviceImpl *device = context->swapchain->device;
    358 #endif
     350    IWineD3DDeviceImpl *device = context_get_device(context);
    359351
    360352    context_bind_fbo(context, GL_FRAMEBUFFER, &entry->id);
     
    385377{
    386378    const struct wined3d_gl_info *gl_info = context->gl_info;
    387 #ifdef VBOX_WITH_WDDM
    388     IWineD3DDeviceImpl *device = context->device;
    389 #else
    390     IWineD3DDeviceImpl *device = context->swapchain->device;
    391 #endif
     379    IWineD3DDeviceImpl *device = context_get_device(context);
    392380    struct fbo_entry *entry;
    393381
     
    425413{
    426414    const struct wined3d_gl_info *gl_info = context->gl_info;
    427 #ifdef VBOX_WITH_WDDM
    428     IWineD3DDeviceImpl *device = context->device;
    429 #else
    430     IWineD3DDeviceImpl *device = context->swapchain->device;
    431 #endif
     415    IWineD3DDeviceImpl *device = context_get_device(context);
    432416    unsigned int i;
    433417
     
    12621246}
    12631247
    1264 
     1248struct IWineD3DDeviceImpl *context_get_device(const struct wined3d_context *context)
     1249{
     1250#ifdef VBOX_WITH_WDDM
     1251    return context->device;
     1252#else
     1253    return context->swapchain->device;
     1254#endif
     1255}
    12651256
    12661257
     
    20041995    {
    20051996        if (current_context
    2006                 && current_context->current_rt
    2007 #ifdef VBOX_WITH_WDDM
    2008                 && current_context->device == This
    2009 #else
    2010                 && current_context->swapchain->device == This
    2011 #endif
    2012                 )
     1997            && current_context->current_rt
     1998            && context_get_device(current_context) == This
     1999           )
    20132000        {
    20142001            target = current_context->current_rt;
     
    20612048
    20622049        /* Stay with the currently active context. */
    2063         if (current_context
    2064 #ifdef VBOX_WITH_WDDM
    2065                 && current_context->device == This
    2066 #else
    2067                 && current_context->swapchain->device == This
    2068 #endif
    2069                 )
     2050        if (current_context && context_get_device(current_context) == This)
    20702051        {
    20712052            context = current_context;
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/glsl_shader.c

    r35822 r35825  
    777777{
    778778    const struct wined3d_gl_info *gl_info = context->gl_info;
    779 #ifdef VBOX_WITH_WDDM
    780     IWineD3DDeviceImpl *device = context->device;
    781 #else
    782     IWineD3DDeviceImpl *device = context->swapchain->device;
    783 #endif
     779    IWineD3DDeviceImpl *device = context_get_device(context);
    784780    IWineD3DStateBlockImpl* stateBlock = device->stateBlock;
    785781    struct shader_glsl_priv *priv = device->shader_priv;
     
    46794675{
    46804676    const struct wined3d_gl_info *gl_info = context->gl_info;
    4681 #ifdef VBOX_WITH_WDDM
    4682     IWineD3DDeviceImpl *device = context->device;
    4683 #else
    4684     IWineD3DDeviceImpl *device = context->swapchain->device;
    4685 #endif
     4677    IWineD3DDeviceImpl *device = context_get_device(context);
    46864678    struct shader_glsl_priv *priv = device->shader_priv;
    46874679    GLhandleARB program_id = 0;
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h

    r35822 r35825  
    12601260struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3DSurfaceImpl *target,
    12611261        const struct wined3d_format_desc *ds_format_desc) DECLSPEC_HIDDEN;
     1262struct IWineD3DDeviceImpl *context_get_device(const struct wined3d_context *context); DECLSPEC_HIDDEN;
    12621263#ifdef VBOX_WITH_WDDM
    12631264struct wined3d_context *context_find_create(IWineD3DDeviceImpl *device, IWineD3DSwapChainImpl *swapchain, IWineD3DSurfaceImpl *target,
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