VirtualBox

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


Ignore:
Timestamp:
Jan 16, 2013 1:16:57 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83229
Message:

wined3d: 1.fix shader gen 2.use vboxogl PixelFormat API directly

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

Legend:

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

    r43705 r44306  
    16041604    IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
    16051605
    1606     if (device->focus_window) wined3d_unregister_window(device->focus_window);
     1606    if (device->focus_window) wined3d_unregister_window(device->focus_window, device);
    16071607    device->focus_window = NULL;
    16081608#else
     
    76677667    {
    76687668        TRACE("unregister window %p.\n", window);
    7669         wined3d_unregister_window(window);
     7669        wined3d_unregister_window(window, NULL);
    76707670
    76717671        if (device->focus_window == window) device->focus_window = NULL;
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/glsl_shader.c

    r43488 r44306  
    39713971    unsigned int i;
    39723972    char reg_mask[6];
     3973
     3974    if (!ps)
     3975        return;
    39733976
    39743977    for (i = 0, map = ps->baseShader.reg_maps.texcoord; map && i < min(8, MAX_REG_TEXCRD); map >>= 1, ++i)
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/swapchain.c

    r42971 r44306  
    520520
    521521#ifdef VBOX_WITH_WDDM
    522     /* We're directly using wglMakeCurrent calls skipping GDI layer, which causes GDI SwapBuffers to fail trying to
    523      * call glFinish, which doesn't have any context set. So we use wglSwapLayerBuffers directly as well.
    524      */
    525     pwglSwapLayerBuffers(context->currentSwapchain->hDC, WGL_SWAP_MAIN_PLANE);
     522    SwapBuffers(context->currentSwapchain->hDC);
    526523#else
    527 # ifdef VBOX_WINE_WITH_SINGLE_SWAPCHAIN_CONTEXT
    528     pwglSwapLayerBuffers(context->hdc, WGL_SWAP_MAIN_PLANE);
    529 # else
    530524    SwapBuffers(context->hdc); /* TODO: cycle through the swapchain buffers */
    531 # endif
    532525#endif
    533526
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_gl.h

    r43488 r44306  
    13811381BOOL (WINAPI *pwglSwapLayerBuffers)(HDC, UINT) DECLSPEC_HIDDEN;
    13821382BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN;
     1383BOOL (WINAPI *pwglChoosePixelFormat)(HDC, const PIXELFORMATDESCRIPTOR *) DECLSPEC_HIDDEN;
     1384int (WINAPI *pwglDescribePixelFormat)(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR) DECLSPEC_HIDDEN;
     1385int (WINAPI *pwglGetPixelFormat)(HDC) DECLSPEC_HIDDEN;
     1386BOOL (WINAPI *pwglSetPixelFormat)(HDC, int, const PIXELFORMATDESCRIPTOR *) DECLSPEC_HIDDEN;
    13831387
    13841388HGLRC (WINAPI *pVBoxCreateContext)(HDC, struct VBOXUHGSMI*) DECLSPEC_HIDDEN;
    13851389void (WINAPI *pVBoxFlushToHost)(HGLRC) DECLSPEC_HIDDEN;
     1390
     1391#if defined(VBOX_WITH_WDDM) || defined(VBOX_WINE_WITH_SINGLE_SWAPCHAIN_CONTEXT)
     1392# define VBOX_WINE_WITH_DIRECT_VBOXOGL
     1393#endif
     1394
     1395#ifdef VBOX_WINE_WITH_DIRECT_VBOXOGL
     1396/* make sure we used stuff from VBoxOGL
     1397 * we do it this way to avoid extra modifications to Wine code */
     1398
     1399/* We're directly using wglMakeCurrent calls skipping GDI layer, which causes GDI SwapBuffers to fail trying to
     1400 * call glFinish, which doesn't have any context set. So we use wglSwapLayerBuffers directly as well.
     1401 */
     1402# define SwapBuffers(_hdc) pwglSwapLayerBuffers((_hdc), WGL_SWAP_MAIN_PLANE)
     1403
     1404/* we avoid using GDI32!*PixelFormat API and use VBoxOGL stuff directly
     1405 * because SetPixelFormat may eventually lead to opengl32 setting its own window proc via SetWindowLongPtr
     1406 * thus wined3d_[un]register_window stuff will become screwed up leading to infinite recursion or other misbehave */
     1407# define ChoosePixelFormat pwglChoosePixelFormat
     1408# define DescribePixelFormat pwglDescribePixelFormat
     1409# define GetPixelFormat pwglGetPixelFormat
     1410# define SetPixelFormat pwglSetPixelFormat
     1411#endif
    13861412
    13871413#define GL_FUNCS_GEN \
     
    17291755    USE_WGL_FUNC(wglMakeCurrent) \
    17301756    USE_WGL_FUNC(wglShareLists) \
    1731     USE_WGL_FUNC(wglSwapLayerBuffers)
     1757    USE_WGL_FUNC(wglSwapLayerBuffers) \
     1758    USE_WGL_FUNC(wglChoosePixelFormat) \
     1759    USE_WGL_FUNC(wglDescribePixelFormat) \
     1760    USE_WGL_FUNC(wglGetPixelFormat) \
     1761    USE_WGL_FUNC(wglSetPixelFormat)
    17321762
    17331763#define VBOX_FUNCS_GEN \
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_main.c

    r40986 r44306  
    465465    wined3d_mutex_lock();
    466466
     467    entry = wined3d_find_wndproc(window);
     468    if (entry)
     469    {
     470        ERR("window is registered already!");
     471        entry->device = device;
     472        wined3d_mutex_unlock();
     473        return TRUE;
     474    }
     475
    467476    if (wndproc_table.size == wndproc_table.count)
    468477    {
     
    488497    entry->proc = (WNDPROC)SetWindowLongPtrW(window, GWLP_WNDPROC, (LONG_PTR)wined3d_wndproc);
    489498    entry->device = device;
     499    Assert(entry->proc != wined3d_wndproc);
    490500
    491501    wined3d_mutex_unlock();
     
    494504}
    495505
    496 void wined3d_unregister_window(HWND window)
     506void wined3d_unregister_window(HWND window, struct IWineD3DDeviceImpl *device)
    497507{
    498508    unsigned int i;
     
    504514        {
    505515            struct wined3d_wndproc *entry = &wndproc_table.entries[i];
    506             struct wined3d_wndproc *last = &wndproc_table.entries[--wndproc_table.count];
    507 
    508             if (GetWindowLongPtrW(window, GWLP_WNDPROC) == (LONG_PTR)wined3d_wndproc)
    509                 SetWindowLongPtrW(window, GWLP_WNDPROC, (LONG_PTR)entry->proc);
    510             if (entry != last) *entry = *last;
     516
     517            if (!device || device == entry->device)
     518            {
     519                struct wined3d_wndproc *last = &wndproc_table.entries[--wndproc_table.count];
     520
     521                if (GetWindowLongPtrW(window, GWLP_WNDPROC) == (LONG_PTR)wined3d_wndproc)
     522                    SetWindowLongPtrW(window, GWLP_WNDPROC, (LONG_PTR)entry->proc);
     523                if (entry != last) *entry = *last;
     524            }
     525            else
     526            {
     527                ERR("request to unregister a window of a not-owning device");
     528            }
    511529            wined3d_mutex_unlock();
    512530
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h

    r43488 r44306  
    16651665#ifndef VBOX_WITH_WDDM
    16661666BOOL wined3d_register_window(HWND window, struct IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN;
    1667 void wined3d_unregister_window(HWND window) DECLSPEC_HIDDEN;
     1667void wined3d_unregister_window(HWND window, struct IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN;
    16681668#endif
    16691669
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