fix(render3d): the chunked grass draws its blades on Vulkan again

grass_flush uploaded u_tiles (vec4[256]) with u_fv(4n floats). On Vulkan an
array element is copied at the size given and placed at the array's stride,
so each tile got one float: nonsense corners and zero blades a cell. The
meadow had no grass on the Vulkan renderer since cdfffa6 while the draw
counts looked right. u_f4v uploads n vec4s; OpenGL was never affected.

PC camp: chunked path matches R3D_GRASS_TILES=1, validation 0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-15 19:40:23 +03:00
parent ac539b0150
commit 762a74624c
2 changed files with 5 additions and 1 deletions

View file

@ -215,7 +215,7 @@ function grass_flush() -> void {
var m = e - k
if m > GRASS_CHUNK { m = GRASS_CHUNK }
for q in 0 .. m * 4 { grass_chunk_tv[q] = grass_tv[k * 4 + q] }
u_fv(gpu_uniform(p, "u_tiles"), m * 4, grass_chunk_tv)
u_f4v(gpu_uniform(p, "u_tiles"), m, grass_chunk_tv)
gpu_draw_mesh_indirect(grass_mesh, grass_cmds, k * 20, m, 0, 0)
grass_draws += 1
k += m