VirtualBox

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


Ignore:
Timestamp:
May 26, 2011 8:50:49 AM (14 years ago)
Author:
vboxsync
Message:

wddm/3d: fix google earth rendering

Location:
trunk/src/VBox/Additions/WINNT/Graphics
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h

    r36867 r37216  
    458458        case D3DDDIFMT_S8_LOCKABLE:
    459459            return 8;
     460        case D3DDDIFMT_DXT1:
     461            return 4;
     462        case D3DDDIFMT_DXT2:
     463        case D3DDDIFMT_DXT3:
     464        case D3DDDIFMT_DXT4:
     465        case D3DDDIFMT_DXT5:
     466            return 8;
    460467        default:
    461468            AssertBreakpoint();
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp

    r36867 r37216  
    49514951            PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
    49524952            CONST D3DDDI_SURFACEINFO* pSurf = &pResource->pSurfList[i];
     4953
     4954            /*@fixme: Those formats are actually blocks of 4x4 pixels,
     4955             * for some reason we're getting pSurf->SysMemPitch as if took 4x1 column from this block,
     4956             * which leads us to having 4x times bigger pitch than actual line takes.
     4957             * Simply trying to read here provided pointer
     4958             * at (byte*)pSurf->pSysMem + pSurf->pSurf->SysMemPitch*pSurf->Height - 1 causes access violation.
     4959             */
     4960            if (pResource->Format == D3DDDIFMT_DXT1
     4961                || pResource->Format == D3DDDIFMT_DXT2
     4962                || pResource->Format == D3DDDIFMT_DXT3
     4963                || pResource->Format == D3DDDIFMT_DXT4
     4964                || pResource->Format == D3DDDIFMT_DXT5)
     4965            {
     4966                *((UINT*)&pSurf->SysMemPitch) = pSurf->SysMemPitch >> 2;
     4967            }
     4968
    49534969            pAllocation->hAllocation = NULL;
    49544970            pAllocation->enmType = VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.cpp

    r36867 r37216  
    438438        case 0xe06d7363: /* <- ms compiler - generated exception related to C++ exception */
    439439        case 0x000006d9: /* <- RPC exception, ignore */
     440        case 0x406d1388: /* <- VS/WinDbg thread naming exception, ignore */
    440441            break;
    441442        default:
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.h

    r36867 r37216  
    2525/* generic debugging facilities & extra data checks */
    2626# define VBOXWDDMDISP_DEBUG
    27 # ifdef DEBUG_misha
     27# if defined(DEBUG_misha) || defined(DEBUG_leo)
    2828/* for some reason when debugging with VirtualKD, user-mode DbgPrint's are discarded
    2929 * the workaround so far is to pass the log info to the kernel driver and DbgPrint'ed from there,
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/libWine/debug.c

    r33656 r37216  
    4444#define MAX_DEBUG_OPTIONS 256
    4545
    46 static unsigned char default_flags = (1 << __WINE_DBCL_ERR) | (1 << __WINE_DBCL_FIXME);
     46static unsigned char default_flags = (1 << __WINE_DBCL_ERR) | (1 << __WINE_DBCL_FIXME) | (1 << __WINE_DBCL_WARN);
    4747static int nb_debug_options = -1;
    4848static struct __wine_debug_channel debug_options[MAX_DEBUG_OPTIONS];
     
    393393static int default_dbg_vprintf( const char *format, va_list args )
    394394{
    395     return vfprintf( stderr, format, args );
     395#ifdef DEBUG_leo
     396    static FILE *output=NULL;
     397    static int first_time = 1;
     398
     399    if (first_time)
     400    {   
     401        first_time = 0;
     402        output = fopen( "winelog.txt", "w" );
     403    }
     404
     405    if (output) vfprintf( output, format, args );
     406#endif
     407    return vfprintf( stdout, format, args );
    396408}
    397409
     
    404416
    405417    if (cls < sizeof(debug_classes)/sizeof(debug_classes[0]))
    406         ret += wine_dbg_printf( "%s:%s:%s ", debug_classes[cls], channel->name, func );
     418        ret += wine_dbg_printf( "%s:[%#x]:%s:%s ", debug_classes[cls], GetCurrentThreadId(), channel->name, func );
    407419    if (format)
    408420        ret += funcs.dbg_vprintf( format, args );
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/vbox/libWineStub/debug.c

    r35053 r37216  
    4646#define MAX_DEBUG_OPTIONS 256
    4747
    48 static unsigned char default_flags = (1 << __WINE_DBCL_ERR) | (1 << __WINE_DBCL_FIXME);
     48static unsigned char default_flags = (1 << __WINE_DBCL_ERR) | (1 << __WINE_DBCL_FIXME) | (1 << __WINE_DBCL_WARN);
    4949static int nb_debug_options = -1;
    5050static struct __wine_debug_channel debug_options[MAX_DEBUG_OPTIONS];
     
    395395static int default_dbg_vprintf( const char *format, va_list args )
    396396{
    397     return vfprintf( stderr, format, args );
     397#ifdef DEBUG_leo
     398    static FILE *output=NULL;
     399    static int first_time = 1;
     400
     401    if (first_time)
     402    {   
     403        first_time = 0;
     404        output = fopen( "winelog.txt", "w" );
     405    }
     406
     407    if (output) vfprintf( output, format, args );
     408#endif
     409    return vfprintf( stdout, format, args );
    398410}
    399411
     
    406418
    407419    if (cls < sizeof(debug_classes)/sizeof(debug_classes[0]))
    408         ret += wine_dbg_printf( "%s:%s:%s ", debug_classes[cls], channel->name, func );
     420        ret += wine_dbg_printf( "%s:[%#x]:%s:%s ", debug_classes[cls], GetCurrentThreadId(), channel->name, func );
    409421    if (format)
    410422        ret += funcs.dbg_vprintf( format, args );
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/context.c

    r35825 r37216  
    734734}
    735735
    736 static void context_update_window(struct wined3d_context *context
     736void context_update_window(struct wined3d_context *context
    737737#ifdef VBOX_WITH_WDDM
    738738        , IWineD3DSwapChainImpl *swapchain
     
    761761
    762762#ifdef VBOX_WITH_WDDM
     763# ifdef DEBUG
     764    {
     765        HWND wnd = WindowFromDC(swapchain->hDC);
     766        if (wnd != swapchain->win_handle)
     767        {
     768            ERR("Lost swapchain dc %p for window %p.\n", swapchain->hDC, swapchain->win_handle);
     769            swapchain->hDC = GetDC(swapchain->win_handle);
     770            Assert(swapchain->hDC && (WindowFromDC(swapchain->hDC)==swapchain->win_handle));
     771        }
     772    }
     773# endif
     774
    763775    context->win_handle = swapchain->win_handle;
    764776    context->currentSwapchain = swapchain;
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/swapchain.c

    r33656 r37216  
    369369    if (This->num_contexts > 1) wglFinish();
    370370#endif
     371
     372#if defined(VBOX_WITH_WDDM) && defined(DEBUG)
     373    {
     374        HWND wnd = WindowFromDC(context->hdc);
     375        Assert(context->currentSwapchain && context->win_handle==swapchain->win_handle);
     376        Assert(wnd==context->win_handle);
     377        Assert(IsWindow(context->win_handle));
     378
     379        if (wnd != context->win_handle)
     380        {
     381            extern void context_update_window(struct wined3d_context *context, IWineD3DSwapChainImpl *swapchain);
     382
     383            context->valid = 0;
     384            Assert(context->currentSwapchain == This);
     385            context_update_window(context, context->currentSwapchain);
     386        }
     387    }
     388#endif
     389
     390#ifdef VBOX_WITH_WDDM
     391    /* We're directly using wglMakeCurrent calls skipping GDI layer, which causes GDI SwapBuffers to fail trying to
     392     * call glFinish, which doesn't have any context set. So we use wglSwapLayerBuffers directly as well.
     393     */
     394    pwglSwapLayerBuffers(context->hdc, WGL_SWAP_MAIN_PLANE);
     395#else
    371396    SwapBuffers(context->hdc); /* TODO: cycle through the swapchain buffers */
     397#endif
    372398
    373399    TRACE("SwapBuffers called, Starting new frame\n");
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_gl.h

    r33656 r37216  
    13801380PROC (WINAPI *pwglGetProcAddress)(LPCSTR) DECLSPEC_HIDDEN;
    13811381BOOL (WINAPI *pwglMakeCurrent)(HDC, HGLRC) DECLSPEC_HIDDEN;
     1382BOOL (WINAPI *pwglSwapLayerBuffers)(HDC) DECLSPEC_HIDDEN;
    13821383BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN;
    13831384
     
    17261727    USE_WGL_FUNC(wglGetProcAddress) \
    17271728    USE_WGL_FUNC(wglMakeCurrent) \
    1728     USE_WGL_FUNC(wglShareLists)
     1729    USE_WGL_FUNC(wglShareLists) \
     1730    USE_WGL_FUNC(wglSwapLayerBuffers)
    17291731
    17301732/* OpenGL extensions. */
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