render3d: scratch the frame uses is made with the state, not on first use
Render3dState's cam_planes, gpu_u_tmp, q_scratch, ov_nine_buf, the caster test's four points, ter_bw, ter_scr and water_saved default to their buffers (as ludic.anim's clip state does), so the lazy starts in cam_planes_update, gpu_tmp, terrain_height_smooth, ter_scratch, the water pass and gvk_startup_state go. q_euler makes its views of q_scratch once (guarded on the view now). Compiled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
cd71da9330
commit
deb7c0d0c0
7 changed files with 13 additions and 22 deletions
|
|
@ -19,10 +19,10 @@ export state Render3dState {
|
|||
ac_oq_n: int = 0 # live entries; the array is kept and reused
|
||||
ac_oq_closed: bool = true
|
||||
ac_census_at: int = -2
|
||||
ac_lp0: floats = null
|
||||
ac_lpx: floats = null
|
||||
ac_lpy: floats = null
|
||||
ac_lpz: floats = null
|
||||
ac_lp0: floats = floats(3)
|
||||
ac_lpx: floats = floats(3)
|
||||
ac_lpy: floats = floats(3)
|
||||
ac_lpz: floats = floats(3)
|
||||
ac_cc_actors: int = 0
|
||||
ac_cc_draws: int = 0
|
||||
ac_cc_skinned: int = 0
|
||||
|
|
@ -43,7 +43,7 @@ export state Render3dState {
|
|||
cam_inv_vp_clean: floats = null
|
||||
cam_fwd: floats = null
|
||||
cam_right: floats = null
|
||||
cam_planes: floats = null
|
||||
cam_planes: floats = floats(16)
|
||||
day_on: bool = false
|
||||
day_hours: float = 0.0 # float bits, 0 .. 24
|
||||
day_light: float = 0.0 # 0 night .. 1 full day (float bits)
|
||||
|
|
@ -134,7 +134,7 @@ export state Render3dState {
|
|||
gpu_prog_ids: []int = null
|
||||
gpu_prog_keys: []string = null
|
||||
gpu_prog_cur: int = 0
|
||||
gpu_u_tmp: words = null
|
||||
gpu_u_tmp: words = words(4)
|
||||
gpu_cap_probed: bool = false
|
||||
gpu_cap_windows: bool = false # the advanced features exist on this platform at all
|
||||
gpu_cap_vulkan: bool = false # a Vulkan loader, an instance and a device
|
||||
|
|
@ -567,7 +567,7 @@ export state Render3dState {
|
|||
r3d_assets: string = "assets/polyhaven" # where the CC0 assets live
|
||||
r3d_root_found: bool = false
|
||||
r3d_prog_log: int = -1
|
||||
q_scratch: floats = null
|
||||
q_scratch: floats = floats(16)
|
||||
q_sy: floats = null # views of q_scratch's second, third and fourth
|
||||
q_sz: floats = null
|
||||
q_st: floats = null
|
||||
|
|
@ -692,7 +692,7 @@ export state Render3dState {
|
|||
stream_debug_n: int = 0
|
||||
stream_scratch: floats = null
|
||||
gvk_pipe_bufs: words = null # a pipeline's vertex buffers, while it is made
|
||||
ov_nine_buf: floats = null # ov_nine's corners and uvs
|
||||
ov_nine_buf: floats = floats(16) # ov_nine's corners and uvs
|
||||
gvk_ac: pointer = null # the VkAllocationCallbacks every create and destroy is given (R3D_ALLOC_VK=1)
|
||||
gvk_prime_b: words = null # buffers made since the frame began, read once so MoltenVK makes their
|
||||
gvk_prime_h: []long = null # Metal buffers now (gvk_prime), and their handles
|
||||
|
|
@ -807,10 +807,10 @@ export state Render3dState {
|
|||
ter_ortho_c: int = 3
|
||||
ter_h_scale: float = 0.0
|
||||
ter_o_scale: float = 0.0
|
||||
ter_bw: floats = null
|
||||
ter_bw: floats = floats(8)
|
||||
ter_wire: bool = false
|
||||
ter_printed: bool = false
|
||||
ter_scr: floats = null
|
||||
ter_scr: floats = floats(16)
|
||||
tex_w: int = 0 # the last decoded image
|
||||
tex_h: int = 0
|
||||
tex_channels: int = 0
|
||||
|
|
@ -837,7 +837,7 @@ export state Render3dState {
|
|||
water_on: bool = false
|
||||
water_refl: Target = null # the world mirrored in the surface, half resolution
|
||||
water_refl_div: int = 2 # R3D_REFLDIV overrides: 2 = half res, 4 = quarter
|
||||
water_saved: floats = null # the real camera's matrices, restored after the pass
|
||||
water_saved: floats = floats(16 * 4 + 3) # the real camera's matrices, restored after the pass
|
||||
water_saved_vp: floats = null # views of its second and third matrices
|
||||
water_saved_ivp: floats = null
|
||||
water_dumped: bool = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue