diff --git a/src/d3d8/d3d8_device.h b/src/d3d8/d3d8_device.h index a5d9332d870..c042d2ef185 100644 --- a/src/d3d8/d3d8_device.h +++ b/src/d3d8/d3d8_device.h @@ -151,6 +151,7 @@ namespace dxvk { UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8** ppBackBuffer) { + InitReturnPtr(ppBackBuffer); if (iBackBuffer >= m_backBuffers.size() || m_backBuffers[iBackBuffer] == nullptr) { Com pSurface9; @@ -158,7 +159,7 @@ namespace dxvk { if (FAILED(res)) return res; - m_backBuffers[iBackBuffer] = ref(new D3D8Surface(this, std::move(pSurface9))); + m_backBuffers[iBackBuffer] = new D3D8Surface(this, std::move(pSurface9)); *ppBackBuffer = m_backBuffers[iBackBuffer].ref(); return res; @@ -821,8 +822,11 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE GetIndices( IDirect3DIndexBuffer8** ppIndexData, UINT* pBaseVertexIndex) { + InitReturnPtr(ppIndexData); + *ppIndexData = m_indices.ptr(); *pBaseVertexIndex = m_baseVertexIndex; + return D3D_OK; } @@ -881,7 +885,6 @@ namespace dxvk { for (UINT i = 0; i < m_presentParams.BackBufferCount; i++) { m_backBuffers.push_back(nullptr); } - m_frontBuffer = nullptr; m_renderTarget = nullptr; m_renderTargetPrev = nullptr; m_depthStencil = nullptr; @@ -903,20 +906,19 @@ namespace dxvk { D3D8StateBlock* m_recorder = nullptr; struct D3D8VBO { - Com buffer = nullptr; - UINT stride = 0; + Com buffer = nullptr; + UINT stride = 0; }; // Remember to fill() these in the constructor! std::array, d8caps::MAX_TEXTURE_STAGES> m_textures; std::array m_streams; - Com m_indices; - INT m_baseVertexIndex = 0; + Com m_indices; + INT m_baseVertexIndex = 0; // TODO: Which of these should be a private ref std::vector> m_backBuffers; - Com m_frontBuffer; Com m_renderTarget; Com m_renderTargetPrev;