VirtualBox

Changeset 29432 in vbox


Ignore:
Timestamp:
May 12, 2010 5:14:03 PM (15 years ago)
Author:
vboxsync
Message:

wddm/d3d: load/init wine d3d9 lib

Location:
trunk/src/VBox/Additions/WINNT/Graphics
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/Makefile.kmk

    r28800 r29432  
    7979VBoxDispD3D_SOURCES  = \
    8080        wddm/VBoxDispD3D.cpp \
     81    wddm/VBoxDispD3DIf.cpp \
    8182        wddm/VBoxDispD3D.def \
    8283        wddm/VBoxDispD3D.rc
     
    8586        $(VBOX_LIB_VBGL_R3)
    8687VBoxDispD3D_SDKS     = WINDDKWLH
     88# VBoxDispD3D_INCS    += ../Wine/include
    8789
    8890 ifeq ($(KBUILD_TARGET_ARCH), amd64)
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp

    r28800 r29432  
    2929
    3030#include "VBoxDispD3D.h"
     31#include "VBoxDispD3DCmn.h"
    3132
    3233#ifdef VBOXWDDMDISP_DEBUG
     
    4546        case DLL_PROCESS_ATTACH:
    4647        {
    47             /* there __try __except are just to ensure the library does not assertion fail in case VBoxGuest is not present
    48              * and VbglR3Init / VbglR3Term assertion fail */
    49             __try
    50             {
    51 //                LogRel(("VBoxDispD3D: DLL loaded.\n"));
    52                 RTR3Init();
     48            RTR3Init();
     49
     50            vboxVDbgPrint(("VBoxDispD3D: DLL loaded.\n"));
     51
    5352//                VbglR3Init();
    54             }
    55             __except (EXCEPTION_CONTINUE_EXECUTION)
    56             {
    57             }
    58 
    5953            break;
    6054        }
     
    6256        case DLL_PROCESS_DETACH:
    6357        {
    64             /* there __try __except are just to ensure the library does not assertion fail in case VBoxGuest is not present
    65              * and VbglR3Init / VbglR3Term assertion fail */
    66 //            __try
    67 //            {
    68 //                LogRel(("VBoxDispD3D: DLL unloaded.\n"));
     58            vboxVDbgPrint(("VBoxDispD3D: DLL unloaded.\n"));
    6959//                VbglR3Term();
    70 //            }
    71 //            __except (EXCEPTION_CONTINUE_EXECUTION)
    72 //            {
    73 //            }
    7460            /// @todo RTR3Term();
    7561            break;
     
    901887    vboxVDbgPrint(("==> "__FUNCTION__", hAdapter(0x%p)\n", hAdapter));
    902888
    903 //    AssertBreakpoint();
     889    AssertBreakpoint();
    904890
    905891    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)RTMemAllocZ(sizeof (VBOXWDDMDISP_DEVICE));
     
    10381024    vboxVDbgPrint(("<== "__FUNCTION__", hAdapter(0x%p)\n", hAdapter));
    10391025
    1040     return E_FAIL;
     1026    return S_OK;
    10411027}
    10421028
     
    10451031    vboxVDbgPrint(("==> "__FUNCTION__", hAdapter(0x%p)\n", hAdapter));
    10461032
    1047 //    AssertBreakpoint();
    1048 
    1049     RTMemFree(hAdapter);
     1033    AssertBreakpoint();
     1034
     1035    PVBOXWDDMDISP_ADAPTER pAdapter = (PVBOXWDDMDISP_ADAPTER)hAdapter;
     1036    if (pAdapter->pD3D9If)
     1037    {
     1038        HRESULT hr = pAdapter->pD3D9If->Release();
     1039        Assert(hr == S_OK);
     1040        VBoxDispD3DClose(&pAdapter->D3D);
     1041    }
     1042
     1043    RTMemFree(pAdapter);
    10501044
    10511045    vboxVDbgPrint(("<== "__FUNCTION__", hAdapter(0x%p)\n", hAdapter));
     
    10581052    vboxVDbgPrint(("==> "__FUNCTION__"\n"));
    10591053
    1060 //    AssertBreakpoint();
    1061 
     1054    AssertBreakpoint();
     1055
     1056    HRESULT hr = S_OK;
    10621057    PVBOXWDDMDISP_ADAPTER pAdapter = (PVBOXWDDMDISP_ADAPTER)RTMemAllocZ(sizeof (VBOXWDDMDISP_ADAPTER));
    10631058    Assert(pAdapter);
    1064     if (!pAdapter)
     1059    if (pAdapter)
     1060    {
     1061        pAdapter->hAdapter = pOpenData->hAdapter;
     1062        pAdapter->uIfVersion = pOpenData->Interface;
     1063        pAdapter->uRtVersion= pOpenData->Version;
     1064        pAdapter->RtCallbacks = *pOpenData->pAdapterCallbacks;
     1065
     1066        pOpenData->hAdapter = pAdapter;
     1067        pOpenData->pAdapterFuncs->pfnGetCaps = vboxWddmDispGetCaps;
     1068        pOpenData->pAdapterFuncs->pfnCreateDevice = vboxWddmDispCreateDevice;
     1069        pOpenData->pAdapterFuncs->pfnCloseAdapter = vboxWddmDispCloseAdapter;
     1070        pOpenData->DriverVersion = D3D_UMD_INTERFACE_VERSION;
     1071
     1072        /* try enable the 3D */
     1073        hr = VBoxDispD3DOpen(&pAdapter->D3D);
     1074        Assert(hr == S_OK);
     1075        if (hr == S_OK)
     1076        {
     1077            hr = pAdapter->D3D.pfnDirect3DCreate9Ex(D3D_SDK_VERSION, &pAdapter->pD3D9If);
     1078            Assert(hr == S_OK);
     1079            if (hr == S_OK)
     1080            {
     1081                vboxVDbgPrint(("<== "__FUNCTION__", SUCCESS 3D Enabled, pAdapter (0x%p)\n", pAdapter));
     1082                return S_OK;
     1083            }
     1084            else
     1085                vboxVDbgPrintR((__FUNCTION__": pfnDirect3DCreate9Ex failed, hr (%d)\n", hr));
     1086        }
     1087        else
     1088            vboxVDbgPrintR((__FUNCTION__": VBoxDispD3DOpen failed, hr (%d)\n", hr));
     1089
     1090        vboxVDbgPrint(("<== "__FUNCTION__", SUCCESS 3D DISABLED, pAdapter (0x%p)\n", pAdapter));
     1091        return S_OK;
     1092//        RTMemFree(pAdapter);
     1093    }
     1094    else
    10651095    {
    10661096        vboxVDbgPrintR((__FUNCTION__": RTMemAllocZ returned NULL\n"));
    1067         return E_OUTOFMEMORY;
     1097        hr = E_OUTOFMEMORY;
    10681098    }
    10691099
    1070     pAdapter->hAdapter = pOpenData->hAdapter;
    1071     pAdapter->uIfVersion = pOpenData->Interface;
    1072     pAdapter->uRtVersion= pOpenData->Version;
    1073     pAdapter->RtCallbacks = *pOpenData->pAdapterCallbacks;
    1074 
    1075     pOpenData->hAdapter = pAdapter;
    1076     pOpenData->pAdapterFuncs->pfnGetCaps = vboxWddmDispGetCaps;
    1077     pOpenData->pAdapterFuncs->pfnCreateDevice = vboxWddmDispCreateDevice;
    1078     pOpenData->pAdapterFuncs->pfnCloseAdapter = vboxWddmDispCloseAdapter;
    1079     pOpenData->DriverVersion = D3D_UMD_INTERFACE_VERSION;
    1080 
    1081     vboxVDbgPrint(("<== "__FUNCTION__", pAdapter(0x%p)\n", pAdapter));
    1082 
    1083     return S_OK;
     1100    vboxVDbgPrint(("<== "__FUNCTION__", FAILURE, hr (%d)\n", hr));
     1101
     1102    return hr;
    10841103}
    10851104
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.h

    r28800 r29432  
    1616#define ___VBoxDispD3D_h___
    1717
    18 #ifdef DEBUG
    19 # define VBOXWDDMDISP_DEBUG
    20 #endif
     18#include "VBoxDispD3DIf.h"
     19
     20#include <iprt/cdefs.h>
    2121
    2222typedef struct VBOXWDDMDISP_ADAPTER
     
    2525    UINT uIfVersion;
    2626    UINT uRtVersion;
     27    VBOXDISPD3D D3D;
     28    IDirect3D9Ex * pD3D9If;
    2729    D3DDDI_ADAPTERCALLBACKS RtCallbacks;
    2830} VBOXWDDMDISP_ADAPTER, *PVBOXWDDMDISP_ADAPTER;
     
    4042} VBOXWDDMDISP_DEVICE, *PVBOXWDDMDISP_DEVICE;
    4143
    42 #ifdef VBOXWDDMDISP_DEBUG
    43 VOID vboxVDbgDoPrint(LPCSTR szString, ...);
    44 
    45 #define vboxVDbgBreak() AssertBreakpoint()
    46 #define vboxVDbgPrint(_m) \
    47     do { \
    48         vboxVDbgDoPrint _m ; \
    49     } while (0)
    50 #define vboxVDbgPrintR vboxVDbgPrint
    51 #define vboxVDbgPrintF vboxVDbgPrint
    52 #else
    53 #define vboxVDbgBreak() do {} while (0)
    54 #define vboxVDbgPrint(_m)  do {} while (0)
    55 #define vboxVDbgPrintR vboxVDbgPrint
    56 #define vboxVDbgPrintF vboxVDbgPrint
    57 #endif
     44DECLINLINE(bool) vboxDispD3DIs3DEnabled(VBOXWDDMDISP_ADAPTER * pAdapter)
     45{
     46    return pAdapter->pD3D9If;
     47}
    5848
    5949#endif /* #ifndef ___VBoxDispD3D_h___ */
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVbva.cpp

    r28800 r29432  
    266266    Assert (pRecord && (pRecord->cbRecord & VBVA_F_RECORD_PARTIAL));
    267267
    268     dfprintf((__FUNCTION__": VW %d\n", cb));
     268//    dfprintf((__FUNCTION__": VW %d\n", cb));
    269269
    270270    cbHwBufferAvail = vboxHwBufferAvail (pVBVA);
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