Repository navigation
feat(shader): schedule parallel compilation with ARB/KHR backends - #33
Merged
Merged
Conversation
Add bounded submission, completion polling, owned variant jobs, demand barriers, context-aware cleanup, state-cache prewarming, and fixed HUD startup batches. Add scheduler/cache/real-GL tests and document measured performance and remaining runtime acceptance gaps. An intermittent startup heap-corruption exit remains unresolved; this change is being proposed as a draft for review. Refs #32 Co-Authored-By: Codex <codex@openai.com>
- Replace the std::function GL boundary with IShaderGLOperations and CShaderGLOperations - Prefix data types with C, declare one member per line, restore program state typedefs - Expand single-line if statements and function bodies, name pump and cache limits - Drive shader compile cvars from one table and add per-module program table clears - Pass HBAO finalizers explicitly instead of comparing target addresses Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为 #32 实现真正的批量 Shader 编译调度。原路径在编译后立即查询状态,缓存预热也进入绘制路径;本次将提交、轮询、最终化和需求等待拆开,避免预热过程中逐项阻塞。
草稿,尚未达到合并验收门槛。 存在一次未定位的
0xC0000374启动退出,完整游戏视觉、内存和性能验收也未完成。关联 #32,不自动关闭 issue。Architecture
Changed files
src/gl_shader_parallel.hsrc/gl_shader_parallel.cppsrc/gl_shader_cache.hsrc/gl_shader.hsrc/gl_shader.cppsrc/gl_rmain.cppsrc/gl_wsurf.cppsrc/gl_water.cppsrc/gl_light.cppsrc/gl_studio.cppsrc/gl_sprite.cppsrc/gl_portal.cppsrc/gl_hud.cppcmake/Sources.cmaketests/CMakeLists.txttests/gl_parallel_shader_compile_tests.cpptests/gl_shader_parallel_scheduler_tests.cpptests/gl_shader_cache_tests.cpptests/gl_shader_parallel_integration_tests.cppREADME.mdREADME.zh-CN.mddocs/en/features.mddocs/zh-CN/features.mddocs/en/parallel-shader-compile.mddocs/zh-CN/parallel-shader-compile.mdmemory/ParallelShaderCompile.mdmemory/build_and_verification.mdTests
环境:Windows、VS 2022 / MSVC 14.44、SDK 26100、Win32/x86;聚合工程
D:/MetaHookSv。基线7225f589548fcc664c4d0e540eb91ccff22c3650。cmake --build build/x86/Debug --config Debug --target Renderer Renderer_AVX2(及全部测试目标)cmake --build build/x86/Release --config Release --target Renderer Renderer_AVX2(及全部测试目标)ctest --test-dir build/x86/Debug/Plugins/Renderer -C Debug --output-on-failurectest --test-dir build/x86/Release/Plugins/Renderer -C Release --output-on-failurectest --test-dir build/x86/Release/Plugins/Renderer -C Release -R "^gl_shader_parallel_integration_tests$" -Vcmake --build build/renderer32-format --target format-checkgit diff --cached --check真实 GL:NVIDIA Corporation / GeForce RTX 5060 PCIe/SSE2,驱动 621.01,GLEW 2.2.0;测试 GL 3.3 core,游戏 GL 4.4.0。真实集成测试分别使用自动 ARB、仅 KHR、屏蔽扩展 Sync 三个 Context,各执行强制 Sync;覆盖 VS/GS/FS、故意阶段错误、Uniform、RGBA8 FBO readback、重建和删除验证。hint 请求/读回 4294967295。
游戏:Sven Co-op 5.26 / SvEngine 10257,1920×1080。执行空缓存启动、菜单、stadium4/osprey、模式切换、threads 0/-1、save/load;两图交替 10 次后 program 稳定 97、failed 0。新版 5 次重初始化均 ready 97,临时 shader 创建/删除 194/194。以上是有限运行回归,不能代替完整视觉矩阵。
测试替换的 4 个 DLL/PDB、11 个状态缓存及 config.cfg 已恢复,16 个文件逐项 SHA-256 一致。
Performance
同 GPU、同 32 个简易程序,两种 history × 两种模式 × 五轮交替次序,共 20 行。未清驱动 binary cache,小型热缓存负载。以下为五轮中位数,submit peak 为各轮最大值;“CPU 百分位”是 pump/require 样本,不是游戏帧时间。
请求均唯一,scheduler cache hits=0。已知列表 ARB 预热令 32 个需求均在 Ready 命中,但总 wall 未优于 Sync;不宣称必然吞吐加速。无历史时首次需求仍需等待。原始日志在本地忽略的
build/renderer32-*.log,汇总记录随 PR 提交。Unresolved
0xC0000374堆损坏退出,发生在execing config.cfg附近。没有转储;之后同配置成功,附加调试/地图加载及 8 轮 x86 CDB 启动退出未复现。未证明与本次改动无关,也未宣称修复。Diff summary
27 个文件,新增 2260 行、删除 318 行。覆盖内部调度、十类缓存/状态工厂及固定 HUD 批次;无公开 ABI、GLSL、gamedata 或第三方源码变更。格式和 diff 检查通过,运行时验收保持未完成状态。