VirtualBox

Ignore:
Timestamp:
Sep 10, 2010 7:43:11 PM (14 years ago)
Author:
vboxsync
Message:

wddm/3d: multiple swapchain handling (needed for win7 & multi-screen)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.h

    r32325 r32425  
    2323
    2424#define VBOXWDDMDISP_MAX_VERTEX_STREAMS 16
     25#define VBOXWDDMDISP_MAX_SWAPCHAIN_SIZE 16
    2526
    2627#ifdef VBOX_WITH_VIDEOHWACCEL
     
    9192} VBOXWDDMDISP_INDICES_INFO;
    9293
    93 typedef struct VBOXWDDMDISP_SCREEN
    94 {
    95     IDirect3DDevice9 *pDevice9If;
    96     struct VBOXWDDMDISP_RESOURCE *pRenderTargetRc;
    97 //    struct VBOXWDDMDISP_RESOURCE *pDstSharedRc;
    98     uint32_t iRenderTargetFrontBuf;
     94typedef struct VBOXWDDMDISP_RENDERTGT_FLAGS
     95{
     96    union
     97    {
     98        struct
     99        {
     100            UINT bAdded : 1;
     101            UINT bRemoved : 1;
     102            UINT Reserved : 30;
     103        };
     104        uint32_t Value;
     105    };
     106}VBOXWDDMDISP_RENDERTGT_FLAGS;
     107
     108typedef struct VBOXWDDMDISP_RENDERTGT
     109{
     110    struct VBOXWDDMDISP_ALLOCATION *pAlloc;
     111    UINT cNumFlips;
     112    VBOXWDDMDISP_RENDERTGT_FLAGS fFlags;
     113} VBOXWDDMDISP_RENDERTGT, *PVBOXWDDMDISP_RENDERTGT;
     114
     115#define VBOXWDDMDISP_INDEX_UNDEFINED (~0)
     116typedef struct VBOXWDDMDISP_SWAPCHAIN_FLAGS
     117{
     118    union
     119    {
     120        struct
     121        {
     122            UINT bChanged : 1;
     123            UINT bInited  : 1;
     124            UINT Reserved : 30;
     125        };
     126        uint32_t Value;
     127    };
     128}VBOXWDDMDISP_SWAPCHAIN_FLAGS;
     129
     130typedef struct VBOXWDDMDISP_SWAPCHAIN
     131{
     132    RTLISTNODE ListEntry;
     133    UINT iBB; /* Backbuffer index */
     134    UINT cRTs; /* Number of render targets in the swapchain */
     135    VBOXWDDMDISP_SWAPCHAIN_FLAGS fFlags;
     136#ifndef VBOXWDDM_WITH_VISIBLE_FB
     137    IDirect3DSurface9 *pRenderTargetFbCopy;
     138#endif
     139    IDirect3DSwapChain9 *pSwapChainIf;
    99140    HWND hWnd;
    100 } VBOXWDDMDISP_SCREEN, *PVBOXWDDMDISP_SCREEN;
     141    VBOXWDDMDISP_RENDERTGT aRTs[VBOXWDDMDISP_MAX_SWAPCHAIN_SIZE];
     142} VBOXWDDMDISP_SWAPCHAIN, *PVBOXWDDMDISP_SWAPCHAIN;
     143
     144
     145//typedef struct VBOXWDDMDISP_SCREEN
     146//{
     147//    RTLISTNODE SwapchainList;
     148//    IDirect3DDevice9 *pDevice9If;
     149////    struct VBOXWDDMDISP_RESOURCE *pDstSharedRc;
     150//    uint32_t iRenderTargetFrontBuf;
     151//    HWND hWnd;
     152//} VBOXWDDMDISP_SCREEN, *PVBOXWDDMDISP_SCREEN;
    101153
    102154typedef struct VBOXWDDMDISP_DEVICE
     
    104156    HANDLE hDevice;
    105157    PVBOXWDDMDISP_ADAPTER pAdapter;
     158    IDirect3DDevice9 *pDevice9If;
     159    RTLISTNODE SwapchainList;
    106160    UINT u32IfVersion;
    107161    UINT uRtVersion;
     
    110164    UINT cbCmdBuffer;
    111165    D3DDDI_CREATEDEVICEFLAGS fFlags;
    112 #ifndef VBOXWDDM_WITH_VISIBLE_FB
    113     IDirect3DSurface9 *pRenderTargetFbCopy;
    114 #endif
    115166    /* number of StreamSources set */
    116167    UINT cStreamSources;
     
    128179    CRITICAL_SECTION DirtyAllocListLock;
    129180    RTLISTNODE DirtyAllocList;
    130 
    131     UINT iPrimaryScreen;
    132     UINT cScreens;
    133     VBOXWDDMDISP_SCREEN aScreens[VBOX_VIDEO_MAX_SCREENS];
    134181} VBOXWDDMDISP_DEVICE, *PVBOXWDDMDISP_DEVICE;
    135182
     
    159206    D3DKMT_HANDLE hAllocation;
    160207    VBOXWDDM_ALLOC_TYPE enmType;
     208    struct VBOXWDDMDISP_RESOURCE *pRc;
    161209    void* pvMem;
    162210    /* object type is defined by enmD3DIfType enum */
     
    169217    VBOXWDDM_DIRTYREGION DirtyRegion; /* <- dirty region to notify host about */
    170218    VBOXWDDM_SURFACE_DESC SurfDesc;
     219    PVBOXWDDMDISP_SWAPCHAIN pSwapchain;
    171220} VBOXWDDMDISP_ALLOCATION, *PVBOXWDDMDISP_ALLOCATION;
    172221
     
    199248#define VBOXDISP_D3DEV(_p) (_p)->pDevice9If
    200249#else
    201 #define VBOXDISP_D3DEV(_p) vboxWddmD3DDeviceGetPrimary(_p)
     250#define VBOXDISP_D3DEV(_p) vboxWddmD3DDeviceGet(_p)
    202251#endif
    203252
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