Merge r3d/cb-cap into main (gathering every branch; main's side kept on conflicts)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-30 17:21:21 +03:00
commit 5370507859
2 changed files with 9 additions and 0 deletions

View file

@ -1345,6 +1345,13 @@ function gvk_set_view(render3d_st: mut Render3dState, cb: pointer) -> void {
# first / count select vertices or indices; count 0 means the mesh's own count. instances >= 1.
function gvk_draw(render3d_st: mut Render3dState, p: int, m: Mesh, st: GvkState, first: int, count: int, instances: int, tx: words, tx_w: int, tx_cap: int, rec: words, rec_o: int) -> void {
if render3d_st.gvk_prog_var == null or p <= 0 or p >= len(render3d_st.gvk_prog_var) or render3d_st.gvk_prog_var[p] == null { return }
if render3d_st.gvk_cb_cap < 0 {
render3d_st.gvk_cb_cap = 0
if r3d_env_has(render3d_st, "R3D_CB_DRAWS") { render3d_st.gvk_cb_cap = Text.to_int(r3d_env(render3d_st, "R3D_CB_DRAWS")) }
}
if render3d_st.gvk_cb_cap > 0 and render3d_st.gvk_cb_draws >= render3d_st.gvk_cb_cap { gvk_flush(render3d_st) }
if render3d_st.gvk_cb == null { render3d_st.gvk_cb_draws = 0 }
render3d_st.gvk_cb_draws += 1
let prof = gvk_prof(render3d_st)
var t0: long = 0
if prof { t0 = gl_now_us() }