refactor(mod): dispatch RenderBackendOps.current() by active backend (Stage 4 kickoff)

Stage 4 Vulkan groundwork. Before this, RenderBackendOps.current() unconditionally
returned GlRenderBackendOps.INSTANCE with a 'Stage 3-prep' comment. Under Vulkan
the GL impl is still harmless (its methods all short-circuit on OptimizeToggles
and the GL mixins never fire), but the interface lied about the active backend.

- New misc/optimize/vulkan/VulkanRenderBackendOps: singleton, no-op stub, all
  *Supported() return false, cache/map methods do nothing. This is the skeleton
  the Stage 4 items (persistent VkPipelineCache, VulkanRenderPass state cache)
  will grow into.
- RenderBackendOps.current() inspects RenderSystem.getDevice().getClass().getName()
  and returns VulkanRenderBackendOps for com.mojang.blaze3d.vulkan.* devices,
  GlRenderBackendOps otherwise. Class-name check (not instanceof) so this method
  itself does not force linking of GlDevice/VulkanDevice.
- Wrapped getDevice() in try/catch: unit tests call current() before RenderSystem
  has a device and previously took the GL path; now they still do via the fallback.

Doc: Stage 4 kickoff entry in the changelog.
This commit is contained in:
loki5512344 2026-10-12 22:10:10 +02:00
parent 39b270b108
commit d5f17eb0ac
Signed by: boba
GPG key ID: 253067914055423B
3 changed files with 129 additions and 1 deletions

View file

@ -3,6 +3,12 @@
Статус: Этапы 1-3 готовы (2026-10-12). Этап 4 (Vulkan) — стартуем с универсально-полезных пунктов. Цель MC: 26.2.
## История изменений
- **2026-10-12**: Этап 4 старт — `RenderBackendOps.current()` теперь определяет активный бэкенд через
`RenderSystem.getDevice().getClass().getName()` (class-name, не `instanceof`, чтобы не форсировать линковку
`GlDevice`/`VulkanDevice`); добавлен `misc/optimize/vulkan/VulkanRenderBackendOps` — no-op-заглушка со
всеми `*Supported() == false`. Под GL всё работает как раньше; под Vulkan mixins из `mixins/optimize/gl/*` не
загружаются, и теперь хотя бы интерфейс честно возвращает правильный бэкенд. Живые Vulkan-пути
(`VkPipelineCache`, state cache) — следующий шаг.
- **2026-10-12**: убран гейт «меряем на Windows до включения». Бенчмарки больше не блокируют работу: универсально-полезные
GL/Vulkan-оптимизации делаем сразу за default-off тумблерами (пользователь включает сам), отчёт цифр остаётся как
факультативная задача владельца и не входит в план. Этап 3 закрыт по всем пунктам, кроме п.9 (`no_item_sort` /