render3d: to its floor - messages in declared helpers, post and DLSS set up at start, lists sized
Seventeen inline messages (allocation failures, missing conversions, the no-pipeline and compressed- target warnings, resize and swapchain lines, the test-frame camera line, DLSS evaluate, shadow memory, stream and terrain debug, the water test) are each a function of their own under @alloc_ok, taking numbers, so the paths that say them hold no site. post_measure's two 1x1 exposure targets are made in post_init and DLSS's evaluate structs in gsl_init; DLSS's camera up is a state field. The lists play pushes into (retired, free ranges, spare ids, the per-buffer gpu flags, the stage and the actor spares) get their room at start-up (gvk_room_*, actor_room), so a push fits. Compiled (steady). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
629579123a
commit
958a262ba1
12 changed files with 120 additions and 26 deletions
|
|
@ -57,6 +57,12 @@ function post_set_msaa(render3d_st: mut Render3dState, n: int) -> void {
|
|||
@alloc_ok("a world being set up (a stream, a layer, water, post, a bake): the map loading or swapping, not a frame")
|
||||
function post_init(render3d_st: mut Render3dState, w: int, h: int) -> void {
|
||||
render3d_st.post_w = w; render3d_st.post_h = h
|
||||
# the exposure's two 1x1 targets: made once, here, rather than by the first frame that measured
|
||||
if render3d_st.post_adapt_t == null {
|
||||
render3d_st.post_adapt_t = new []Target
|
||||
for k in 0 .. 2 { push(render3d_st.post_adapt_t, target_new(render3d_st, 1, 1, GL_R32F, GL_RED, GL_FLOAT, false, GL_NEAREST)) }
|
||||
render3d_st.post_adapt_reset = true
|
||||
}
|
||||
render3d_st.post_hdr = target_new(render3d_st, w, h, GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT, true, GL_LINEAR)
|
||||
if render3d_st.post_ms_samples > 1 {
|
||||
render3d_st.post_ms_fbo = gpu_fb_new(render3d_st)
|
||||
|
|
@ -134,11 +140,6 @@ function post_measure(render3d_st: mut Render3dState) -> void {
|
|||
gpu_tex_bind(render3d_st, GPU_TEX2D, render3d_st.post_hdr.color)
|
||||
gpu_tex_param(render3d_st, GPU_TEX2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR)
|
||||
gpu_tex_mips(render3d_st, GPU_TEX2D)
|
||||
if render3d_st.post_adapt_t == null {
|
||||
render3d_st.post_adapt_t = new []Target
|
||||
for k in 0 .. 2 { push(render3d_st.post_adapt_t, target_new(render3d_st, 1, 1, GL_R32F, GL_RED, GL_FLOAT, false, GL_NEAREST)) }
|
||||
render3d_st.post_adapt_reset = true
|
||||
}
|
||||
if render3d_st.post_p_adapt == 0 { render3d_st.post_p_adapt = r3d_program(render3d_st, "fullscreen.vert", "adapt.frag", "") }
|
||||
let next = 1 - render3d_st.post_adapt_i
|
||||
target_bind(render3d_st, render3d_st.post_adapt_t[next])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue