wip: uncommitted work gathered before the branch is merged into main

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-30 17:18:48 +03:00
parent cc384efee0
commit 737d6e1859
30 changed files with 307 additions and 120 deletions

View file

@ -189,6 +189,9 @@ export state Render3dState {
gvk_pool: long = 0
gvk_fence: bytes = null
gvk_frame_fence: bytes = null # the presented frame still on the GPU (one frame in flight)
gvk_tmp_buf: pointer = null # the per-call scratch ring (gvk_tmp)
gvk_tmp_off: int = 0
gvk_seen: words = null # gvk_draw's vertex buffers already bound, reused
gvk_frame_pending: bool = false
gvk_frame_pending_cb: pointer = null
gvk_frame_pending_no: int = -1 # which frame it is (gvk_frame_no when it was submitted)
@ -197,6 +200,20 @@ export state Render3dState {
gvk_retired_frame: []int = null # the last frame that read each retired buffer
gvk_labels: bool = false # R3D_VK_LABELS: each profiled pass is a debug label (Metal System Trace)
gvk_inflight: int = -1
gvk_nopool: bool = false
# R3D_VK_PROF: Vulkan objects made and destroyed, reported every 120 frames
gvk_mk_img: int = 0
gvk_mk_view: int = 0
gvk_mk_buf: int = 0
gvk_mk_mem: int = 0
gvk_mk_smp: int = 0
gvk_mk_set: int = 0
gvk_mk_cmd: int = 0
gvk_mk_dpool: int = 0
gvk_mk_x_img: int = 0
gvk_mk_x_view: int = 0
gvk_mk_x_buf: int = 0
gvk_mk_x_mem: int = 0
gvk_label_depth: int = 0 # -1 until asked: 1 leaves the presented frame in flight
gvk_has_hqr: bool = false
gvk_ts_period: float = 0.0 # float bits: nanoseconds per timestamp tick
@ -269,8 +286,9 @@ export state Render3dState {
gvk_screen_depth: int = 0
gvk_screen_w: int = 0
gvk_screen_h: int = 0
gvk_layer_views: []string = null # "tex:layer" -> index into gvk_layer_view
gvk_layer_views: []int = null # generation * 4096 + layer, beside gvk_layer_view_tex
gvk_layer_view: []long = null
gvk_layer_view_tex: []int = null # the texture each cached view is of, so a release drops them
gvk_fb_ncolor: words = null # per framebuffer: colour slots drawn (draw buffers; 0 = none)
gvk_hdr_want: bool = false # r3d_hdr: the setting
gvk_hdr_on: bool = false # the swapchain is HDR10 now
@ -377,6 +395,11 @@ export state Render3dState {
gg_mesh: []Mesh = null
gg_n: int = 0
gg_max: int = 0
gg_rb: words = null # the per-frame dispatch arguments, made once (grass_gpu.ludic)
gg_cb: words = null
gg_bufs: words = null
gg_texs: words = null
gg_pr: words = null
grass_band_mesh: []Mesh = null # per band: the blade it draws (rows fall with distance)
grass_mesh3: Mesh = null # three rows: the middle distance
grass_mesh2: Mesh = null # two rows, one quad: far enough that the arch is under a pixel