Repository navigation
fix(cs2): shader OOM guards, swapchain teardown, stuck scrub, ReShade add-on, 1.42.0.1 shadow sigs - #215
Conversation
… add-on, 1.42.0.1 shadow sigs Fixes recent Discord bug/crash reports and incorporates #213 (credit @SpasaevDonut): - DemoBarScrubJs, DemoScrub, DemoScrubMath: recover from missed Panorama SliderReleased events so a stuck scrub drag cannot hijack pause/seeks. - EnvironmentNativeMaterialDerive, SmokeAppearance, SmokeAppearanceMath, RenderSystemDX11Hooks, Filmmaker: guard shader derivation/creation hooks against std::bad_alloc aborts, cap derivation worker concurrency and wait on commit headroom, gate the 512 MiB shader dump cache behind mvm_debug, bounds-check DXBC instruction lengths, and drain workers on shutdown. - RenderSystemDX11Hooks: detour IDXGISwapChain::Release to clear g_pSwapChain before teardown instead of dangling in AfxViewportScaler::TrackBreaks. - dlss-tool.cjs, ReShade.isolated.ini: refresh stale/non-addon d3d11.dll from bundled ReShade, remove stray ReShade dxgi.dll in the private bin, keep .\ in [ADDON] AddonPath, and un-disable mvm_reshade_state.addon64 in [ADDON] DisabledAddons so ReShade effects appear in renders. - LightFx.cpp, ShadowStageProbe.cpp, cs2-build-stamp.txt: update scenesystem.dll shadow signatures for CS2 1.42.0.1 (ClientVersion 2000951), from #213. Closes #214
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a4d3cc8a8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| WindowResize_Shutdown(); // destroys the resize readout window before the DLL goes away | ||
| SceneKeys_Flush(); | ||
| Environment::FlushCommittedEdits(); | ||
| Environment::ShutdownNativeMaterialDerivation(); |
There was a problem hiding this comment.
Invoke derivation shutdown from the client teardown hook
On normal CS2 quit, this call is never reached: a repo-wide search finds no caller of Filmmaker::Shutdown(), while the actual new_CCS2_Client_Shutdown hook in AfxHookSource2/main.cpp shuts down the render-system engine and calls the original client shutdown without invoking it. The derivation queue therefore never gets its stop signal, so detached workers and queued shader references can remain active while shutdown proceeds; invoke this cleanup from the reached teardown path.
Useful? React with 👍 / 👎.
| if(!queue.started){queue.started=true; | ||
| for(unsigned i=0;i<DerivationWorkers();++i)std::thread(DerivationWorker).detach();} |
There was a problem hiding this comment.
Retry worker startup if thread creation fails
If creation of the first worker throws, for example because the OS cannot allocate another thread, queue.started is already true and the surrounding catch(...) suppresses the exception. No worker drains queue.jobs, and later enqueues skip the startup block, leaving shader references and bytecode queued with no derivations for the rest of the session. Roll back started or set it only after a worker starts; QueueScaledColorVariant uses the same startup ordering.
Useful? React with 👍 / 👎.
| static std::mutex lock;std::lock_guard<std::mutex> guard(lock); | ||
| // Development aid: keep the bytecode of every clustered-light program only while mvm_debug is | ||
| // recording, so normal sessions never hold up to 512 MiB of raw DXBC in RAM for dumpprograms. | ||
| if(info.lightSlot&&MvmDebugLog_Active()){ |
There was a problem hiding this comment.
Preserve the documented shader-dump workflow
When mirv_relight dumpprograms is run on an already-loaded map without mvm_debug having been active when its material shaders were derived, this condition has prevented their bytecode from being recorded. The dump command only serializes the existing record (the separate cluster cache contributes at most two compute kernels), so ValidateNativeVariants receives no light-material programs and reports zero variants; there is no path to recover their bytecode without recompiling the shaders. Make the required capture timing explicit and ensure the documented loaded-map workflow can populate the dump or fail clearly.
Useful? React with 👍 / 👎.
| Log("auto-release stuck drag at %.3f (sawDown=%d upFrames=%d)", g_target, g_dragSawMouseDown ? 1 : 0, g_dragMouseUpFrames); | ||
| g_released = true; | ||
| g_reaims = 0; | ||
| if (TimelinePlayhead_Scrubbing()) TimelinePlayhead_EndScrub(); |
There was a problem hiding this comment.
Finalize the camera-path owner on automatic scrub release
When a camera-timeline drag loses its SliderReleased event, CameraPath::ScrubToTick(..., false) has left m_play.Scrubbing() set and m_scrubReleasePending false. This fallback ends only TimelinePlayhead, so CameraPath::RunFrame() keeps calling TickScrub and writing the last preview pose every frame even after DemoScrub becomes inactive; release the camera-path owner too so the recovery actually unpins the view.
Useful? React with 👍 / 👎.
…gnatures (#216) Maintenance release 0.4.3 on release/0.4 (bug fixes only, no 1.0 features): - Backports #198 (DeathMsg signatures for CS2 1.42) and #192 (SkyOrient entity class check). - Incorporates #213 (scenesystem.dll shadow signatures for CS2 1.42.0.1, credit @SpasaevDonut). - Backports #215: stuck demo-bar scrub drag recovery, shader derivation/hook std::bad_alloc guards, worker concurrency cap and commit-headroom backoff, mvm_debug gate on the 512 MiB shader dump cache, DXBC length bounds checks, clean worker shutdown, IDXGISwapChain::Release hook, and ReShade add-on launch repair (refreshing bundled ReShade d3d11.dll, clearing stray ReShade dxgi.dll, keeping .\ in [ADDON] AddonPath, and un-disabling mvm_reshade_state.addon64). - Bumps launcher version to 0.4.3 and adds the 0.4.3 section to CHANGELOG.md (What's New). Refs #214
…es (#218) Credits @SpasaevDonut for the CS2 1.42.0.1 scenesystem.dll shadow signature updates from #213 (incorporated in #215 and shipped in v0.4.3). Co-authored-by: SpasaevDonut <246049908+SpasaevDonut@users.noreply.github.com>
Summary
Fixes the unfixed bugs and crashes triaged from recent Discord reports, repairs the ReShade add-on launch path so ReShade effects appear in renders, and incorporates the verified CS2 1.42.0.1 \scenesystem.dll\ shadow signatures from #213 (credit @SpasaevDonut).
Related issue
Closes #214
Incorporates #213
Scope and affected areas
Verification
AI assistance
Risks and limitations
elease/0.4\ backport branch before publishing \�0.4.3.
Deployment status
Not released (targeting \�0.4.3\ via
elease/0.4)