mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
[dxvk] Always use SAMPLE_ZERO for implicit resolves
This commit is contained in:
parent
1e4b39ad4d
commit
e4812a1177
3 changed files with 15 additions and 8 deletions
|
@ -7750,8 +7750,21 @@ namespace dxvk {
|
|||
prepareImage(op.inputImage, vk::makeSubresourceRange(op.resolveRegion.srcSubresource));
|
||||
prepareImage(op.resolveImage, vk::makeSubresourceRange(op.resolveRegion.dstSubresource));
|
||||
|
||||
resolveImageRp(op.resolveImage, op.inputImage, op.resolveRegion,
|
||||
op.resolveFormat, op.resolveMode, op.resolveMode);
|
||||
// Always do a SAMPLE_ZERO resolve here since that's less expensive and closer to what
|
||||
// happens on native AMD anyway. Need to use a shader in case we are dealing with a
|
||||
// non-integer color image since render pass resolves only support AVERAGE.
|
||||
auto formatInfo = lookupFormatInfo(op.resolveFormat);
|
||||
|
||||
bool useRp = (formatInfo->flags.any(DxvkFormatFlag::SampledSInt, DxvkFormatFlag::SampledUInt))
|
||||
|| (formatInfo->aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT));
|
||||
|
||||
if (useRp) {
|
||||
resolveImageRp(op.resolveImage, op.inputImage, op.resolveRegion,
|
||||
op.resolveFormat, VK_RESOLVE_MODE_SAMPLE_ZERO_BIT, VK_RESOLVE_MODE_SAMPLE_ZERO_BIT);
|
||||
} else {
|
||||
resolveImageFb(op.resolveImage, op.inputImage, op.resolveRegion,
|
||||
op.resolveFormat, VK_RESOLVE_MODE_SAMPLE_ZERO_BIT, VK_RESOLVE_MODE_NONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -129,11 +129,6 @@ namespace dxvk {
|
|||
op.resolveRegion.dstSubresource.baseArrayLayer = 0u;
|
||||
op.resolveRegion.extent = view.resolveView->mipLevelExtent(0u);
|
||||
op.resolveFormat = view.inputView->info().format;
|
||||
op.resolveMode = VK_RESOLVE_MODE_AVERAGE_BIT;
|
||||
|
||||
if ((format->flags.any(DxvkFormatFlag::SampledSInt, DxvkFormatFlag::SampledUInt)
|
||||
|| (format->aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT))))
|
||||
op.resolveMode = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT;
|
||||
|
||||
view.resolveDone = true;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ namespace dxvk {
|
|||
Rc<DxvkImage> resolveImage = nullptr;
|
||||
VkImageResolve resolveRegion = { };
|
||||
VkFormat resolveFormat = VK_FORMAT_UNDEFINED;
|
||||
VkResolveModeFlagBits resolveMode = VK_RESOLVE_MODE_NONE;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue