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:
commit
5370507859
2 changed files with 9 additions and 0 deletions
|
|
@ -360,6 +360,8 @@ export state Render3dState {
|
|||
gvk_us_set: long = 0
|
||||
gvk_us_draw: long = 0
|
||||
gvk_n_draws: int = 0
|
||||
gvk_cb_draws: int = 0 # draws recorded into the frame's command buffer so far
|
||||
gvk_cb_cap: int = -1 # a command buffer is submitted after this many (0 = never; -1 unread)
|
||||
gvk_n_asked: int = 0 # draws that reached gvk_draw_now: every one the renderer asked for
|
||||
gvk_n_flush: int = 0
|
||||
gvk_prof_frames: int = 0
|
||||
|
|
|
|||
|
|
@ -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() }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue