#10486·wgpu

GL backend: desktop GL cube sampling is not seamless (GL_TEXTURE_CUBE_MAP_SEAMLESS is never enabled)

Author: shtse8Created Sep 28, 2026Updated Sep 28, 2026

Summary. On a desktop GL context the GL backend samples cube textures without seamless face filtering: a linear filter near a face edge clamps inside the face instead of blending across it, so cube maps show the classic seams. Vulkan, Metal, D3D12 and ES 3 / WebGL 2 are seamless by specification, so the difference only shows on the desktop GL path.

Why. Seamless cube filtering in desktop GL is off by default and has to be turned on with glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS) (GL 3.2 / ARB_seamless_cube_map). Searching wgpu-hal 30.0.0 for seamless returns no occurrences, so the backend never enables it. glow 0.17 exposes the constant (glow::TEXTURE_CUBE_MAP_SEAMLESS, 0x884F).

How I hit it. An IBL prefilter: a GGX-weighted convolution of a source cube into a smaller prefiltered cube, reading rough mips. Comparing the same compute pass against a CPU reference that blends across faces:

  • mirror mip: max abs error 0.000000 (unchanged)
  • interior texels of a face: max abs error 0.009124 (at a small face size a rough lobe spans a whole face, so an interior texel reaches the source's seams too)
  • texels on a face's one-texel border: max abs error 0.036546 (channel delta 10 of 255)
  • seam divergence (12 edge-midpoint probes): 0.142578

Deterministic across runs; the same pass on Vulkan (lavapipe, through the same wgpu version) is within 0.003031 of that reference on every texel, and the mirror level is exact on both. Environment: desktop GL 4.5 core profile (Mesa 22.3.6, llvmpipe) through wgpu-hal 30.0.0's GL backend.

Suggestion. Enable GL_TEXTURE_CUBE_MAP_SEAMLESS when the context supports it. That matches what ES 3 and WebGL 2 do unconditionally, and what other libraries chose for desktop GL by default (libGDX enables it on desktop backends, describing it as effectively a bug fix in GL). If you would rather keep the current sampling reachable, an adapter capability or a feature flag would let a caller opt in.

I searched the tracker for an existing report of this and found none (the closest is #1746, cube map arrays, closed).