feat(UI): enhance shader blocking#1564
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds developer-mode shader debugging and tracking: per-frame active shader tracking in ShaderCache with UI in Advanced menu and overlay. Introduces interactive tables/utilities for filtering/highlighting. Integrates blocking iteration to prefer active shaders. Resets tracking each frame. Minor casting cleanup. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer (Dev mode)
participant State as State::Debug
participant Cache as ShaderCache
participant Render as Game Render Path
participant Menu as AdvancedSettingsRenderer
participant Overlay as OverlayRenderer
State->>Cache: ResetFrameShaderTracking()
loop During frame draw
Render->>Cache: Get{Vertex/Pixel/Compute}Shader(...)
Note right of Cache: In dev mode<br/>TrackActiveShader(class, shader, descriptor)
Cache->>Cache: TrackActiveShader(...)
end
Dev->>Menu: Open Advanced > Shader Debug
Menu->>Cache: GetActiveShaders()
Cache-->>Menu: vector<ActiveShaderInfo>
Menu->>Dev: Interactive table (filter/sort, block/unblock)
alt Block shader selected
Menu->>Cache: Update blockedKey / blockedKeyIndex
end
Overlay->>Cache: Query blocked shader + active list
Cache-->>Overlay: Blocked key, details
Overlay->>Dev: Show blocked shader status
sequenceDiagram
autonumber
participant Cache as ShaderCache::IterateShaderBlock
participant Act as ActiveShaders
participant Map as shaderMap
Cache->>Act: Check tracked active shaders (dev mode)
alt Active shaders exist
Cache->>Act: Sort/select next active shader
Cache->>Cache: Set blockedKey/blockedKeyIndex
else No active shaders
Cache->>Map: Fallback iterate shaderMap
Cache->>Cache: Set blockedKey/blockedKeyIndex
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~55 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Comment |
Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com>
Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com>
Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com>
Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com>
|
Don't merge. Taking out of draft for ci. |
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the shader blocking developer feature by adding active shader tracking, a comprehensive ImGui UI, and real-time statistics. The implementation addresses workflow inefficiencies where developers previously had to cycle through 3000+ cached shaders, making shader debugging significantly more efficient by prioritizing recently-used shaders.
- Adds active shader tracking system that monitors recently-used shaders (~1 second history)
- Implements new ImGui UI in Advanced Settings with filtering, sorting, and one-click blocking
- Enhances existing PAGEUP/PAGEDOWN workflow to prioritize active shaders over full cache
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/State.cpp | Integrates shader tracking frame reset with existing debug frame detection |
| src/ShaderCache.h | Adds ActiveShaderInfo struct and tracking methods for developer mode |
| src/ShaderCache.cpp | Implements shader tracking, enhanced iteration, and UI data access methods |
| src/Menu/AdvancedSettingsRenderer.h | Declares new shader debug section renderer |
| src/Menu/AdvancedSettingsRenderer.cpp | Implements comprehensive shader debugging UI with table, filtering, and controls |
| docs/shader-debugging.md | User guide documenting features, usage examples, and technical details |
| docs/shader-debugging-ui-mockup.md | Visual UI specification with ASCII mockups and interaction details |
| docs/PR-SUMMARY.md | Technical overview, implementation approach, and testing recommendations |
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
|
@coderabbitai please review. |
|
@alandtse: I'll review the changes now. This looks like a comprehensive enhancement to the shader debugging workflow with active shader tracking and an ImGui UI. I'll provide detailed feedback on the implementation. ✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (1)
src/Menu/AdvancedSettingsRenderer.cpp (1)
232-238: Use proper wide-to-UTF8 conversion instead of char-cast (duplicate)Manual wchar_t→char casting corrupts non-ASCII paths. Use Util::WStringToString.
Apply this diff at both places:
- std::string diskPathStr; - diskPathStr.resize(shader.diskPath.size()); - std::transform(shader.diskPath.begin(), shader.diskPath.end(), diskPathStr.begin(), - [](wchar_t c) { return static_cast<char>(c); }); + std::string diskPathStr = Util::WStringToString(shader.diskPath);Also applies to: 335-339
🧹 Nitpick comments (5)
src/Menu/OverlayRenderer.cpp (1)
210-259: Ensure Util::Colors is declared (include Utils/UI.h if needed)RenderShaderBlockingStatus() uses Util::Colors. If not already visible via transitive includes, add the proper header to avoid ODR/undeclared symbol issues.
Would you confirm whether Utils/UI.h is included (directly or indirectly) here? If not, add:
#include "State.h" -#include "Util.h" +#include "Util.h" +#include "Utils/UI.h"src/Utils/UI.cpp (1)
694-730: Fix UB in case-insensitive search (use unsigned char with tolower)std::tolower on plain char is UB for non-ASCII. Cast to unsigned char to be safe.
Apply this diff:
- std::transform(lowerText.begin(), lowerText.end(), lowerText.begin(), ::tolower); - std::transform(lowerSearch.begin(), lowerSearch.end(), lowerSearch.begin(), ::tolower); + std::transform(lowerText.begin(), lowerText.end(), lowerText.begin(), + [](unsigned char c) { return static_cast<char>(std::tolower(c)); }); + std::transform(lowerSearch.begin(), lowerSearch.end(), lowerSearch.begin(), + [](unsigned char c) { return static_cast<char>(std::tolower(c)); });src/Menu/AdvancedSettingsRenderer.cpp (1)
430-433: Default sort should surface “hot” shadersSorting default by Key (4) is less useful for debugging. Prefer “Frame %” (column 3) and descending.
Apply this diff:
- 4, // Default sort column (Key) - true, // Default ascending + 3, // Default sort column (Frame %) + false, // Default descendingsrc/ShaderCache.cpp (2)
2480-2516: Avoid mixing blockedKeyIndex semantics between active list and shaderMapblockedKeyIndex is documented as “index in shaderMap.” Here it’s set to the index within the active-keys vector, which can skew fallback iteration. Use -1 to indicate dev-active selection and keep shaderMap fallback consistent.
Apply this diff:
- blockedKey = keys[targetIdx]; - blockedKeyIndex = targetIdx; + blockedKey = keys[targetIdx]; + blockedKeyIndex = (uint)-1; // keep shaderMap iteration independent blockedIDs.clear();Optionally, consider ordering active keys by recentness or draw count rather than lexicographically for better PAGEUP/PAGEDOWN workflow.
2485-2491: Consider priority ordering for active shader iterationSorting active keys alphabetically reduces usefulness. Sort by drawCalls desc, then lastUsed desc, and cap to N (e.g., 50) to match the intended “active shaders” iteration.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
src/Menu/AdvancedSettingsRenderer.cpp(3 hunks)src/Menu/AdvancedSettingsRenderer.h(1 hunks)src/Menu/OverlayRenderer.cpp(3 hunks)src/Menu/OverlayRenderer.h(1 hunks)src/ShaderCache.cpp(6 hunks)src/ShaderCache.h(1 hunks)src/State.cpp(1 hunks)src/Utils/UI.cpp(1 hunks)src/Utils/UI.h(5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build plugin and addons
🔇 Additional comments (8)
src/ShaderCache.h (1)
639-663: Active shader tracking API looks soundStruct, map, and mutex shape are appropriate; const accessor returning a copy is safe for UI. No concerns here.
src/State.cpp (1)
77-79: Frame-start reset placement is correctCalling ResetFrameShaderTracking() at new-frame boundary is the right lifecycle hook.
src/Menu/AdvancedSettingsRenderer.h (1)
18-18: Header declaration added correctlyRenderShaderDebugSection() is declared alongside other private sections. Good.
src/Menu/OverlayRenderer.h (1)
52-53: Private API addition looks fineKeeping RenderShaderBlockingStatus() private and calling from within class is fine.
src/Menu/OverlayRenderer.cpp (1)
45-47: Overlay now shows blocking statusThe call placement after compilation status is reasonable.
src/ShaderCache.cpp (2)
1729-1731: Dev-mode activity tracking hooks look goodTracking at shader retrieval points is lightweight and correctly gated.
Also applies to: 1777-1779, 1821-1823
2750-2758: Casting fix in GetHumanTime is fineThe static_cast for milliseconds avoids narrowing warnings. LGTM.
src/Utils/UI.h (1)
658-691: Avoid bindingdisplayTextto a temporary
displayTextis aconst std::string&that refers to a temporarystd::stringwheneverfallbackTextis used, leaving a dangling reference and triggering UB on the very next line. Store the value by copy instead.- const std::string& displayText = text.empty() && fallbackText ? std::string(fallbackText) : text; + std::string displayText = text.empty() && fallbackText ? std::string(fallbackText) : text;Likely an incorrect or invalid review comment.
|
✅ A pre-release build is available for this PR: |
* chore(ui): update discord banner (community-shaders#1493) * fix: use proper filename settingsuser.json (community-shaders#1491) * chore(upscaling): increase fsr sharpness * chore: rename d3d12interop to d3d12SwapChainActive (community-shaders#1494) * feat(llf): remove particle lights (community-shaders#1495) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(llf): move llf to core (community-shaders#1496) * fix: remove water clamp (community-shaders#1497) * fix(upscaling): more upscaling fixes (community-shaders#1498) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: fix some internal errors when debugging (community-shaders#1500) * fix(ui): fix save settings conflicts & welcome screen (community-shaders#1501) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(ui): add constraints for discord banner size (community-shaders#1463) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(VR): fix exiting menu using controllers (community-shaders#1502) * build: fix warnings (community-shaders#1505) * feat(UI): allow tooltips for disabled elements (community-shaders#1503) * feat(upscaling): add downscale percentages (community-shaders#1506) * perf(ssgi): optimize (community-shaders#1499) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat(ui): font size and perf overlay improvements (community-shaders#1511) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore: remove unused hooks (community-shaders#1510) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: adjust IsInterior to consider kNoSky or kFixedDimensions flags (community-shaders#1512) * fix(hair): correct hair indirect normal, marschner by default (community-shaders#1515) Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: mostly revert ISHDR to 1.3.6 (community-shaders#1516) * chore(upscaling): simplify interop and upscale methods (community-shaders#1514) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(hair): typo in code (community-shaders#1517) * feat(ibl): lerp sky ibl using skylighting (community-shaders#1519) * fix(sss): burley artifacts with effect blend (community-shaders#1518) * fix(upscaling): fix screenshots when upscaling enabled (community-shaders#1520) * fix(upscaling): fix mipbias sometimes being wrong (community-shaders#1521) * fix: fix compile error if snow shader on (community-shaders#1522) * chore(upscaling): revert fsr to typical settings (community-shaders#1523) * fix: fix minor ui issues (community-shaders#1524) * chore(grass collision): simpler grass collision (community-shaders#1525) * fix: update skylighting and version * fix(pbr): fix inconsistencies (community-shaders#1526) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: jiayev <l936249247@hotmail.com> * feat(upscaling): sharpening slider (community-shaders#1527) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore: bump versions * fix(ibl): add ibl to reflection normalization (community-shaders#1528) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(hair): remove pbr lighting mult for hair (community-shaders#1531) * chore(upscaling): add back upscale multiplier (community-shaders#1532) * fix(upscaling): fix minor upscaling issues (community-shaders#1536) * chore: gamma space normalisation (community-shaders#1535) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat(grass collision): implement with texture and history (community-shaders#1539) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore(grass collision): less aggressive (community-shaders#1546) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(skylighting): fix cell id casting (community-shaders#1544) * chore(emat): auto detect terrain parallax (community-shaders#1545) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore: update versions * feat(VR): enable upscaling (community-shaders#1507) * fix(terrain shadows): fix brightened lods (community-shaders#1547) * chore(upscaling): reduce ghosting near camera (community-shaders#1548) * fix: fix grass not animating (community-shaders#1549) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(grass collision): fix non-standard timescales (community-shaders#1550) * build: deploy only updated files (community-shaders#1556) * feat: add Clear Shader Cache to Advanced (community-shaders#1555) * chore(featureissues): default collapse testing menu (community-shaders#1554) * fix(VR): use only supported shaders from cache (community-shaders#1553) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * build: use gersemi cmake formatter (community-shaders#1557) * fix(terrain): vanilla diffuse in pbr terrain cell too bright due to wrong color space (community-shaders#1558) * docs: add new feature development template guide (community-shaders#1529) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * docs(UI): remove duplicate GPL license statement (community-shaders#1561) * feat: add renderdoc for debugging (community-shaders#1560) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com> Co-authored-by: Alan Tse <alandtse@gmail.com> * fix(ui): welcome popup size issues (community-shaders#1573) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore(grass collision): minor tweaks (community-shaders#1568) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(terrain helper): fix conflicting bit (community-shaders#1566) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat(UI): separate theme settings, UI refactor, font support (community-shaders#1571) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore: bump versions * build: fix zipping aio (community-shaders#1579) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(grass collision): clamp maximum depth of grass (community-shaders#1578) * feat(UI): enhance shader blocking (community-shaders#1564) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alan Tse <alandtse@gmail.com> * fix: remove duplicate buffer setup (community-shaders#1586) * feat: update shader compile elapsed time every second (community-shaders#1587) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * build: add cmake install commands (community-shaders#1372) * feat(perf-overlay): add size controls (community-shaders#1591) * fix(perf-overlay): fix infinite draw calls table height (community-shaders#1590) * refactor(perf-overlay): remove collapsible headers (community-shaders#1572) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(perf-overlay): removed ImGuiTableFlags_ScrollX/Y for scroll bar issues (community-shaders#1594) * build: fix shader copying to relative paths (community-shaders#1603) * fix(ibl): apply ibl to cubemap normalisation for non deferred (community-shaders#1604) * fix(grass): use correct light direction (community-shaders#1602) * fix(welcome-popup): adjust font size & window spacing (community-shaders#1592) * feat(lod): add gamma sliders (community-shaders#1588) * build: correct CodeRabbit schema syntax (community-shaders#1608) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com> * build: add compile-time validation of GPU buffers (community-shaders#1427) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com> * ci: run shader validation on CMake and CI config changes (community-shaders#1606) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com> * feat: procedural sun * limb darkening * another darkening * build(deps): remove orphaned Intel XeSS dependency (community-shaders#1611) Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> * fix: accumulate sunlight color in pixel shader output * fix(ui): enter key now behaves properly when first time popup is open (community-shaders#1615) * feat(ui): add tabs to advanced settings & PBR search (community-shaders#1599) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * build: add HLSL intellisense (community-shaders#1614) * refactor(UI): move light limit visualization into debug (community-shaders#1619) * refactor(ui): add settings for shader block hotkeys (community-shaders#1624) Co-authored-by: Bruce <44987693+brucenguyen@users.noreply.github.com> * fix(ui): anchor reset settings button position (community-shaders#1621) Co-authored-by: Giovanni Correia <Gistix@users.noreply.github.com> * fix(hair): use indirect normal for deferred marschner hair (community-shaders#1626) * build: fix Package-AIO-Manual for fresh pulls (community-shaders#1625) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(snow): use world space vectors (community-shaders#1618) * feat(UI): add gaussian blur shader core files (community-shaders#1595) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(ui): add test conditions button (community-shaders#1637) * fix(ui): blocked shader info overflow in Shader Debug tab (community-shaders#1632) * fix(upscaling): replace NIS with RCAS for DLSS (community-shaders#1620) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(dynamic cubemaps): add a check for timeskip (community-shaders#1639) * refactor: restructure lighting (community-shaders#1633) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(ui): add themes & fonts (community-shaders#1596) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat(water): add flowmap parallax (community-shaders#1636) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix cloud shadow setting saving --------- Co-authored-by: zxcvbn <66063766+zndxcvbn@users.noreply.github.com> Co-authored-by: davo0411 <davidkehoe0411@outlook.com> Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Alan Tse <alandtse@users.noreply.github.com> Co-authored-by: soda <130315225+soda3000@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: ThePagi <32794457+ThePagi@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com> Co-authored-by: Alan Tse <alandtse@gmail.com> Co-authored-by: Yupeng Zhang <ArcEarth@outlook.com> Co-authored-by: kuplion <kuplion@hotmail.com> Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Giovanni Correia <Gistix@users.noreply.github.com> Co-authored-by: Bruce <44987693+brucenguyen@users.noreply.github.com> Co-authored-by: Midona <106106405+midona-rhel@users.noreply.github.com>
Screen shots
Overview
This PR significantly improves the shader blocking developer feature by adding active shader tracking, a comprehensive ImGui UI, and real-time statistics. These changes address the workflow inefficiencies described in the issue where developers had to cycle through 3000+ cached shaders to debug issues.
Problem
The existing shader blocking feature (PAGEUP/PAGEDOWN cycling) had several limitations:
Solution
1. Active Shader Tracking
Added a new tracking system that monitors shaders used in recent frames (~1 second history):
The system automatically:
State::Debug()2. Enhanced ImGui UI
Added a new "Shader Debugging" section in Advanced Settings (Developer Mode only) with:
Blocked Shader Display:
Active Shaders Table:
3. Improved PAGEUP/PAGEDOWN
Enhanced the keyboard workflow to prioritize active shaders:
Technical Details
Minimal, Surgical Changes:
Integration Points:
GetVertexShader,GetPixelShader,GetComputeShaderState::Debug()new frame detectionglobals::pattern for accessSShaderCacheutility functionsBenefits
Documentation
Added three comprehensive documentation files:
docs/shader-debugging.md- User guide with usage examples and technical detailsdocs/shader-debugging-ui-mockup.md- Visual UI specification with ASCII mockupsdocs/PR-SUMMARY.md- Technical overview and testing recommendationsExample Workflow
Before:
After:
Testing Notes
This code has been carefully reviewed for:
Requirements Met
From the original issue:
Requirements 5-6 (moving to Debug group feature and object selection via crosshair) are recommended for future PRs as mentioned in the issue as "later phases."
Backward Compatibility
Original prompt
Fixes #1563
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Summary by CodeRabbit