fix(glsm): answer enable-cap glGet queries from tracked state - #115
Merged
Conversation
The actinium.glDebug system property enables GLSMDebug world-render logging without requiring the in-game debug option, and logDrawOnActiveProgram records streaming/immediate draws that land on a shader-pipeline program. Added while diagnosing issue #41.
OreLib's OpenGlState (used by Dynamic Surroundings popoffs and rain-splash particle collections) queries enable caps such as GL_TEXTURE_2D through glGetInteger. Compatibility GL answers these queries, but the core-profile backend rejects them, so every read returned 0 and OpenGlState.pop() force-disabled texturing after each popoff. Iris input tracking then matched no-texture program variants for the rest of the frame (rain, particles, hand, translucent terrain), producing the white screen from issue #41; combat plus rain reproduced it reliably. - glGetInteger/glGetFloat now answer enable caps from tracked state via isEnableCap, matching compatibility-profile semantics - map the legacy GL_BLEND_SRC/GL_BLEND_DST aliases to the RGB blend factors so saved blend state round-trips instead of becoming blendFunc(0, 0) - DeferredDrawBatcher.applyStateKey restores texture-unit enables through the new GLStateManager.setTexture2DEnabled so TEXTURE_UNIT_STATE events are posted instead of silently desyncing pipeline inputs Closes #41
Local scratch for crash-dump analysis (debuggers, symbols, parsed WER reports).
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.
改了什么
GLStateManager.glGetInteger/glGetFloat对 enable 能力位(GL_TEXTURE_2D、GL_BLEND等全部glIsEnabled覆盖的 cap)改为从 glsm 跟踪状态应答(新增isEnableCap),与兼容 profile 语义一致;core profile 后端本拒绝这些 pname,此前转发真实 GL 恒返回 0。GL_BLEND_SRC/GL_BLEND_DST旧式别名(0x0BE1/0x0BE0)映射到 RGB 混合因子,避免保存值被读成 0 后恢复成blendFunc(0, 0)。GLStateManager.setTexture2DEnabled(unit, enabled);DeferredDrawBatcher.applyStateKey改走该路径,恢复纹理单元开关时补发TEXTURE_UNIT_STATE事件(原来直接改状态不发事件,Iris 输入追踪会静默脱钩——同类隐患)。actinium.glDebugsysprop 无需游戏内选项即可开启世界渲染调试日志;streaming 绘制落在光影 program 上时记录program-draw日志。为什么(根因)
OreLib(Dynamic Surroundings 依赖)的
OpenGlState.push()用glGetInteger(GL_TEXTURE_2D)等非法方式查询状态保存现场。兼容 profile 下该查询合法,但 Actinium 的 core profile 后端拒绝,glsm 此前直接转发 → 恒返回 0 → OreLib 认为纹理处于关闭 →pop()时无条件disableTexture2D()→ Iris 输入追踪认为 unit-0 无纹理 → 当帧剩余 pass(雨、粒子、手、半透明地形、世界边界)全部错配无纹理程序变体 → 白屏。这解释了 #41 的触发条件:打怪(伤害数字 popoff 每帧执行 push/pop 制造污染)+ 下雨(错配的雨 quad 满屏无纹理渲染形成白屏洗刷,前景雨 quad 还会把动物涂成白色剪影);只打怪时仅手/手持物变白(与 issue 评论一致)。日志实证:污染帧与 OreLib 首次重定向同帧同秒,PARTICLES 96→95、RAIN_SNOW 139→93/95、HAND→131/133 错配序列完整。
如何验证
./gradlew build --no-daemon通过(含check全部测试与 remap jar 契约测试)。/weather rain下打怪触发伤害数字——修复前稳定白屏(雨 quad 无纹理洗刷、手与动物变白),修复后雨丝纹理正常、不再白屏、popoff 消失后画面保持正常。Closes #41