This commit is contained in:
2026-01-06 20:30:03 -06:00
parent c653181a3d
commit 3481993cc4
3 changed files with 13 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.glb

View File

@@ -377,7 +377,7 @@ function sample_pose(model, name, time_val) {
// Find animation by name or index
var anim_idx = -1
if (typeof name == "number") {
if (is_number(name)) {
anim_idx = name
} else {
for (var i = 0; i < internal.animations.length; i++) {

12
sdl.cm
View File

@@ -320,7 +320,17 @@ function submit_frame(draws, clear_color, clear_depth, style_id) {
}
}
var swap_pass = cmd.swapchain_pass(_window, pass_desc)
var swap_tex = cmd.acquire_swapchain_texture(_window)
if (!swap_tex) {
if (cmd.cancel) cmd.cancel() // Cancel if possible, or just submit empty?
// If we can't acquire, we probably shouldn't submit half-baked command buffer.
// But cmd is acquired.
// Just return.
return { draw_calls: 0, triangles: 0 }
}
pass_desc.color_targets[0].texture = swap_tex
var swap_pass = cmd.render_pass(pass_desc)
// Sort draws: opaque first, then cutoff, then blend
draws.sort(function(a, b) {