From 1ed1c434313ba59a91c64772215f2fecb54dc9fd Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 20 Apr 2018 11:12:54 +0200 Subject: [PATCH] [d3d11] Wire up D3D11VkInteropSurface to D3D11Texture*D classes --- src/d3d11/d3d11_texture.cpp | 26 ++++++++++++++++++++++---- src/d3d11/d3d11_texture.h | 13 ++++++++----- 2 files changed, 30 insertions(+), 9 deletions(-) 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; };