{vulkan,examples}: fix descriptor set bug

This commit is contained in:
Ali Cheraghi 2024-07-13 05:42:16 +03:30 committed by Stephen Gutekanst
parent 266e7a548b
commit 0023ab14fb
6 changed files with 45 additions and 48 deletions

View file

@ -106,6 +106,8 @@ fn update(core: *mach.Core.Mod, game: *Mod) !void {
defer command.release();
core.state().queue.submit(&[_]*gpu.CommandBuffer{command});
core.schedule(.present_frame);
// update the window title every second
if (game.state().title_timer.read() >= 1.0) {
game.state().title_timer.reset();

View file

@ -104,6 +104,8 @@ fn update(core: *mach.Core.Mod, game: *Mod) !void {
defer command.release();
core.state().queue.submit(&[_]*gpu.CommandBuffer{command});
core.schedule(.present_frame);
// update the window title every second
if (game.state().title_timer.read() >= 1.0) {
game.state().title_timer.reset();

View file

@ -110,9 +110,7 @@ fn init(
});
}
fn deinit(
renderer: *Mod,
) !void {
fn deinit(renderer: *Mod) !void {
renderer.state().pipeline.release();
for (renderer.state().bind_groups) |bind_group| bind_group.release();
renderer.state().uniform_buffer.release();
@ -178,4 +176,6 @@ fn renderFrame(
var command = encoder.finish(&.{ .label = label });
defer command.release();
core.state().queue.submit(&[_]*gpu.CommandBuffer{command});
core.schedule(.present_frame);
}

View file

@ -69,9 +69,8 @@ fn afterInit(audio: *mach.Audio.Mod, app: *Mod) void {
audio.state().on_state_change = app.system(.audio_state_change);
}
fn deinit(core: *mach.Core.Mod, audio: *mach.Audio.Mod) void {
fn deinit(audio: *mach.Audio.Mod) void {
audio.schedule(.deinit);
core.schedule(.deinit);
}
fn audioStateChange(