Make metal work

This commit is contained in:
luboslenco
2025-04-24 22:19:44 +02:00
parent fff6ced18f
commit bf2dda291d
85 changed files with 1292 additions and 1794 deletions
+3 -3
View File
@@ -201,7 +201,7 @@ function mesh_data_get(raw: mesh_data_t, vs: vertex_element_t[]): iron_gpu_buffe
vb = gpu_create_vertex_buffer(math_floor(positions.values.length / size), vstruct, usage_t.STATIC);
raw._.vertices = gpu_lock_vertex_buffer(vb);
mesh_data_build_vertices(raw._.vertices, vertex_arrays, 0, has_tex && uvs == null, tex_offset);
iron_gpu_vertex_buffer_unlock_all(vb);
iron_gpu_vertex_buffer_unlock(vb);
map_set(raw._.vertex_buffer_map, key, vb);
if (has_tex && uvs == null) {
iron_log("Geometry " + raw.name + " is missing UV map");
@@ -223,7 +223,7 @@ function mesh_data_build(raw: mesh_data_t) {
raw._.vertex_buffer = gpu_create_vertex_buffer(math_floor(positions.values.length / size), raw._.structure, usage_t.STATIC);
raw._.vertices = gpu_lock_vertex_buffer(raw._.vertex_buffer);
mesh_data_build_vertices(raw._.vertices, raw.vertex_arrays);
iron_gpu_vertex_buffer_unlock_all(raw._.vertex_buffer);
iron_gpu_vertex_buffer_unlock(raw._.vertex_buffer);
let struct_str: string = "";
for (let i: i32 = 0; i < raw._.structure.size; ++i) {
@@ -246,7 +246,7 @@ function mesh_data_build(raw: mesh_data_t) {
indices_array[i] = id[i];
}
gpu_index_buffer_unlock_all(index_buffer);
gpu_index_buffer_unlock(index_buffer);
array_push(raw._.index_buffers, index_buffer);
}