mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-18 22:54:15 +01:00
[d3d11] Introduce GetCommonBuffer helper
Also update GetCommonTexture documentation.
This commit is contained in:
parent
ace8e42213
commit
66e178756e
@ -150,4 +150,14 @@ namespace dxvk {
|
|||||||
return m_device->GetDXVKDevice()->createBuffer(info, memoryFlags);
|
return m_device->GetDXVKDevice()->createBuffer(info, memoryFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
D3D11Buffer* GetCommonBuffer(ID3D11Resource* pResource) {
|
||||||
|
D3D11_RESOURCE_DIMENSION dimension = D3D11_RESOURCE_DIMENSION_UNKNOWN;
|
||||||
|
pResource->GetType(&dimension);
|
||||||
|
|
||||||
|
return dimension == D3D11_RESOURCE_DIMENSION_BUFFER
|
||||||
|
? static_cast<D3D11Buffer*>(pResource)
|
||||||
|
: nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -77,5 +77,15 @@ namespace dxvk {
|
|||||||
const D3D11_BUFFER_DESC* pDesc) const;
|
const D3D11_BUFFER_DESC* pDesc) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieves buffer from resource pointer
|
||||||
|
*
|
||||||
|
* \param [in] pResource The resource to query
|
||||||
|
* \returns Pointer to buffer, or \c nullptr
|
||||||
|
*/
|
||||||
|
D3D11Buffer* GetCommonBuffer(
|
||||||
|
ID3D11Resource* pResource);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -365,11 +365,10 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retrieves common info about a texture
|
* \brief Retrieves texture from resource pointer
|
||||||
*
|
*
|
||||||
* \param [in] pResource The resource. Must be a texture.
|
* \param [in] pResource The resource to query
|
||||||
* \param [out] pTextureInfo Pointer to the texture info struct.
|
* \returns Pointer to texture info, or \c nullptr
|
||||||
* \returns E_INVALIDARG if the resource is not a texture
|
|
||||||
*/
|
*/
|
||||||
D3D11CommonTexture* GetCommonTexture(
|
D3D11CommonTexture* GetCommonTexture(
|
||||||
ID3D11Resource* pResource);
|
ID3D11Resource* pResource);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user