Documentation
    Preparing search index...

    Function createTextureBindGroupLayout

    • The texture/sampler bind-group layout (§77, WP-R1.2).

      They are one group because they are one decision — "sample this image this way" — and because a bind group is the unit of binding: splitting them would double the per-draw setBindGroup traffic for a pair that never varies independently.

      They are a second group rather than two more bindings on group 0 because group 0 is per draw and rebound at a dynamic offset for every object in the frame, while this one is per texture and shared by every draw that samples the same image. Merging them would mean one bind group per (draw × texture) instead of one per texture, allocated inside the frame — the cost the dynamic-offset design exists to avoid.

      Both entries are FRAGMENT alone. The vertex stage carries the uv through as a varying and never samples, so declaring vertex visibility would ask the implementation to reserve a vertex-stage texture slot for a resource no vertex shader in this package reads (§62's per-stage binding limits are where that shows up).

      sampleType: "float" and type: "filtering" are the pair that makes textureSample legal: an unfilterable-float texture may only be sampled with a non-filtering sampler, which is the trap a depth or float target walks into (R-18's shadow map, WP-R1.6's targets) — those tiers declare their own layout rather than widen this one.

      The same layout object is reused as the mip-generation blit's group 0 (wgpu-texture.ts): a blit binds exactly a texture and a sampler, so declaring a second identical layout would be two objects for one shape.

      Parameters

      Returns object