fix: removed duplicate perframe buffer setup in prepass#1583
Conversation
WalkthroughRemoved render-target rebind and CS constant-buffer binding from Changes
Sequence Diagram(s)sequenceDiagram
participant Prepass as Deferred::PrepassPasses()
participant RT as RenderTargets/OMSetRenderTargets
participant CS as CS::SetConstantBuffers
rect rgba(200,230,255,0.3)
Note over Prepass,RT: Previous flow (before change)
Prepass ->> RT: mark DIRTY_RENDERTARGET + OMSetRenderTargets
Prepass ->> CS: CSSetConstantBuffers(per-frame, VR if active)
end
rect rgba(240,240,240,0.3)
Note over Prepass,RT: New flow (after change)
Prepass --x RT: (no rebind)
Prepass --x CS: (no CS constant buffer binding)
end
sequenceDiagram
participant ShaderCache as ShaderCache
participant Timer as QueryPerformanceCounter
rect rgba(230,255,230,0.3)
Note over ShaderCache,Timer: Compilation timing lifecycle
ShaderCache ->> Timer: lastReset set (start)
ShaderCache ->> Timer: (periodic) update totalTime
alt all tasks completed/failed and completionTime == 0
ShaderCache ->> Timer: set completionTime (now) %% guarded double-check
ShaderCache ->> ShaderCache: schedule logging (now - lastReset)
end
ShaderCache ->> Timer: on Clear/Reset -> completionTime = 0
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (2)**/*.{cpp,cxx,cc,c,h,hpp,hxx,hlsl,hlsli,fx,fxh,py}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/**/*.{cpp,cxx,cc,h,hpp,hxx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
⏰ 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)
🔇 Additional comments (5)
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 |
|
✅ A pre-release build is available for this PR: |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/ShaderCache.h (1)
247-247: Consider thread safety for completionTime access.The
completionTimefield will be accessed from multiple threads (written inComplete(), read inGetStatsString()) without explicit synchronization. While LARGE_INTEGER operations are typically atomic on x64, consider documenting this assumption or adding explicit synchronization if strict ordering guarantees are needed.src/ShaderCache.cpp (1)
2667-2696: Consider clarifying mixed time base semantics.The
GetStatsString()method now mixes two different time bases:
totalMsis wall-clock elapsed time (line 2675)GetEta()returns estimates based on active compilation time rate (line 2662)At line 2685, the estimated completion is calculated as
GetEta() + totalMs, which combines these different time bases. While this might be the intended behavior (wall-clock elapsed + active-rate-based remaining time), it could be confusing:
- If compilation is throttled or paused, wall-clock time grows faster than active time
- The ETA would be based on active rate, not wall-clock rate
- Users might see "10 minutes elapsed / 12 minutes total" when it actually might take longer in wall-clock time
Consider either:
- Adding a comment explaining this mixed-base calculation
- Using wall-clock rate for ETA as well for consistency
- Displaying both timing types separately (e.g., "10min elapsed, 2min work remaining")
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/ShaderCache.cpp(4 hunks)src/ShaderCache.h(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{cpp,cxx,cc,c,h,hpp,hxx,hlsl,hlsli,fx,fxh,py}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Do not include TODO/FIXME placeholders; provide complete, working solutions
Files:
src/ShaderCache.hsrc/ShaderCache.cpp
src/**/*.{cpp,cxx,cc,h,hpp,hxx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{cpp,cxx,cc,h,hpp,hxx}: Ensure SE/AE/VR runtime compatibility; use runtime detection patterns (e.g., REL::RelocateMember())
Include robust error handling and resource management with graceful degradation in the plugin code
Files:
src/ShaderCache.hsrc/ShaderCache.cpp
⏰ 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 (3)
src/ShaderCache.h (1)
251-257: LGTM!The constructor properly initializes all timing fields including the new
completionTimefield. The zero-initialization clearly indicates "not yet completed" status.src/ShaderCache.cpp (2)
2625-2639: LGTM!The
Clear()method properly resets all timing state including the newcompletionTimefield. The reset is correctly synchronized undercompilationMutex.
2653-2665: LGTM!The added comments clarify the important distinction between active compilation time (used for ETA) and wall-clock elapsed time (used for display). This distinction is valuable given the dual-timing semantics introduced in this PR.
7e8611c to
48b9fe4
Compare
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
|
Learn to revert commits or modify your commit history instead of creating new branches. You complicate the history if we have comments/reviews and then you start a new branch. |
Summary by CodeRabbit
Refactor
New Features / Improvements