Build: Move tool snap grid not drawn on Vulkan #148

Open
opened 2026-09-29 00:34:48 +00:00 by backspace119 · 0 comments
Owner

In build mode, the Move tool's snap grid (the ruled grid shown while dragging with snap) doesn't render on Vulkan. Needs an in-world check to confirm, but the code path can't work.

Why

  • LLManipTranslate::restoreGL() (llmaniptranslate.cpp ~163) returns early under Vulkan, so sGridTex is never created. It built a 512x512 mip chain with raw GL uploads (bindManual + setManualImage), which crashed at world entry, so it was skipped.
  • renderSnapGuides binds the grid by raw GL name: bindManual(TT_TEXTURE, getGridTexName()). Under Vulkan bindManual is a no-op (a GL name resolves to nothing; see #144 for the same bug in the image upload preview). The grid is drawn untextured or not at all.

Fix

  1. Build the grid texture from an LLImageRaw (white RGB, alpha = the grid lines, one image per mip level or let the backend generate mips) and create it with LLViewerTextureManager::getLocalTexture(raw, true) so the Vulkan UI backend can upload it.
  2. Bind it with gGL.getTexUnit(0)->bind(sGridTex) instead of bindManual(..., getGridTexName()).
  3. Check the blend modes it uses (BF_ZERO, BF_ONE_MINUS_SOURCE_ALPHA for the behind-objects pass, then alpha) and the GL_GREATER depth test for the "behind objects" layer work in the VK world-overlay pass.

Related: #144 (same bindManual cause), #29-era builder view parity (#101 Highlight Transparent is done).

In build mode, the Move tool's snap grid (the ruled grid shown while dragging with snap) doesn't render on Vulkan. Needs an in-world check to confirm, but the code path can't work. ## Why - `LLManipTranslate::restoreGL()` (`llmaniptranslate.cpp` ~163) returns early under Vulkan, so `sGridTex` is never created. It built a 512x512 mip chain with raw GL uploads (`bindManual` + `setManualImage`), which crashed at world entry, so it was skipped. - `renderSnapGuides` binds the grid by raw GL name: `bindManual(TT_TEXTURE, getGridTexName())`. Under Vulkan `bindManual` is a no-op (a GL name resolves to nothing; see #144 for the same bug in the image upload preview). The grid is drawn untextured or not at all. ## Fix 1. Build the grid texture from an `LLImageRaw` (white RGB, alpha = the grid lines, one image per mip level or let the backend generate mips) and create it with `LLViewerTextureManager::getLocalTexture(raw, true)` so the Vulkan UI backend can upload it. 2. Bind it with `gGL.getTexUnit(0)->bind(sGridTex)` instead of `bindManual(..., getGridTexName())`. 3. Check the blend modes it uses (`BF_ZERO, BF_ONE_MINUS_SOURCE_ALPHA` for the behind-objects pass, then alpha) and the `GL_GREATER` depth test for the "behind objects" layer work in the VK world-overlay pass. Related: #144 (same `bindManual` cause), #29-era builder view parity (#101 Highlight Transparent is done).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
backspace119/Slipstream#148
No description provided.