Changeset 95014 in vbox
- Timestamp:
- May 15, 2022 9:52:59 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win-dx.cpp
r95012 r95014 72 72 typedef struct DXDEVICE 73 73 { 74 ID3D11Device 75 ID3D11DeviceContext 74 ID3D11Device1 *pDevice; /* Device. */ 75 ID3D11DeviceContext1 *pImmediateContext; /* Corresponding context. */ 76 76 IDXGIFactory *pDxgiFactory; /* DXGI Factory. */ 77 77 D3D_FEATURE_LEVEL FeatureLevel; … … 821 821 822 822 823 static int dxDeviceCreate(PVMSVGA3DBACKEND pBackend, DXDEVICE *pD evice)823 static int dxDeviceCreate(PVMSVGA3DBACKEND pBackend, DXDEVICE *pDXDevice) 824 824 { 825 825 int rc = VINF_SUCCESS; … … 827 827 if (pBackend->fSingleDevice && pBackend->dxDevice.pDevice) 828 828 { 829 pD evice->pDevice = pBackend->dxDevice.pDevice;830 pD evice->pDevice->AddRef();831 832 pD evice->pImmediateContext = pBackend->dxDevice.pImmediateContext;833 pD evice->pImmediateContext->AddRef();834 835 pD evice->pDxgiFactory = pBackend->dxDevice.pDxgiFactory;836 pD evice->pDxgiFactory->AddRef();837 838 pD evice->FeatureLevel = pBackend->dxDevice.FeatureLevel;839 840 pD evice->pStagingBuffer = 0;841 pD evice->cbStagingBuffer = 0;829 pDXDevice->pDevice = pBackend->dxDevice.pDevice; 830 pDXDevice->pDevice->AddRef(); 831 832 pDXDevice->pImmediateContext = pBackend->dxDevice.pImmediateContext; 833 pDXDevice->pImmediateContext->AddRef(); 834 835 pDXDevice->pDxgiFactory = pBackend->dxDevice.pDxgiFactory; 836 pDXDevice->pDxgiFactory->AddRef(); 837 838 pDXDevice->FeatureLevel = pBackend->dxDevice.FeatureLevel; 839 840 pDXDevice->pStagingBuffer = 0; 841 pDXDevice->cbStagingBuffer = 0; 842 842 843 843 return rc; … … 855 855 #endif 856 856 857 ID3D11Device *pDevice = 0; 858 ID3D11DeviceContext *pImmediateContext = 0; 857 859 HRESULT hr = pBackend->pfnD3D11CreateDevice(pAdapter, 858 860 D3D_DRIVER_TYPE_HARDWARE, … … 862 864 RT_ELEMENTS(s_aFeatureLevels), 863 865 D3D11_SDK_VERSION, 864 &pDevice ->pDevice,865 &pD evice->FeatureLevel,866 &p Device->pImmediateContext);866 &pDevice, 867 &pDXDevice->FeatureLevel, 868 &pImmediateContext); 867 869 if (SUCCEEDED(hr)) 868 870 { 869 LogRel(("VMSVGA: Feature level %#x\n", pDevice->FeatureLevel)); 871 LogRel(("VMSVGA: Feature level %#x\n", pDXDevice->FeatureLevel)); 872 873 hr = pDevice->QueryInterface(__uuidof(ID3D11Device1), (void**)&pDXDevice->pDevice); 874 AssertReturnStmt(SUCCEEDED(hr), 875 D3D_RELEASE(pImmediateContext); D3D_RELEASE(pDevice), 876 VERR_NOT_SUPPORTED); 877 878 hr = pImmediateContext->QueryInterface(__uuidof(ID3D11DeviceContext1), (void**)&pDXDevice->pImmediateContext); 879 AssertReturnStmt(SUCCEEDED(hr), 880 D3D_RELEASE(pImmediateContext); D3D_RELEASE(pDXDevice->pDevice); D3D_RELEASE(pDevice), 881 VERR_NOT_SUPPORTED); 870 882 871 883 #ifdef DEBUG … … 873 885 HRESULT hr2; 874 886 ID3D11Debug *pDebug = 0; 875 hr2 = pD evice->pDevice->QueryInterface(__uuidof(ID3D11Debug), (void**)&pDebug);887 hr2 = pDXDevice->pDevice->QueryInterface(__uuidof(ID3D11Debug), (void**)&pDebug); 876 888 if (SUCCEEDED(hr2)) 877 889 { … … 909 921 910 922 IDXGIDevice *pDxgiDevice = 0; 911 hr = pD evice->pDevice->QueryInterface(__uuidof(IDXGIDevice), (void**)&pDxgiDevice);923 hr = pDXDevice->pDevice->QueryInterface(__uuidof(IDXGIDevice), (void**)&pDxgiDevice); 912 924 if (SUCCEEDED(hr)) 913 925 { … … 916 928 if (SUCCEEDED(hr)) 917 929 { 918 hr = pDxgiAdapter->GetParent(__uuidof(IDXGIFactory), (void**)&pD evice->pDxgiFactory);930 hr = pDxgiAdapter->GetParent(__uuidof(IDXGIFactory), (void**)&pDXDevice->pDxgiFactory); 919 931 D3D_RELEASE(pDxgiAdapter); 920 932 }
Note:
See TracChangeset
for help on using the changeset viewer.