gfx: TextPipeline: fix ref counting
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
a065c79200
commit
329fe251ef
1 changed files with 1 additions and 14 deletions
|
|
@ -130,17 +130,6 @@ pub const BuiltPipeline = struct {
|
||||||
colors: *gpu.Buffer,
|
colors: *gpu.Buffer,
|
||||||
glyphs: *gpu.Buffer,
|
glyphs: *gpu.Buffer,
|
||||||
|
|
||||||
pub fn reference(p: *BuiltPipeline) void {
|
|
||||||
p.render.reference();
|
|
||||||
p.texture_sampler.reference();
|
|
||||||
p.texture.reference();
|
|
||||||
p.bind_group.reference();
|
|
||||||
p.uniforms.reference();
|
|
||||||
p.transforms.reference();
|
|
||||||
p.colors.reference();
|
|
||||||
p.glyphs.reference();
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn deinit(p: *BuiltPipeline, allocator: std.mem.Allocator) void {
|
pub fn deinit(p: *BuiltPipeline, allocator: std.mem.Allocator) void {
|
||||||
p.render.release();
|
p.render.release();
|
||||||
p.texture_sampler.release();
|
p.texture_sampler.release();
|
||||||
|
|
@ -287,7 +276,6 @@ fn buildPipeline(
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
defer bind_group.release();
|
|
||||||
|
|
||||||
const blend_state = opt_blend_state orelse gpu.BlendState{
|
const blend_state = opt_blend_state orelse gpu.BlendState{
|
||||||
.color = .{
|
.color = .{
|
||||||
|
|
@ -332,7 +320,7 @@ fn buildPipeline(
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
var built = BuiltPipeline{
|
const built = BuiltPipeline{
|
||||||
.render = render_pipeline,
|
.render = render_pipeline,
|
||||||
.texture_sampler = texture_sampler,
|
.texture_sampler = texture_sampler,
|
||||||
.texture = texture,
|
.texture = texture,
|
||||||
|
|
@ -343,7 +331,6 @@ fn buildPipeline(
|
||||||
.glyphs = glyphs,
|
.glyphs = glyphs,
|
||||||
.texture_atlas = texture_atlas,
|
.texture_atlas = texture_atlas,
|
||||||
};
|
};
|
||||||
built.reference();
|
|
||||||
try text_pipeline.set(pipeline_id, .built, built);
|
try text_pipeline.set(pipeline_id, .built, built);
|
||||||
try text_pipeline.set(pipeline_id, .num_texts, 0);
|
try text_pipeline.set(pipeline_id, .num_texts, 0);
|
||||||
try text_pipeline.set(pipeline_id, .num_glyphs, 0);
|
try text_pipeline.set(pipeline_id, .num_glyphs, 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue