VirtualBox

Changeset 108118 in vbox


Ignore:
Timestamp:
Feb 7, 2025 3:33:20 PM (6 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167416
Message:

libs/dxvk-2.3.1: Avoid RTTI on Windows

Location:
trunk/src/libs/dxvk-2.3.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/dxvk-2.3.1/Makefile.kmk

    r107547 r108118  
    4141ifeq ($(KBUILD_TARGET),win)
    4242 VBOX_DXVK_PLATFORM = DXVK_PLATFORM_WINDOWS
    43  VBOX_DXVK_CXXFLAGS_WIN = -GR # DXVK uses RTTI
    44  VBOX_DXVK_CXXFLAGS_WIN += -wd4101 # 'e': unreferenced local variable
     43 VBOX_DXVK_CXXFLAGS_WIN  = -wd4101 # 'e': unreferenced local variable
    4544 VBOX_DXVK_CXXFLAGS_WIN += -wd4146 # unary minus operator applied to unsigned type, result still unsigned
    4645 VBOX_DXVK_CXXFLAGS_WIN += -wd4265 # 'dxvk::DxgiMonitorInfo': class has virtual functions, but its non-trivial destructor is not virtual; instances of this class may not be destructed correctly
  • trunk/src/libs/dxvk-2.3.1/src/d3d11/d3d11_context.cpp

    r105107 r108118  
    135135    // ID3D11View has no methods to query the exact type of
    136136    // the view, so we'll have to check each possible class
     137#if defined(VBOX) && defined(RT_OS_WINDOWS)
     138    // Avoid RTTI/dynamic_cast
     139    D3D11DepthStencilView* dsv = nullptr;
     140    ID3D11DepthStencilView* pDSV;
     141    if (SUCCEEDED(pResourceView->QueryInterface(__uuidof(ID3D11DepthStencilView), reinterpret_cast<void**>(&pDSV))))
     142      dsv = reinterpret_cast<D3D11DepthStencilView*>(pDSV);
     143
     144    D3D11RenderTargetView* rtv = nullptr;
     145    ID3D11RenderTargetView* pRTV;
     146    if (SUCCEEDED(pResourceView->QueryInterface(__uuidof(ID3D11RenderTargetView), reinterpret_cast<void**>(&pRTV))))
     147      rtv = reinterpret_cast<D3D11RenderTargetView*>(pRTV);
     148
     149    D3D11UnorderedAccessView* uav = nullptr;
     150    ID3D11UnorderedAccessView* pUAV;
     151    if (SUCCEEDED(pResourceView->QueryInterface(__uuidof(ID3D11UnorderedAccessView), reinterpret_cast<void**>(&pUAV))))
     152      uav = reinterpret_cast<D3D11UnorderedAccessView*>(pUAV);
     153#else
    137154    auto dsv = dynamic_cast<D3D11DepthStencilView*>(pResourceView);
    138155    auto rtv = dynamic_cast<D3D11RenderTargetView*>(pResourceView);
    139156    auto uav = dynamic_cast<D3D11UnorderedAccessView*>(pResourceView);
     157#endif
    140158
    141159    Rc<DxvkImageView> view;
     
    668686    // ID3D11View has no methods to query the exact type of
    669687    // the view, so we'll have to check each possible class
     688#if defined(VBOX) && defined(RT_OS_WINDOWS)
     689    // Avoid RTTI/dynamic_cast
     690    D3D11DepthStencilView* dsv = nullptr;
     691    ID3D11DepthStencilView* pDSV;
     692    if (SUCCEEDED(pView->QueryInterface(__uuidof(ID3D11DepthStencilView), reinterpret_cast<void**>(&pDSV))))
     693      dsv = reinterpret_cast<D3D11DepthStencilView*>(pDSV);
     694
     695    D3D11RenderTargetView* rtv = nullptr;
     696    ID3D11RenderTargetView* pRTV;
     697    if (SUCCEEDED(pView->QueryInterface(__uuidof(ID3D11RenderTargetView), reinterpret_cast<void**>(&pRTV))))
     698      rtv = reinterpret_cast<D3D11RenderTargetView*>(pRTV);
     699
     700    D3D11UnorderedAccessView* uav = nullptr;
     701    ID3D11UnorderedAccessView* pUAV;
     702    if (SUCCEEDED(pView->QueryInterface(__uuidof(ID3D11UnorderedAccessView), reinterpret_cast<void**>(&pUAV))))
     703      uav = reinterpret_cast<D3D11UnorderedAccessView*>(pUAV);
     704
     705    D3D11VideoProcessorOutputView* vov = nullptr;
     706    ID3D11VideoProcessorOutputView* pVPOV;
     707    if (SUCCEEDED(pView->QueryInterface(__uuidof(ID3D11VideoProcessorOutputView), reinterpret_cast<void**>(&pVPOV))))
     708      vov = reinterpret_cast<D3D11VideoProcessorOutputView*>(pVPOV);
     709#else
    670710    auto dsv = dynamic_cast<D3D11DepthStencilView*>(pView);
    671711    auto rtv = dynamic_cast<D3D11RenderTargetView*>(pView);
    672712    auto uav = dynamic_cast<D3D11UnorderedAccessView*>(pView);
    673713    auto vov = dynamic_cast<D3D11VideoProcessorOutputView*>(pView);
     714#endif
    674715
    675716    // Retrieve underlying resource view
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