diff --git a/src/d3d11/d3d11_texture.cpp b/src/d3d11/d3d11_texture.cpp index bedc3252..9a28828a 100644 --- a/src/d3d11/d3d11_texture.cpp +++ b/src/d3d11/d3d11_texture.cpp @@ -285,7 +285,7 @@ namespace dxvk { D3D11VkInteropSurface::D3D11VkInteropSurface( - IDXGIObject* pContainer, + ID3D11DeviceChild* pContainer, D3D11CommonTexture* pTexture) : m_container (pContainer), m_texture (pTexture) { @@ -357,7 +357,8 @@ namespace dxvk { D3D11Texture1D::D3D11Texture1D( D3D11Device* pDevice, const D3D11_COMMON_TEXTURE_DESC* pDesc) - : m_texture(pDevice, pDesc, D3D11_RESOURCE_DIMENSION_TEXTURE1D) { + : m_texture(pDevice, pDesc, D3D11_RESOURCE_DIMENSION_TEXTURE1D), + m_interop(this, &m_texture) { } @@ -378,6 +379,11 @@ namespace dxvk { return S_OK; } + if (riid == __uuidof(IDXGIVkInteropSurface)) { + *ppvObject = ref(&m_interop); + return S_OK; + } + Logger::warn("D3D11Texture1D::QueryInterface: Unknown interface query"); Logger::warn(str::format(riid)); return E_NOINTERFACE; @@ -422,7 +428,8 @@ namespace dxvk { D3D11Texture2D::D3D11Texture2D( D3D11Device* pDevice, const D3D11_COMMON_TEXTURE_DESC* pDesc) - : m_texture(pDevice, pDesc, D3D11_RESOURCE_DIMENSION_TEXTURE2D) { + : m_texture(pDevice, pDesc, D3D11_RESOURCE_DIMENSION_TEXTURE2D), + m_interop(this, &m_texture) { } @@ -443,6 +450,11 @@ namespace dxvk { return S_OK; } + if (riid == __uuidof(IDXGIVkInteropSurface)) { + *ppvObject = ref(&m_interop); + return S_OK; + } + Logger::warn("D3D11Texture2D::QueryInterface: Unknown interface query"); Logger::warn(str::format(riid)); return E_NOINTERFACE; @@ -489,7 +501,8 @@ namespace dxvk { D3D11Texture3D::D3D11Texture3D( D3D11Device* pDevice, const D3D11_COMMON_TEXTURE_DESC* pDesc) - : m_texture(pDevice, pDesc, D3D11_RESOURCE_DIMENSION_TEXTURE3D) { + : m_texture(pDevice, pDesc, D3D11_RESOURCE_DIMENSION_TEXTURE3D), + m_interop(this, &m_texture) { } @@ -510,6 +523,11 @@ namespace dxvk { return S_OK; } + if (riid == __uuidof(IDXGIVkInteropSurface)) { + *ppvObject = ref(&m_interop); + return S_OK; + } + Logger::warn("D3D11Texture3D::QueryInterface: Unknown interface query"); Logger::warn(str::format(riid)); return E_NOINTERFACE; diff --git a/src/d3d11/d3d11_texture.h b/src/d3d11/d3d11_texture.h index a51331e4..fbfd0205 100644 --- a/src/d3d11/d3d11_texture.h +++ b/src/d3d11/d3d11_texture.h @@ -201,7 +201,7 @@ namespace dxvk { public: D3D11VkInteropSurface( - IDXGIObject* pContainer, + ID3D11DeviceChild* pContainer, D3D11CommonTexture* pTexture); ~D3D11VkInteropSurface(); @@ -221,7 +221,7 @@ namespace dxvk { private: - IDXGIObject* m_container; + ID3D11DeviceChild* m_container; D3D11CommonTexture* m_texture; }; @@ -262,7 +262,8 @@ namespace dxvk { private: - D3D11CommonTexture m_texture; + D3D11CommonTexture m_texture; + D3D11VkInteropSurface m_interop; }; @@ -302,7 +303,8 @@ namespace dxvk { private: - D3D11CommonTexture m_texture; + D3D11CommonTexture m_texture; + D3D11VkInteropSurface m_interop; }; @@ -342,7 +344,8 @@ namespace dxvk { private: - D3D11CommonTexture m_texture; + D3D11CommonTexture m_texture; + D3D11VkInteropSurface m_interop; };