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>
This commit is contained in:
parent
f1049953c4
commit
1447304dd7
6 changed files with 40 additions and 0 deletions
|
|
@ -608,6 +608,10 @@ function gpu_tex_free(render3d_st: mut Render3dState, tex: int) -> void {
|
|||
# a texture on a unit for a program's sampler, by the sampler's name
|
||||
function gpu_bind_sampler(render3d_st: mut Render3dState, prog: int, name: string, unit: int, kind: int, tex: int) -> void {
|
||||
gvk_bind_texture(render3d_st, prog, name, tex)
|
||||
# as OpenGL's did, binding a texture for a sampler makes it the one a following gpu_tex_param or
|
||||
# gpu_tex_mips acts on: render3d was written that way, and without it they reached whatever was
|
||||
# bound last (a BC7 kit texture, which a mip blit then drew into)
|
||||
if kind == GPU_TEX2D_ARRAY { render3d_st.gpu_bound_array = tex } else { render3d_st.gpu_bound_2d = tex }
|
||||
}
|
||||
|
||||
# ---- render targets and passes -------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue