Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Function applyElementTextureWidthDefine

    • Re-stamp a material's width define from the texture actually being bound. The addressing authority is the BOUND texture's own width, never the global session value (same rationale as the row math in element-storage.ts: a renderer swap can reconfigure the session width while an existing texture keeps its allocated width). The constructor pre-stamps the session width so the common first bind — a pool texture allocated at that same width — changes nothing and never recompiles; this only triggers a program rebuild (cached by define set) when a genuinely different-width texture binds (harness fixtures, post-swap stragglers).

      The placeholder binding is exempt: its draws are empty (instanceCount 0 until the first commit), so restamping for its 12-texel width would only force a pointless recompile round-trip.

      Parameters

      • material: { defines?: Record<string, unknown>; needsUpdate: boolean }
      • layout: ElementTextureLayout
      • texture: Texture<unknown, TextureEventMap> | null

      Returns void