render3d: @owns on the handles records hold
Target's framebuffer and its colour and depth textures, a Mesh's index buffer (gvk_buf_new / gvk_buf_delete now @creates / @releases GpuBuffer too), a Prim's mesh and an Actor's own skin clone. ludic deps --resources over main: resource_drops 0, owned_leaks 0; a probe freeing a Target's fbo alone was reported for its colour and depth (2), then removed. Compiled (steady). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f16ac4ef9e
commit
bc50bd9b9a
5 changed files with 8 additions and 6 deletions
|
|
@ -33,7 +33,7 @@ property Actor {
|
|||
row: int = -1, # where it stands in ac_actors, so it leaves in O(1); -1 off the stage
|
||||
cutout: bool = false, # alpha-tested (a flame's cards)
|
||||
emissive: float = 0.0, # float bits: self-lit strength
|
||||
skin: Skin, # this instance's own pose (skin_clone); null: the model's
|
||||
@owns(SkinClone) skin: Skin, # this instance's own pose (skin_clone); null: the model's
|
||||
skin_owned: bool = false, # made by actor_own_skin: actor_release frees it
|
||||
ptint: words, # 4 per primitive: on flag, r, g, b (a part's own colour)
|
||||
hide: words, # 1 per primitive: skip it (a cap taken off)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
# ============================================================================
|
||||
|
||||
property Prim {
|
||||
mesh: Mesh,
|
||||
@owns(Mesh) mesh: Mesh,
|
||||
diff: int = 0,
|
||||
nrm: int = 0,
|
||||
arm: int = 0,
|
||||
|
|
|
|||
|
|
@ -634,6 +634,7 @@ function gvk_sampler(render3d_st: mut Render3dState, min_f: int, mag_f: int, wra
|
|||
# destroyed at gvk_retire_flush, after the frame's work is done.
|
||||
|
||||
@alloc_ok("loading a model, a texture or a font: a load, not a frame (a guest loading a teammate's look is one)")
|
||||
@creates(GpuBuffer)
|
||||
function gvk_buf_new(render3d_st: mut Render3dState) -> int {
|
||||
let zero: long = 0
|
||||
if render3d_st.gvk_buf == null {
|
||||
|
|
@ -655,6 +656,7 @@ function gvk_buf_new(render3d_st: mut Render3dState) -> int {
|
|||
|
||||
# a buffer done with for good (a mesh freed): its storage goes, and its handle is handed out again
|
||||
# by gvk_buf_new. gvk_buf_release alone keeps the handle, for a caller that fills it again.
|
||||
@releases(GpuBuffer)
|
||||
function gvk_buf_delete(render3d_st: mut Render3dState, b: int) -> void {
|
||||
if b <= 0 or b >= len(render3d_st.gvk_buf) { return }
|
||||
gvk_buf_release(render3d_st, b)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
property Mesh {
|
||||
vao: int = 0, # OpenGL's vertex array object (gpu.ludic's, on that backend)
|
||||
vbo: int = 0, # the first vertex buffer
|
||||
ebo: int = 0,
|
||||
@owns(GpuBuffer) ebo: int = 0,
|
||||
count: int = 0, # indices (ebo != 0) or vertices
|
||||
mode: int = 4, # GL_TRIANGLES
|
||||
itype: int = 0x1405, # GL_UNSIGNED_INT
|
||||
|
|
|
|||
|
|
@ -64,9 +64,9 @@ function r3d_bind_2d(render3d_st: mut Render3dState, prog: int, name: string, un
|
|||
|
||||
# A framebuffer with one colour texture (and optionally a depth texture).
|
||||
property Target {
|
||||
fbo: int = 0,
|
||||
color: int = 0,
|
||||
depth: int = 0,
|
||||
@owns(GpuFramebuffer) fbo: int = 0,
|
||||
@owns(GpuTexture) color: int = 0,
|
||||
@owns(GpuTexture) depth: int = 0,
|
||||
w: int = 0,
|
||||
h: int = 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue