LoVisual/mod/docs
loki5512344 39b270b108
perf(mod): extended GL state cache for glUseProgram + glBindVertexArray
Stage 3 'Дополнительные GL-оптимизации' item 1. GlStateManager bytecode in
26.2 (com.mojang.blaze3d.opengl.GlStateManager) shows every other GL bind
(texture, blend, depth, cull, scissor, framebuffer) is already absorbed by
vanilla's BLEND/DEPTH/CULL/SCISSOR/TEXTURES/COLOR_MASK/readFbo/writeFbo state
arrays, but _glUseProgram and _glBindVertexArray reach GL33C every time. Cache
those two slots and skip the redundant driver call.

GlStateCache holds (program, vao) with UNKNOWN=-1 as the safe state (never
short-circuits a real id). GlStateManagerCacheMixin @Inject HEAD cancellable
on both _glUseProgram and _glBindVertexArray; @Inject HEAD on glDeleteProgram
resets because the driver may recycle ids. Gated by micro_opts, so switching
micro-opts off also drops the cache (the mixin resets when the gate is off).
Optimize.onDisable also calls GlStateCache.reset().

Mixins/optimize/gl/ hits the 4-file folder limit, so the mixin lives under
mixins/optimize/gl/state/. Render/engine/optimize/gl/ hits the same limit,
holder is in render/engine/optimize/gl/state/.

6 new tests cover UNKNOWN start, mark/already-bound round trip per slot, slot
independence, id-reuse and '0 is a valid id'. Doc: mark the item ✅ partial
(only these two sites are safe to add; the other three would duplicate
vanilla's caches and hurt).
2026-10-12 22:05:05 +02:00
..
api chore(history): squash 59 commit(s) from 2026-09-23 2026-09-23 22:38:08 +02:00
EVO_REPORT.md feat: frontend perf and a11y pass, plus mod visuals, hero main menu, Simple Voice Chat and vanilla chat autocomplete 2026-10-01 21:29:54 +02:00
optimize-layer-design.md perf(mod): extended GL state cache for glUseProgram + glBindVertexArray 2026-10-12 22:05:05 +02:00
README.md chore(history): squash 59 commit(s) from 2026-09-23 2026-09-23 22:38:08 +02:00
TODO_HISTORY.md feat: GuiPresence (chat-service presence backend, gateway route, mod module); restore TODO history 2026-10-02 13:41:49 +02:00

docs

  • DEV_GUIDE.md — единый справочник разработчика (сборка, правила ≤200/≤4, пакеты, модули/HUD/команды/миксины/рендер/тесты). Объединён из DEV_GUIDE.md+DEVELOPMENT.md 2026-09-23.
  • api/addons.md — API аддонов (lovisual:addon, жизненный цикл, что может аддон). Публичный API можно ломать свободно при рефакторинге (KISS > совместимость).
  • TODO.md в корне — план фаз (сейчас 8.5/9.1/9.2/10/11).