1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-02 04:29:14 +01:00

[d3d11] Work around predicate buffer sync issue on RADV

If the predicate buffer is device-local memory, conditional
rendering commands don't seem to see any updates values even
though there is a barrier. When allocating on host-visible
device memory or system memory, it works as expected.
This commit is contained in:
Philip Rebohle 2019-03-28 09:55:13 +01:00
parent 3a3d7fb378
commit 09d60f42bc
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -38,8 +38,16 @@ namespace dxvk {
void D3D11CounterBuffer::CreateBuffer() {
Rc<DxvkBuffer> buffer = m_device->createBuffer(
m_bufferInfo, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
VkMemoryPropertyFlags memoryType = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
// Workaround for predicate buffer sync issues on RADV
if ((m_bufferInfo.usage & VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT)
&& (m_device->adapter()->matchesDriver(DxvkGpuVendor::Amd, VK_DRIVER_ID_MESA_RADV_KHR, 0, 0))) {
memoryType |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
| VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
}
Rc<DxvkBuffer> buffer = m_device->createBuffer(m_bufferInfo, memoryType);
VkDeviceSize sliceCount = m_bufferInfo.size / m_sliceLength;