ludic/changes/render3d-bc-not-a-target.md
Orkuncakilkaya 1447304dd7 fix(render3d): nothing draws into a BC7 texture - sampler binding binds, and compressed images get no mips
Metal aborted a net.sh guest ("MTLPixelFormatBC7_RGBAUnorm is not color renderable"): the crash
report's main thread was in vkQueueSubmit from gvk_once_end, MoltenVK encoding a vkCmdBlitImage
through a render pipeline. water.ludic bound its reflection by sampler name and then asked the
BOUND texture for mips - on Vulkan the bound texture was not the reflection but the last one
bound, since 23.3 a BC7 kit texture. gpu_bind_sampler now makes its texture the bound one, as
OpenGL did (and water binds it explicitly); gvk_tex_mips and gvk_mips_now skip compressed images;
gvk_pass_begin leaves out a compressed colour attachment and says so.

tests/net.sh passes (main e515bd87 built against it; host and guest agree on 196 animals, the
people, the board and the lost hiker).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 10:34:23 +03:00

9 lines
697 B
Markdown

bump: patch
type: fix
**A compressed texture is never drawn into.** On Vulkan, binding a texture to a sampler by name
did not make it the bound texture, as it did on OpenGL, so a following `gpu_tex_param` or
`gpu_tex_mips` acted on whatever was bound last. The water's reflection asked for its mip chain
that way and, once kit textures came as BC7 (23.3), built one into a kit texture: MoltenVK blits
through a render pass, and Metal aborted ("BC7 is not color renderable"). Binding for a sampler
now binds, as OpenGL's did; mip generation leaves a compressed texture alone (its levels came with
it); and a pass that would have a compressed image as a colour attachment leaves it out and says so.