vkd3d: Don't spam error if ReleaseSemaphore fails.

This function fails if the counter overflows.
CP77 hits this case a lot and we should just warn the specific failure
instead of a random error.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
Hans-Kristian Arntzen 2021-09-24 13:52:35 +02:00
parent dda02faf89
commit 3b415dbc89
1 changed files with 6 additions and 1 deletions

View File

@ -568,7 +568,12 @@ HRESULT d3d12_fence_signal_event(struct d3d12_fence *fence, HANDLE event, enum v
case VKD3D_WAITING_EVENT_TYPE_SEMAPHORE:
#ifdef _WIN32
return ReleaseSemaphore(event, 1, NULL) ? S_OK : E_FAIL;
/* Failing to release semaphore is expected if the counter exceeds the maximum limit.
* If the application does not wait for the semaphore once per present, this
* will eventually happen. */
if (!ReleaseSemaphore(event, 1, NULL))
WARN("Failed to release semaphore. Application likely forgot to wait for presentation event.\n");
return S_OK;
#else
ERR("Semaphores not supported on this platform.\n");
return E_NOTIMPL;