1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[dxvk] Decide memory priority based on access flags rather than usage

Buffers used as shader resources are storage buffers as well,
and should not take priority over other read-only resources.
This commit is contained in:
Philip Rebohle 2020-11-27 12:16:37 +01:00
parent 5d8539672d
commit c547039bef
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 9 additions and 8 deletions

View File

@ -99,10 +99,9 @@ namespace dxvk {
vkd->device(), &memReqInfo, &memReq);
// Use high memory priority for GPU-writable resources
bool isGpuWritable = (m_info.usage & (
VK_BUFFER_USAGE_STORAGE_BUFFER_BIT |
VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT)) != 0;
bool isGpuWritable = (m_info.access & (
VK_ACCESS_SHADER_WRITE_BIT |
VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT)) != 0;
float priority = isGpuWritable ? 1.0f : 0.5f;
// Ask driver whether we should be using a dedicated allocation

View File

@ -90,10 +90,12 @@ namespace dxvk {
}
// Use high memory priority for GPU-writable resources
bool isGpuWritable = (m_info.usage & (
VK_IMAGE_USAGE_STORAGE_BIT |
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) != 0;
bool isGpuWritable = (m_info.access & (
VK_ACCESS_SHADER_WRITE_BIT |
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT)) != 0;
float priority = isGpuWritable ? 1.0f : 0.5f;