Fix Windows Vulkan capture launch environment#254
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds two internal helper functions to ChangesWindows Launch Environment for RenderDoc Capture
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/rdc/capture_core.py (1)
219-220: ⚡ Quick winAdd assertion coverage for the new env-mod handoff path.
Line 220 now passes
env_modsintoExecuteAndInject, buttests/mocks/mock_renderdoc.py(Line 1860-Line 1869) currently typesenvListaslist[str]and ignores it, so this behavior can regress without test failures. Please update the mock/test path to capture and assertENABLE_VULKAN_RENDERDOC_CAPTUREandVK_IMPLICIT_LAYER_PATHfor the Windows +renderdoc.jsoncase.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/rdc/capture_core.py` around lines 219 - 220, The `ExecuteAndInject` method in `tests/mocks/mock_renderdoc.py` currently ignores the `envList` parameter, which means the new `env_mods` being passed from line 220 in `src/rdc/capture_core.py` is not being tested or validated. Update the mock's `ExecuteAndInject` method to capture and store the `envList` parameter instead of ignoring it, then add test assertions to verify that `ENABLE_VULKAN_RENDERDOC_CAPTURE` and `VK_IMPLICIT_LAYER_PATH` environment variables are correctly present in the environment modifications for the Windows plus renderdoc.json scenario.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/rdc/capture_core.py`:
- Around line 219-220: The `ExecuteAndInject` method in
`tests/mocks/mock_renderdoc.py` currently ignores the `envList` parameter, which
means the new `env_mods` being passed from line 220 in `src/rdc/capture_core.py`
is not being tested or validated. Update the mock's `ExecuteAndInject` method to
capture and store the `envList` parameter instead of ignoring it, then add test
assertions to verify that `ENABLE_VULKAN_RENDERDOC_CAPTURE` and
`VK_IMPLICIT_LAYER_PATH` environment variables are correctly present in the
environment modifications for the Windows plus renderdoc.json scenario.
On Windows, pass RenderDoc environment modifications to ExecuteAndInject so Vulkan targets load the capture layer from the same RenderDoc install as the loaded Python module. Sets ENABLE_VULKAN_RENDERDOC_CAPTURE=1 and VK_IMPLICIT_LAYER_PATH to the module directory when a sibling renderdoc.json exists. Scoped to Windows local launches; other platforms unchanged.
9b74182 to
65c76fb
Compare
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Summary
Fix Windows local Vulkan captures launched through the Python RenderDoc API by passing RenderDoc environment modifications to
ExecuteAndInject.When
rdc capturelaunches a Vulkan target on Windows, the target process needs to load the RenderDoc Vulkan capture layer that belongs to the same RenderDoc installation as the Python module. Without an explicit launch environment, the Vulkan loader can select a different globally registeredVK_LAYER_RENDERDOC_Capturelayer or fail to enable the expected layer. In that case target control can connect, but the target never registers a Vulkan API and capture waits until the process exits.This change sets, when running on Windows and a sibling
renderdoc.jsonexists next to the loadedrenderdocmodule:ENABLE_VULKAN_RENDERDOC_CAPTURE=1VK_IMPLICIT_LAYER_PATH=<renderdoc module directory>The behavior is scoped to Windows local launches and leaves other platforms unchanged.
Verification
uv run --with ruff ruff check src\rdc\capture_core.pyrdc capture --timeout 30 -o ... -- VulkanTriangle.exe --frames 900rdc open <capture>rdc inforeportedAPI: VulkanandDraw Calls: 1rdc draws -qreturned draw event7Summary by CodeRabbit