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:
parent
cee7db1c57
commit
c7718e5952
@ -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());
|
||||
|
@ -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) {
|
||||
|
@ -34,6 +34,9 @@ namespace dxvk {
|
||||
void InitTexture(
|
||||
D3D11CommonTexture* pTexture,
|
||||
const D3D11_SUBRESOURCE_DATA* pInitialData);
|
||||
|
||||
void InitUavCounter(
|
||||
D3D11UnorderedAccessView* pUav);
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user