render3d/water: the saved camera's two views made once, not with each reflection target
water_reflection_pass made view(water_saved, 16, 16) and view(water_saved, 32, 16) inside the block that makes the reflection target, so every time the target was made again (a resize, a render scale, a settings change) two more 16-byte views were made and the last two dropped: the windowed walk's fence caught one such frame, +32 B. water_saved is the state's for good, so its views are made once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
afc2d019a3
commit
3816d9924b
1 changed files with 4 additions and 0 deletions
|
|
@ -25,6 +25,10 @@ function water_reflection_pass(render3d_st: mut Render3dState) -> void {
|
|||
# this reflection is composited into is smaller than the drawable, and a reflection
|
||||
# rendered at the window's size would be paying for pixels the water never samples
|
||||
render3d_st.water_refl = target_new(render3d_st, render3d_st.post_w / render3d_st.water_refl_div, render3d_st.post_h / render3d_st.water_refl_div, GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT, true, GL_LINEAR)
|
||||
}
|
||||
# views of the saved matrices, made once: water_saved is the state's for good, and a target
|
||||
# made again (a resize, a render scale) made two more a time
|
||||
if render3d_st.water_saved_vp == null {
|
||||
render3d_st.water_saved_vp = view(render3d_st.water_saved, 16, 16)
|
||||
render3d_st.water_saved_ivp = view(render3d_st.water_saved, 32, 16)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue