GBufferBinding

A G-buffer's sampled textures together with the generation they were read at — §WFR-RC-3.

Declared in src/libs/libconstruct/construct/rendering/GBufferSource.hpp.

Detailed description

The four texture pointers alone are **not** a safe thing to hold. SDFLayer releases and recreates its G-buffer on scene-load teardown, antialias changes, adaptive render-scale retargets and — the one that produced the shipped crash — a megashader rebuild when a primitive of a new type joins the scene. A recreated texture can land at its destroyed predecessor's address, so a pointer compare reports "unchanged" while pointing at freed memory, and the next `setShaderResources` faults inside `vkUpdateDescriptorSets`.

`SDFLayer.hpp` states the rule: a dependent that caches over these textures keys on the **generation**, never on the pointer. That rule was stated and then honoured by exactly one consumer, because nothing made the generation travel with the pointers — every other site called `gBufferDepthTexture()` and got a bare pointer with no way to tell how old it was.

This type exists so the two cannot be separated: there is no accessor that yields the textures without the generation, and `isUsable()` is the only sanctioned way to ask whether they may be bound this frame.

See §WFR-RL-26.

See also IGBufferSource.

In this section