Repository navigation
Revert "Fix measurement lifecycle reviews and preserve sampler batchi… - #3
prematurely wants to merge 1 commit into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6a347a953
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| void D3D9DeviceEx::NotifyBridge(D3D9BridgeEvent event, HRESULT result, | ||
| D3DPRESENT_PARAMETERS* params, const D3D9BridgePresentArgs* present) { | ||
| // Reset already owns the device lock. Present and final release must use | ||
| // the same device -> observer order: callbacks may reenter device APIs. | ||
| D3D9DeviceLock deviceLock = LockDevice(); | ||
| std::lock_guard<std::recursive_mutex> lock(m_bridgeObserverMutex); |
There was a problem hiding this comment.
Restore device-before-observer lock ordering
On a multithreaded device, concurrent Present and Reset can now deadlock: PresentEx enters this function without the device lock and holds m_bridgeObserverMutex while invoking the observer, whereas Reset holds the device lock before calling NotifyBridge. If the Present observer reenters a device API, each thread waits for the other's lock. This occurs in the production measurement observer, where OnUnwrappedDeviceEvent calls RuntimePresent, which can call diagnostics methods such as GetAudit that acquire the device lock. Restore the device-before-observer ordering before invoking callbacks.
Useful? React with 👍 / 👎.
| if (!g_owner) g_owner = GetCurrentThreadId(); | ||
| g_controller.SetAvailable(g_config.cpu, g_config.journal || g_diagnostics != nullptr); | ||
| if (g_owner != GetCurrentThreadId()) return; | ||
| if (g_device != device || g_owner != GetCurrentThreadId()) return; |
There was a problem hiding this comment.
Reject secondary devices before assigning the capture owner
If RuntimePrepareDevice selects one device and another device Presents first on a different thread, this assignment lets the secondary device claim g_owner before the device-identity check rejects its Present. Subsequent Presents from the selected device then fail the owner-thread check indefinitely, so F7/F8 captures and live statistics stop working until the selected device is cleared. Check g_device == device before assigning g_owner, as the previous implementation did.
Useful? React with 👍 / 👎.
| module.path.resize(utf8Length); | ||
| if (utf8Length) WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, | ||
| entry.szExePath, pathLength, module.path.data(), utf8Length, nullptr, nullptr); | ||
| module.path = entry.szExePath; |
There was a problem hiding this comment.
Preserve UTF-8 encoding for enumerated module paths
On Windows systems whose active code page is not UTF-8, a backend installed under a non-ASCII directory now supplies an ANSI-encoded or lossy module path. The bridge projects use CharacterSet=MultiByte, but MeasurementSymbolResolver::LoadModule and LoadExports interpret these strings through std::filesystem::u8path. Consequently, CPU captures cannot open the actual binary or its .rsym sidecar and lose function-level attribution even when matching symbols exist. Keep the wide Toolhelp enumeration and explicit UTF-8 conversion.
Useful? React with 👍 / 👎.
| for (UINT i = 0; i < m_snapshot.LineCount; ++i) { | ||
| position.y += 16; | ||
| renderer.drawText(16, position, i ? 0xffffffffu : 0xffc0ff00u, m_renderLines[i]); | ||
| renderer.drawText(16, position, i ? 0xffffffffu : 0xffc0ff00u, m_lines[i]); |
There was a problem hiding this comment.
Restore overflow handling for the measurement HUD
With DXVK_HUD=full at 1280×720 and default scale, the eight-line measurement block now continues below the existing statistics column instead of moving to the right, causing it to overlap the bottom-left frame-time graph and potentially extend beyond the viewport. In the inspected HUD wiring, d3d9_swapchain.cpp appends HudRenderStack after the standard statistics items, while HudFrameTimeItem::render independently anchors its graph near the bottom of the screen; neither performs collision avoidance for this block. Restore the available-height check and alternate-column placement so capture statistics remain readable with the full HUD enabled.
Useful? React with 👍 / 👎.
…ng (#2)"
This reverts commit 0d5680c.