VirtualBox

Changeset 38589 in vbox for trunk/src/VBox/Additions/WINNT


Ignore:
Timestamp:
Aug 31, 2011 5:07:59 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
73782
Message:

wine/d3d: speedup fb_copy_to_texture_direct context acquisition

File:
1 edited

Legend:

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

    r38588 r38589  
    31963196}
    31973197
     3198#ifdef VBOX_WITH_WDDM
     3199# define VBOX_WINE_TEXDIRECT_USE_RESOURCELOAD
     3200#endif
    31983201/* Does a direct frame buffer -> texture copy. Stretching is done
    31993202 * with single pixel copy calls
     
    32083211    struct wined3d_context *context;
    32093212    BOOL upsidedown = FALSE;
    3210     BOOL isOffscreen = surface_is_offscreen(SrcSurface);
     3213    BOOL isSrcOffscreen = surface_is_offscreen(SrcSurface);
    32113214    BOOL fNoStretching = TRUE;
    32123215    RECT dst_rect = *dst_rect_in;
     
    32253228    }
    32263229
    3227     if (isOffscreen)
     3230    if (isSrcOffscreen)
    32283231    {
    32293232        upsidedown = !upsidedown;
     
    32553258    }
    32563259
     3260#ifdef VBOX_WINE_TEXDIRECT_USE_RESOURCELOAD
     3261    if (isSrcOffscreen) context = context_acquire(myDevice, SrcSurface, CTXUSAGE_RESOURCELOAD);
     3262    else if (!surface_is_offscreen((IWineD3DSurface*)This)) context = context_acquire(myDevice, (IWineD3DSurface *) This, CTXUSAGE_RESOURCELOAD);
     3263    else context = context_acquire(myDevice, NULL, CTXUSAGE_RESOURCELOAD);
     3264
     3265    surface_internal_preload(SrcSurface, SRGB_RGB);
     3266#else
    32573267    context = context_acquire(myDevice, SrcSurface, CTXUSAGE_BLIT);
     3268#endif
     3269
    32583270    surface_internal_preload((IWineD3DSurface *) This, SRGB_RGB);
    32593271    ENTER_GL();
     
    32623274    glBindTexture(This->texture_target, This->texture_name);
    32633275    checkGLcall("glBindTexture");
    3264     if(isOffscreen) {
     3276    if(isSrcOffscreen) {
    32653277        TRACE("Reading from an offscreen target\n");
     3278#ifdef VBOX_WINE_TEXDIRECT_USE_RESOURCELOAD
     3279        context_bind_fbo(context, GL_READ_FRAMEBUFFER, &context->src_fbo);
     3280        context_attach_surface_fbo(context, GL_READ_FRAMEBUFFER, 0, (IWineD3DSurfaceImpl *)SrcSurface);
     3281#endif
    32663282        glReadBuffer(myDevice->offscreenBuffer);
     3283        checkGLcall("glReadBuffer()");
     3284#ifdef VBOX_WINE_TEXDIRECT_USE_RESOURCELOAD
     3285        context_attach_depth_stencil_fbo(context, GL_READ_FRAMEBUFFER, NULL, FALSE);
     3286#endif
    32673287    }
    32683288    else
    32693289    {
     3290#ifdef VBOX_WINE_TEXDIRECT_USE_RESOURCELOAD
     3291        context_bind_fbo(context, GL_READ_FRAMEBUFFER, NULL);
     3292#endif
    32703293        glReadBuffer(surface_get_gl_buffer(SrcSurface));
     3294        checkGLcall("glReadBuffer()");
    32713295    }
    32723296    checkGLcall("glReadBuffer");
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