mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[d3d11] Add format and resource type to D3D11_COMMON_RESOURCE_DESC
This commit is contained in:
parent
f9e096e954
commit
5276a90195
@ -9,18 +9,24 @@ namespace dxvk {
|
|||||||
auto texture = GetCommonTexture(pResource);
|
auto texture = GetCommonTexture(pResource);
|
||||||
|
|
||||||
if (buffer != nullptr) {
|
if (buffer != nullptr) {
|
||||||
|
pDesc->Dim = D3D11_RESOURCE_DIMENSION_BUFFER;
|
||||||
|
pDesc->Format = DXGI_FORMAT_UNKNOWN;
|
||||||
pDesc->Usage = buffer->Desc()->Usage;
|
pDesc->Usage = buffer->Desc()->Usage;
|
||||||
pDesc->BindFlags = buffer->Desc()->BindFlags;
|
pDesc->BindFlags = buffer->Desc()->BindFlags;
|
||||||
pDesc->CPUAccessFlags = buffer->Desc()->CPUAccessFlags;
|
pDesc->CPUAccessFlags = buffer->Desc()->CPUAccessFlags;
|
||||||
pDesc->MiscFlags = buffer->Desc()->MiscFlags;
|
pDesc->MiscFlags = buffer->Desc()->MiscFlags;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} else if (texture != nullptr) {
|
} else if (texture != nullptr) {
|
||||||
|
pResource->GetType(&pDesc->Dim);
|
||||||
|
pDesc->Format = texture->Desc()->Format;
|
||||||
pDesc->Usage = texture->Desc()->Usage;
|
pDesc->Usage = texture->Desc()->Usage;
|
||||||
pDesc->BindFlags = texture->Desc()->BindFlags;
|
pDesc->BindFlags = texture->Desc()->BindFlags;
|
||||||
pDesc->CPUAccessFlags = texture->Desc()->CPUAccessFlags;
|
pDesc->CPUAccessFlags = texture->Desc()->CPUAccessFlags;
|
||||||
pDesc->MiscFlags = texture->Desc()->MiscFlags;
|
pDesc->MiscFlags = texture->Desc()->MiscFlags;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} else {
|
} else {
|
||||||
|
pDesc->Dim = D3D11_RESOURCE_DIMENSION_UNKNOWN;
|
||||||
|
pDesc->Format = DXGI_FORMAT_UNKNOWN;
|
||||||
pDesc->Usage = D3D11_USAGE_DEFAULT;
|
pDesc->Usage = D3D11_USAGE_DEFAULT;
|
||||||
pDesc->BindFlags = 0;
|
pDesc->BindFlags = 0;
|
||||||
pDesc->CPUAccessFlags = 0;
|
pDesc->CPUAccessFlags = 0;
|
||||||
|
@ -13,10 +13,12 @@ namespace dxvk {
|
|||||||
* legal to create a view for a given resource.
|
* legal to create a view for a given resource.
|
||||||
*/
|
*/
|
||||||
struct D3D11_COMMON_RESOURCE_DESC {
|
struct D3D11_COMMON_RESOURCE_DESC {
|
||||||
D3D11_USAGE Usage;
|
D3D11_RESOURCE_DIMENSION Dim;
|
||||||
UINT BindFlags;
|
DXGI_FORMAT Format;
|
||||||
UINT CPUAccessFlags;
|
D3D11_USAGE Usage;
|
||||||
UINT MiscFlags;
|
UINT BindFlags;
|
||||||
|
UINT CPUAccessFlags;
|
||||||
|
UINT MiscFlags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user