mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 20:52:10 +01:00
[d3d11] Optimize ClearView for render target and depth-only views
We should use clearRenderTarget whenever we clear the entire view. The Talos Principle uses ClearView to clear its render targets for some reason, and we were hitting a slow path there.
This commit is contained in:
parent
6b6347ea2c
commit
b3c19ba5e8
@ -1082,14 +1082,25 @@ namespace dxvk {
|
||||
cClearAspect = clearAspect,
|
||||
cClearValue = clearValue
|
||||
] (DxvkContext* ctx) {
|
||||
const VkImageUsageFlags rtUsage =
|
||||
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT |
|
||||
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||
|
||||
VkOffset3D offset = { 0, 0, 0 };
|
||||
VkExtent3D extent = cImageView->mipLevelExtent(0);
|
||||
|
||||
ctx->clearImageView(
|
||||
cImageView,
|
||||
offset, extent,
|
||||
cClearAspect,
|
||||
cClearValue);
|
||||
if (cImageView->info().usage & rtUsage) {
|
||||
ctx->clearRenderTarget(
|
||||
cImageView,
|
||||
cClearAspect,
|
||||
cClearValue);
|
||||
} else {
|
||||
ctx->clearImageView(
|
||||
cImageView,
|
||||
offset, extent,
|
||||
cClearAspect,
|
||||
cClearValue);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user