Skip to content

Commit 9d328b7

Browse files
committed
[d3d11] Forward DiscardResource calls to backend for images
1 parent 3a29a4e commit 9d328b7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/d3d11/d3d11_context.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,23 @@ namespace dxvk {
127127
if (!pResource)
128128
return;
129129

130-
// We don't support the Discard API for images
131130
D3D11_RESOURCE_DIMENSION resType = D3D11_RESOURCE_DIMENSION_UNKNOWN;
132131
pResource->GetType(&resType);
133132

134133
if (resType == D3D11_RESOURCE_DIMENSION_BUFFER) {
135134
DiscardBuffer(pResource);
136135
} else {
137136
auto texture = GetCommonTexture(pResource);
137+
auto image = texture->GetImage();
138138

139139
for (uint32_t i = 0; i < texture->CountSubresources(); i++)
140140
DiscardTexture(pResource, i);
141+
142+
if (image) {
143+
EmitCs([cImage = std::move(image)] (DxvkContext* ctx) {
144+
ctx->discardImage(cImage);
145+
});
146+
}
141147
}
142148
}
143149

0 commit comments

Comments
 (0)