1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 22:08:59 +01:00

[d3d11] Track resources when dispatching Cubin shaders as well

This commit is contained in:
Philip Rebohle 2022-02-09 13:14:10 +01:00
parent bb16734a43
commit afe1840c74
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 31 additions and 0 deletions

View File

@ -4529,4 +4529,25 @@ namespace dxvk {
pMsState->enableAlphaToCoverage = VK_FALSE;
}
void D3D11DeviceContext::TrackResourceSequenceNumber(
ID3D11Resource* pResource) {
if (!pResource)
return;
D3D11CommonTexture* texture = GetCommonTexture(pResource);
if (texture) {
if (texture->HasSequenceNumber()) {
for (uint32_t i = 0; i < texture->CountSubresources(); i++)
TrackTextureSequenceNumber(texture, i);
}
} else {
D3D11Buffer* buffer = static_cast<D3D11Buffer*>(pResource);
if (buffer->HasSequenceNumber())
TrackBufferSequenceNumber(buffer);
}
}
}

View File

@ -1068,6 +1068,9 @@ namespace dxvk {
}
}
void TrackResourceSequenceNumber(
ID3D11Resource* pResource);
virtual void EmitCsChunk(DxvkCsChunkRef&& chunk) = 0;
virtual void TrackTextureSequenceNumber(

View File

@ -193,6 +193,13 @@ namespace dxvk {
ctx->launchCuKernelNVX(cLaunchInfo.nvxLaunchInfo, cLaunchInfo.buffers, cLaunchInfo.images);
});
// Track resource usage as necessary
for (uint32_t i = 0; i < NumReadResources; i++)
m_ctx->TrackResourceSequenceNumber(static_cast<ID3D11Resource*>(pReadResources[i]));
for (uint32_t i = 0; i < NumWriteResources; i++)
m_ctx->TrackResourceSequenceNumber(static_cast<ID3D11Resource*>(pWriteResources[i]));
return true;
}
}