1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[d3d11] Zero-initialize UAV counters

Fixes a hang in Dirt Rally on RADV.
This commit is contained in:
Philip Rebohle 2019-11-18 18:38:27 +01:00
parent cee7db1c57
commit c7718e5952
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 24 additions and 1 deletions

View File

@ -427,7 +427,9 @@ namespace dxvk {
return S_FALSE;
try {
*ppUAView = ref(new D3D11UnorderedAccessView(this, pResource, &desc));
auto uav = new D3D11UnorderedAccessView(this, pResource, &desc);
m_initializer->InitUavCounter(uav);
*ppUAView = ref(uav);
return S_OK;
} catch (const DxvkError& e) {
Logger::err(e.message());

View File

@ -47,6 +47,24 @@ namespace dxvk {
}
void D3D11Initializer::InitUavCounter(
D3D11UnorderedAccessView* pUav) {
auto counterBuffer = pUav->GetCounterSlice();
if (!counterBuffer.defined())
return;
std::lock_guard<std::mutex> lock(m_mutex);
const uint32_t zero = 0;
m_context->updateBuffer(
counterBuffer.buffer(),
0, sizeof(zero), &zero);
FlushImplicit();
}
void D3D11Initializer::InitDeviceLocalBuffer(
D3D11Buffer* pBuffer,
const D3D11_SUBRESOURCE_DATA* pInitialData) {

View File

@ -34,6 +34,9 @@ namespace dxvk {
void InitTexture(
D3D11CommonTexture* pTexture,
const D3D11_SUBRESOURCE_DATA* pInitialData);
void InitUavCounter(
D3D11UnorderedAccessView* pUav);
private: