1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-04-04 10:25:17 +02:00

[d3d11] Forward DiscardResource calls to backend for images

This commit is contained in:
Philip Rebohle 2025-02-07 22:50:36 +01:00
parent 9b5499caf2
commit 3aeedb9c98

View File

@ -127,7 +127,6 @@ namespace dxvk {
if (!pResource)
return;
// We don't support the Discard API for images
D3D11_RESOURCE_DIMENSION resType = D3D11_RESOURCE_DIMENSION_UNKNOWN;
pResource->GetType(&resType);
@ -135,9 +134,16 @@ namespace dxvk {
DiscardBuffer(pResource);
} else {
auto texture = GetCommonTexture(pResource);
auto image = texture->GetImage();
for (uint32_t i = 0; i < texture->CountSubresources(); i++)
DiscardTexture(pResource, i);
if (image) {
EmitCs([cImage = std::move(image)] (DxvkContext* ctx) {
ctx->discardImage(cImage);
});
}
}
}