mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-20 08:52:22 +01:00
[dxvk] Only force late clears on older Nvidia drivers
Disables the workaround introduced in 00872e9e4fdd87d92f2dd662791b8de6a7edf10c on drivers that were not affected by the bug.
This commit is contained in:
parent
64b35c5c0f
commit
c968ba624b
@ -1783,7 +1783,8 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (attachmentIndex < 0) {
|
if (attachmentIndex < 0) {
|
||||||
bool hasViewFormatMismatch = imageView->info().format != imageView->image()->info().format;
|
bool useLateClear = m_device->perfHints().renderPassClearFormatBug
|
||||||
|
&& imageView->info().format != imageView->image()->info().format;
|
||||||
|
|
||||||
flushPendingAccesses(*imageView, DxvkAccess::Write);
|
flushPendingAccesses(*imageView, DxvkAccess::Write);
|
||||||
|
|
||||||
@ -1818,9 +1819,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
attachmentInfo.loadOp = colorOp.loadOp;
|
attachmentInfo.loadOp = colorOp.loadOp;
|
||||||
|
|
||||||
// We can't use LOAD_OP_CLEAR if the view format does not match the
|
if (useLateClear && attachmentInfo.loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR)
|
||||||
// underlying image format, so just discard here and use clear later.
|
|
||||||
if (hasViewFormatMismatch && attachmentInfo.loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR)
|
|
||||||
attachmentInfo.loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
attachmentInfo.loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||||
|
|
||||||
renderingInfo.colorAttachmentCount = 1;
|
renderingInfo.colorAttachmentCount = 1;
|
||||||
@ -1853,9 +1852,9 @@ namespace dxvk {
|
|||||||
|
|
||||||
m_cmd->cmdBeginRendering(&renderingInfo);
|
m_cmd->cmdBeginRendering(&renderingInfo);
|
||||||
|
|
||||||
if (hasViewFormatMismatch) {
|
if (useLateClear && clearAspects) {
|
||||||
VkClearAttachment clearInfo = { };
|
VkClearAttachment clearInfo = { };
|
||||||
clearInfo.aspectMask = imageView->info().aspects;
|
clearInfo.aspectMask = clearAspects;
|
||||||
clearInfo.clearValue = clearValue;
|
clearInfo.clearValue = clearValue;
|
||||||
|
|
||||||
VkClearRect clearRect = { };
|
VkClearRect clearRect = { };
|
||||||
@ -4661,9 +4660,8 @@ namespace dxvk {
|
|||||||
if (ops.colorOps[i].loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR) {
|
if (ops.colorOps[i].loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR) {
|
||||||
colorInfos[i].clearValue.color = ops.colorOps[i].clearValue;
|
colorInfos[i].clearValue.color = ops.colorOps[i].clearValue;
|
||||||
|
|
||||||
// We can't use LOAD_OP_CLEAR if the view format does not match the
|
if (m_device->perfHints().renderPassClearFormatBug
|
||||||
// underlying image format, so just discard here and use clear later.
|
&& colorTarget.view->info().format != colorTarget.view->image()->info().format) {
|
||||||
if (colorTarget.view->info().format != colorTarget.view->image()->info().format) {
|
|
||||||
colorInfos[i].loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
colorInfos[i].loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||||
|
|
||||||
auto& clear = lateClears[lateClearCount++];
|
auto& clear = lateClears[lateClearCount++];
|
||||||
|
@ -346,6 +346,10 @@ namespace dxvk {
|
|||||||
hints.preferFbResolve = m_features.amdShaderFragmentMask
|
hints.preferFbResolve = m_features.amdShaderFragmentMask
|
||||||
&& (m_adapter->matchesDriver(VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR)
|
&& (m_adapter->matchesDriver(VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR)
|
||||||
|| m_adapter->matchesDriver(VK_DRIVER_ID_AMD_PROPRIETARY_KHR));
|
|| m_adapter->matchesDriver(VK_DRIVER_ID_AMD_PROPRIETARY_KHR));
|
||||||
|
// Older Nvidia drivers sometimes use the wrong format
|
||||||
|
// to interpret the clear color in render pass clears.
|
||||||
|
hints.renderPassClearFormatBug = m_adapter->matchesDriver(
|
||||||
|
VK_DRIVER_ID_NVIDIA_PROPRIETARY, Version(), Version(560, 28, 3));
|
||||||
return hints;
|
return hints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ namespace dxvk {
|
|||||||
struct DxvkDevicePerfHints {
|
struct DxvkDevicePerfHints {
|
||||||
VkBool32 preferFbDepthStencilCopy : 1;
|
VkBool32 preferFbDepthStencilCopy : 1;
|
||||||
VkBool32 preferFbResolve : 1;
|
VkBool32 preferFbResolve : 1;
|
||||||
|
VkBool32 renderPassClearFormatBug : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user