build(hlsl): address warnings#2103
Conversation
📝 WalkthroughWalkthroughThis PR modifies eight shader files to improve numerical safety and parameter propagation. Changes include adding clamping and absolute-value operations before exponentiation, propagating UV derivatives through the lighting pipeline, replacing division with bit-shift operations, and initializing a shader output struct. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 |
|
No actionable suggestions for changed features. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package/Shaders/ISHDR.hlsl`:
- Around line 177-179: The contrast normalization divides by avgValue.x which
can be zero; update the computation of contrastedColorModified (and its use when
blending into contrastedColor) to guard avgValue.x with a small positive epsilon
or conditional fallback so you never divide by zero — e.g., compute a safeAvg =
max(avgValue.x, epsilon) and use safeAvg in the pow(abs(tintedColor) / safeAvg,
Cinematic.z) * safeAvg * sign(tintedColor) expression, and ensure the
lerp/saturate blend still behaves correctly when avgValue.x was originally zero.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8aa84570-11d5-4213-8b6e-11468c65ef1d
📒 Files selected for processing (8)
package/Shaders/Common/Color.hlslipackage/Shaders/Common/LightingEval.hlslipackage/Shaders/Common/VR.hlslipackage/Shaders/ISHDR.hlslpackage/Shaders/Lighting.hlslpackage/Shaders/Menu/BackgroundBlurHorizontal.hlslpackage/Shaders/Menu/BackgroundBlurVertical.hlslpackage/Shaders/Water.hlsl
|
✅ A pre-release build is available for this PR: |
(cherry picked from commit d556a95)
Summary by CodeRabbit
Bug Fixes
Improvements