Skip to content

Fix Windows Vulkan capture launch environment#254

Merged
BANANASJIM merged 1 commit into
BANANASJIM:masterfrom
Lin-WeiChen-Taiwan:codex/fix-target-control-capture
Jun 18, 2026
Merged

Fix Windows Vulkan capture launch environment#254
BANANASJIM merged 1 commit into
BANANASJIM:masterfrom
Lin-WeiChen-Taiwan:codex/fix-target-control-capture

Conversation

@Lin-WeiChen-Taiwan

@Lin-WeiChen-Taiwan Lin-WeiChen-Taiwan commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix Windows local Vulkan captures launched through the Python RenderDoc API by passing RenderDoc environment modifications to ExecuteAndInject.

When rdc capture launches 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 registered VK_LAYER_RENDERDOC_Capture layer 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.json exists next to the loaded renderdoc module:

  • ENABLE_VULKAN_RENDERDOC_CAPTURE=1
  • VK_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.py
  • Manual Windows Vulkan smoke using a local SDL/Vulkan triangle target:
    • rdc capture --timeout 30 -o ... -- VulkanTriangle.exe --frames 900
    • rdc open <capture>
    • rdc info reported API: Vulkan and Draw Calls: 1
    • rdc draws -q returned draw event 7

Summary by CodeRabbit

  • Chores
    • Improved environment configuration handling for capture operations on Windows when local package configuration is detected, ensuring proper environment setup during the capture process.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 400186b5-75af-4f35-a943-50e4caae0c56

📥 Commits

Reviewing files that changed from the base of the PR and between 9b74182 and 65c76fb.

📒 Files selected for processing (1)
  • src/rdc/capture_core.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/rdc/capture_core.py

📝 Walkthrough

Walkthrough

Adds two internal helper functions to capture_core.py that construct EnvironmentModification objects using Set/NoSep semantics and assemble a Windows-specific env mod list when renderdoc.json is present. The execute_and_capture function is updated to pass this computed list to rd.ExecuteAndInject instead of a hardcoded empty list.

Changes

Windows Launch Environment for RenderDoc Capture

Layer / File(s) Summary
Env modification helpers and injection wiring
src/rdc/capture_core.py
Adds internal helpers building EnvironmentModification objects (lines 121–149) and updates the rd.ExecuteAndInject call (lines 219–220) to pass the computed env_mods list instead of an empty list when the local package layout is detected on Windows.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop hop, the env vars fall into place,
renderdoc.json found — what a familiar face!
No more empty lists sent off to inject,
Windows gets its mods — fully correct!
The rabbit sets flags with Set/NoSep glee,
Captures now launch as they ought to be! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately describes the main change: fixing Windows Vulkan capture launch environment by passing environment modifications to ExecuteAndInject.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/rdc/capture_core.py (1)

219-220: ⚡ Quick win

Add assertion coverage for the new env-mod handoff path.

Line 220 now passes env_mods into ExecuteAndInject, but tests/mocks/mock_renderdoc.py (Line 1860-Line 1869) currently types envList as list[str] and ignores it, so this behavior can regress without test failures. Please update the mock/test path to capture and assert ENABLE_VULKAN_RENDERDOC_CAPTURE and VK_IMPLICIT_LAYER_PATH for the Windows + renderdoc.json case.

🤖 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1a84e3ac-bf77-4c72-a864-de5f4b99169e

📥 Commits

Reviewing files that changed from the base of the PR and between a98ec12 and 9b74182.

📒 Files selected for processing (1)
  • src/rdc/capture_core.py

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.
@BANANASJIM BANANASJIM force-pushed the codex/fix-target-control-capture branch from 9b74182 to 65c76fb Compare June 18, 2026 00:08

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@BANANASJIM BANANASJIM merged commit 805efa1 into BANANASJIM:master Jun 18, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants