VirtualBox

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


Ignore:
Timestamp:
Mar 22, 2024 12:38:39 PM (11 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
162386
Message:

Addition/3D,Additions/WINNT/Graphics: Updates for mesa-24.0.2 (not enabled yet). bugref:10606

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video
Files:
5 edited

Legend:

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

    r102145 r103999  
    157157 ifdef VBOX_WITH_MESA3D
    158158  VBoxDispD3D_DEFS   += VBOX_WITH_MESA3D
     159  VBoxDispD3D_DEFS   += VBOX_MESA_V_MAJOR=$(VBOX_MESA_V_MAJOR)
    159160  VBoxDispD3D_INCS   += \
    160161        $(VBOX_PATH_MESA)/src/gallium/include \
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/VBoxGaD3DDevice9Ex.cpp

    r98103 r103999  
    597597STDMETHODIMP GaDirect3DDevice9Ex::GaSurfaceId(IUnknown *pSurface, uint32_t *pu32Sid)
    598598{
     599#if VBOX_MESA_V_MAJOR < 24
    599600    struct pipe_resource *pResource = mpStack->GaNinePipeResourceFromSurface(pSurface);
    600601    if (pResource)
     
    603604        *pu32Sid = mpStack->GaDrvGetSurfaceId(pScreen, pResource);
    604605    }
     606#else
     607    *pu32Sid = mpStack->GaNineGetSurfaceId(pSurface);
     608#endif
    605609
    606610    return S_OK;
     
    609613STDMETHODIMP GaDirect3DDevice9Ex::GaWDDMContextHandle(HANDLE *phContext)
    610614{
     615#if VBOX_MESA_V_MAJOR < 24
    611616    struct pipe_context *pPipeContext = mpStack->GaNinePipeContextFromDevice(this->mpDevice);
    612617    if (pPipeContext)
     
    622627        }
    623628    }
     629#else
     630    uint32_t u32Cid = mpStack->GaNineGetContextId(mpDevice);
     631    WDDMGalliumDriverEnv const *pEnv = mpD3D9Ex->GetWDDMEnv();
     632    if (pEnv)
     633    {
     634        GaDrvEnvWddm *pEnvWddm = (GaDrvEnvWddm *)pEnv->pvEnv;
     635        *phContext = pEnvWddm->GaDrvEnvWddmContextHandle(u32Cid);
     636    }
     637#endif
    624638
    625639    return S_OK;
     
    628642STDMETHODIMP GaDirect3DDevice9Ex::GaFlush()
    629643{
     644#if VBOX_MESA_V_MAJOR < 24
    630645    struct pipe_context *pPipeContext = mpStack->GaNinePipeContextFromDevice(this->mpDevice);
    631646    if (pPipeContext)
     
    633648        mpStack->GaDrvContextFlush(pPipeContext);
    634649    }
     650#else
     651    mpStack->GaNineFlush(this->mpDevice);
     652#endif
    635653
    636654    return S_OK;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/VBoxGallium.cpp

    r98103 r103999  
    3939#include <iprt/string.h>
    4040
     41#if VBOX_MESA_V_MAJOR < 24
    4142/*
    4243 * Loading Gallium state tracker and driver:
     
    6667#endif
    6768;
     69#else /* VBOX_MESA_V_MAJOR >= 24 */
     70/*
     71 * Loading Gallium D3D9 state tracker and driver:
     72 *   1) load the state tracker DLL (VBoxNine) which contains the driver code too
     73 *      (they have to be in the same dll because both use and compare adresses of global constant
     74 *       glsl_type glsl_type_builtin_* structures from Mesa code).
     75 *     a) get an entry point to create the ID3DAdapter interface (GaNineD3DAdapter9Create);
     76 *     b) create ID3DAdapter, which will create the pipe_screen to access the driver internally.
     77 *   3) create GaDirect3D9Ex to have IDirect3DEx or GaDirect3DDevice9Ex to have IDirect3DDevice9Ex,
     78 *      which is returned to WDDM user mode driver to substitute wine's IDirect3DDevice9Ex.
     79 */
     80static const char *gpszNineDll =
     81#ifdef VBOX_WDDM_WOW64
     82    "VBoxNine-x86.dll"
     83#else
     84    "VBoxNine.dll"
     85#endif
     86;
     87#endif /* VBOX_MESA_V_MAJOR >= 24 */
    6888
    6989/**
     
    159179                                    IDirect3DDevice9Ex** ppReturnedDeviceInterface);
    160180
     181#if VBOX_MESA_V_MAJOR < 24
    161182        STDMETHOD(GaNineD3DAdapter9Create)(struct pipe_screen *s, ID3DAdapter9 **ppOut);
    162183        STDMETHOD_(struct pipe_resource *, GaNinePipeResourceFromSurface)(IUnknown *pSurface);
    163184        STDMETHOD_(struct pipe_context *, GaNinePipeContextFromDevice)(IDirect3DDevice9 *pDevice);
    164 
     185#else
     186        STDMETHOD(GaNineD3DAdapter9Create)(const WDDMGalliumDriverEnv *pEnv, ID3DAdapter9 **ppOut);
     187        STDMETHOD_(uint32_t, GaNineGetSurfaceId)(IUnknown *pSurface);
     188        STDMETHOD_(uint32_t, GaNineGetContextId)(IDirect3DDevice9 *pDevice);
     189        STDMETHOD_(void, GaNineFlush)(IDirect3DDevice9 *pDevice);
     190#endif
     191
     192#if VBOX_MESA_V_MAJOR < 24
    165193        STDMETHOD_(struct pipe_screen *, GaDrvScreenCreate)(const WDDMGalliumDriverEnv *pEnv);
    166194        STDMETHOD_(void, GaDrvScreenDestroy)(struct pipe_screen *s);
     
    169197        STDMETHOD_(uint32_t, GaDrvGetSurfaceId)(struct pipe_screen *pScreen, struct pipe_resource *pResource);
    170198        STDMETHOD_(void, GaDrvContextFlush)(struct pipe_context *pPipeContext);
     199#endif
    171200
    172201    private:
     
    176205
    177206        HMODULE mhmodStateTracker;
     207#if VBOX_MESA_V_MAJOR < 24
    178208        HMODULE mhmodDriver;
     209#endif
    179210
    180211        struct GaNineFunctions
    181212        {
     213#if VBOX_MESA_V_MAJOR < 24
    182214            PFNGaNineD3DAdapter9Create       pfnGaNineD3DAdapter9Create;
    183215            PFNGaNinePipeResourceFromSurface pfnGaNinePipeResourceFromSurface;
    184216            PFNGaNinePipeContextFromDevice   pfnGaNinePipeContextFromDevice;
     217#else
     218            PFNGaNineD3DAdapter9Create pfnGaNineD3DAdapter9Create;
     219            PFNGaNineGetSurfaceId      pfnGaNineGetSurfaceId;
     220            PFNGaNineGetContextId      pfnGaNineGetContextId;
     221            PFNGaNineFlush             pfnGaNineFlush;
     222#endif
    185223        } mNine;
    186224
     225#if VBOX_MESA_V_MAJOR < 24
    187226        struct GaDrvFunctions
    188227        {
     
    194233            PFNGaDrvContextFlush  pfnGaDrvContextFlush;
    195234        } mDrv;
     235#endif
    196236};
    197237
     
    253293        STDMETHOD_(IGalliumStack *, GetGalliumStack)(THIS);
    254294        STDMETHOD_(ID3DAdapter9 *, GetAdapter9)(THIS);
     295#if VBOX_MESA_V_MAJOR < 24
    255296        STDMETHOD_(struct pipe_screen *, GetScreen)(THIS);
     297#else
     298        STDMETHOD_(const WDDMGalliumDriverEnv *, GetWDDMEnv)(THIS);
     299#endif
    256300
    257301    private:
     
    261305
    262306        VBoxGalliumStack *mpStack;
     307#if VBOX_MESA_V_MAJOR < 24
    263308        struct pipe_screen *mpPipeScreen;
     309#endif
    264310        ID3DAdapter9 *mpD3DAdapter9;
    265311
     
    275321VBoxGalliumStack::VBoxGalliumStack()
    276322    :
    277     mcRefs(0),
    278     mhmodStateTracker(0),
    279     mhmodDriver(0)
     323    mcRefs(0)
     324    , mhmodStateTracker(0)
     325#if VBOX_MESA_V_MAJOR < 24
     326    , mhmodDriver(0)
     327#endif
    280328{
    281329    RT_ZERO(mNine);
     330#if VBOX_MESA_V_MAJOR < 24
    282331    RT_ZERO(mDrv);
     332#endif
    283333}
    284334
     
    327377    struct VBOXGAPROC aNineProcs[] =
    328378    {
     379#if VBOX_MESA_V_MAJOR < 24
    329380        { "GaNineD3DAdapter9Create",        (FARPROC *)&mNine.pfnGaNineD3DAdapter9Create },
    330381        { "GaNinePipeResourceFromSurface",  (FARPROC *)&mNine.pfnGaNinePipeResourceFromSurface },
    331382        { "GaNinePipeContextFromDevice",    (FARPROC *)&mNine.pfnGaNinePipeContextFromDevice },
     383#else
     384        { "GaNineD3DAdapter9Create", (FARPROC *)&mNine.pfnGaNineD3DAdapter9Create },
     385        { "GaNineGetSurfaceId",      (FARPROC *)&mNine.pfnGaNineGetSurfaceId },
     386        { "GaNineGetContextId",      (FARPROC *)&mNine.pfnGaNineGetContextId },
     387        { "GaNineFlush",             (FARPROC *)&mNine.pfnGaNineFlush },
     388#endif
    332389        { NULL, NULL }
    333390    };
    334391
     392#if VBOX_MESA_V_MAJOR < 24
    335393    struct VBOXGAPROC aDrvProcs[] =
    336394    {
     
    352410        hr = loadDll(gpszNineDll, &mhmodStateTracker, aNineProcs);
    353411    }
     412#else
     413    HRESULT hr = loadDll(gpszNineDll, &mhmodStateTracker, aNineProcs);
     414#endif
    354415
    355416    return hr;
     
    359420{
    360421    RT_ZERO(mNine);
     422#if VBOX_MESA_V_MAJOR < 24
    361423    RT_ZERO(mDrv);
     424#endif
    362425
    363426    if (mhmodStateTracker)
     
    367430    }
    368431
     432#if VBOX_MESA_V_MAJOR < 24
    369433    if (mhmodDriver)
    370434    {
     
    372436        mhmodDriver = 0;
    373437    }
    374 }
    375 
     438#endif
     439}
     440
     441#if VBOX_MESA_V_MAJOR < 24
    376442STDMETHODIMP VBoxGalliumStack::GaNineD3DAdapter9Create(struct pipe_screen *s,
    377443                                                       ID3DAdapter9 **ppOut)
     
    389455    return mNine.pfnGaNinePipeContextFromDevice(pDevice);
    390456}
    391 
     457#else
     458STDMETHODIMP VBoxGalliumStack::GaNineD3DAdapter9Create(const WDDMGalliumDriverEnv *pEnv,
     459                                                       ID3DAdapter9 **ppOut)
     460{
     461    return mNine.pfnGaNineD3DAdapter9Create(pEnv, ppOut);
     462}
     463
     464STDMETHODIMP_(uint32_t) VBoxGalliumStack::GaNineGetSurfaceId(IUnknown *pSurface)
     465{
     466    return mNine.pfnGaNineGetSurfaceId(pSurface);
     467}
     468
     469STDMETHODIMP_(uint32_t) VBoxGalliumStack::GaNineGetContextId(IDirect3DDevice9 *pDevice)
     470{
     471    return mNine.pfnGaNineGetContextId(pDevice);
     472}
     473
     474STDMETHODIMP_(void) VBoxGalliumStack::GaNineFlush(IDirect3DDevice9 *pDevice)
     475{
     476    return mNine.pfnGaNineFlush(pDevice);
     477}
     478#endif
     479
     480#if VBOX_MESA_V_MAJOR < 24
    392481STDMETHODIMP_(struct pipe_screen *) VBoxGalliumStack::GaDrvScreenCreate(const WDDMGalliumDriverEnv *pEnv)
    393482{
     
    420509    mDrv.pfnGaDrvContextFlush(pPipeContext);
    421510}
     511#endif
    422512
    423513STDMETHODIMP VBoxGalliumStack::CreateDirect3DEx(HANDLE hAdapter,
     
    522612    mcRefs(0),
    523613    mpStack(pStack),
     614#if VBOX_MESA_V_MAJOR < 24
    524615    mpPipeScreen(0),
     616#endif
    525617    mpD3DAdapter9(0)
    526618{
     
    583675    const WDDMGalliumDriverEnv *pEnv = mEnv.Env();
    584676
     677#if VBOX_MESA_V_MAJOR < 24
    585678    mpPipeScreen = mpStack->GaDrvScreenCreate(pEnv);
    586679    if (mpPipeScreen)
     
    594687        AssertFailed();
    595688    }
     689#else
     690    hr = mpStack->GaNineD3DAdapter9Create(pEnv, &mpD3DAdapter9);
     691    Assert(SUCCEEDED(hr));
     692#endif
    596693
    597694    return hr;
     
    606703    }
    607704
     705#if VBOX_MESA_V_MAJOR < 24
    608706    if (mpPipeScreen)
    609707    {
     
    611709        mpPipeScreen = NULL;
    612710    }
     711#endif
    613712
    614713    if (mpStack)
     
    815914}
    816915
     916#if VBOX_MESA_V_MAJOR < 24
    817917STDMETHODIMP_(struct pipe_screen *) GaDirect3D9Ex::GetScreen(void)
    818918{
    819919    return mpPipeScreen;
    820920}
     921#else
     922STDMETHODIMP_(const WDDMGalliumDriverEnv *) GaDirect3D9Ex::GetWDDMEnv(void)
     923{
     924    return mEnv.Env();
     925}
     926#endif
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/VBoxGallium.h

    r98103 r103999  
    6363        STDMETHOD_(IGalliumStack *, GetGalliumStack)(THIS) PURE;
    6464        STDMETHOD_(ID3DAdapter9 *, GetAdapter9)(THIS) PURE;
     65#if VBOX_MESA_V_MAJOR < 24
    6566        STDMETHOD_(struct pipe_screen *, GetScreen)(THIS) PURE;
     67#else
     68        STDMETHOD_(const WDDMGalliumDriverEnv *, GetWDDMEnv)(THIS) PURE;
     69#endif
    6670};
    6771
     
    8589                                    IDirect3DDevice9Ex** ppReturnedDeviceInterface) PURE;
    8690
     91#if VBOX_MESA_V_MAJOR < 24
    8792        STDMETHOD(GaNineD3DAdapter9Create)(struct pipe_screen *s, ID3DAdapter9 **ppOut) PURE;
    8893        STDMETHOD_(struct pipe_resource *, GaNinePipeResourceFromSurface)(IUnknown *pSurface) PURE;
    8994        STDMETHOD_(struct pipe_context *, GaNinePipeContextFromDevice)(IDirect3DDevice9 *pDevice) PURE;
     95#else
     96        STDMETHOD(GaNineD3DAdapter9Create)(const WDDMGalliumDriverEnv *pEnv, ID3DAdapter9 **ppOut) PURE;
     97        STDMETHOD_(uint32_t, GaNineGetSurfaceId)(IUnknown *pSurface) PURE;
     98        STDMETHOD_(uint32_t, GaNineGetContextId)(IDirect3DDevice9 *pDevice) PURE;
     99        STDMETHOD_(void, GaNineFlush)(IDirect3DDevice9 *pDevice) PURE;
     100#endif
    90101
     102#if VBOX_MESA_V_MAJOR < 24
    91103        STDMETHOD_(struct pipe_screen *, GaDrvScreenCreate)(const WDDMGalliumDriverEnv *pEnv) PURE;
    92104        STDMETHOD_(void, GaDrvScreenDestroy)(struct pipe_screen *s) PURE;
     
    95107        STDMETHOD_(uint32_t, GaDrvGetSurfaceId)(struct pipe_screen *pScreen, struct pipe_resource *pResource) PURE;
    96108        STDMETHOD_(void, GaDrvContextFlush)(struct pipe_context *pPipeContext) PURE;
     109#endif
    97110};
    98111
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/Svga.cpp

    r103714 r103999  
    10731073        } break;
    10741074
     1075        case SVGA_3D_CMD_READBACK_GB_SURFACE:
     1076        {
     1077            SVGA3dCmdReadbackGBSurface *p = (SVGA3dCmdReadbackGBSurface *)pCommand;
     1078            Status = SvgaProcessSurface(pSvga, &p->sid, pHOA);
     1079        } break;
     1080
    10751081        /*
    10761082         * Unsupported commands, which might include a sid.
     
    10861092        case SVGA_3D_CMD_DEFINE_GB_SURFACE:
    10871093        case SVGA_3D_CMD_DESTROY_GB_SURFACE:
    1088         case SVGA_3D_CMD_READBACK_GB_SURFACE:
    10891094        case SVGA_3D_CMD_READBACK_GB_IMAGE:
    10901095        case SVGA_3D_CMD_READBACK_GB_IMAGE_PARTIAL:
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