1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[d3d11] Add format and resource type to D3D11_COMMON_RESOURCE_DESC

This commit is contained in:
Philip Rebohle 2018-08-10 02:15:30 +02:00
parent f9e096e954
commit 5276a90195
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 12 additions and 4 deletions

View File

@ -9,18 +9,24 @@ namespace dxvk {
auto texture = GetCommonTexture(pResource);
if (buffer != nullptr) {
pDesc->Dim = D3D11_RESOURCE_DIMENSION_BUFFER;
pDesc->Format = DXGI_FORMAT_UNKNOWN;
pDesc->Usage = buffer->Desc()->Usage;
pDesc->BindFlags = buffer->Desc()->BindFlags;
pDesc->CPUAccessFlags = buffer->Desc()->CPUAccessFlags;
pDesc->MiscFlags = buffer->Desc()->MiscFlags;
return S_OK;
} else if (texture != nullptr) {
pResource->GetType(&pDesc->Dim);
pDesc->Format = texture->Desc()->Format;
pDesc->Usage = texture->Desc()->Usage;
pDesc->BindFlags = texture->Desc()->BindFlags;
pDesc->CPUAccessFlags = texture->Desc()->CPUAccessFlags;
pDesc->MiscFlags = texture->Desc()->MiscFlags;
return S_OK;
} else {
pDesc->Dim = D3D11_RESOURCE_DIMENSION_UNKNOWN;
pDesc->Format = DXGI_FORMAT_UNKNOWN;
pDesc->Usage = D3D11_USAGE_DEFAULT;
pDesc->BindFlags = 0;
pDesc->CPUAccessFlags = 0;

View File

@ -13,10 +13,12 @@ namespace dxvk {
* legal to create a view for a given resource.
*/
struct D3D11_COMMON_RESOURCE_DESC {
D3D11_USAGE Usage;
UINT BindFlags;
UINT CPUAccessFlags;
UINT MiscFlags;
D3D11_RESOURCE_DIMENSION Dim;
DXGI_FORMAT Format;
D3D11_USAGE Usage;
UINT BindFlags;
UINT CPUAccessFlags;
UINT MiscFlags;
};