This commit is contained in:
luboslenco
2025-09-28 19:38:08 +02:00
parent 3b65a7a6a3
commit 6b3222e30a
39 changed files with 201 additions and 288 deletions
+2 -5
View File
@@ -59,9 +59,6 @@ function base_init() {
base_last_window_height = iron_window_height();
sys_notify_on_drop_files(function (drop_path: string) {
///if arm_linux
drop_path = uri_decode(drop_path);
///end
drop_path = trim_end(drop_path);
array_push(base_drop_paths, drop_path);
});
@@ -667,10 +664,10 @@ function base_toggle_fullscreen() {
config_raw.window_h = iron_window_height();
config_raw.window_x = iron_window_x();
config_raw.window_y = iron_window_y();
iron_set_window_mode(window_mode_t.FULLSCREEN);
iron_window_change_mode(window_mode_t.FULLSCREEN);
}
else {
iron_set_window_mode(window_mode_t.WINDOWED);
iron_window_change_mode(window_mode_t.WINDOWED);
iron_window_resize(config_raw.window_w, config_raw.window_h);
iron_window_move(config_raw.window_x, config_raw.window_y);
}
+1 -1
View File
@@ -34,7 +34,7 @@ function color_node_get_as_image(self: color_node_t, from: i32): gpu_texture_t {
return logic_node_input_get_as_image(self.base.inputs[0]);
}
if (self.image != null) {
iron_delete_texture(self.image);
gpu_delete_texture(self.image);
}
let b: buffer_t = buffer_create(16);
buffer_set_f32(b, 0, self.value.x);
+1 -1
View File
@@ -30,7 +30,7 @@ function float_node_get_as_image(self: float_node_t, from: i32): gpu_texture_t {
return logic_node_input_get_as_image(self.base.inputs[0]);
}
if (self.image != null) {
iron_delete_texture(self.image);
gpu_delete_texture(self.image);
}
let b: buffer_t = buffer_create(16);
buffer_set_f32(b, 0, self.value);
+1 -1
View File
@@ -38,7 +38,7 @@ function vector_node_get_as_image(self: vector_node_t, from: i32): gpu_texture_t
// let y: f32 = logic_node_input_get(self.base.inputs[1]);
// let z: f32 = logic_node_input_get(self.base.inputs[2]);
if (self.image != null) {
iron_delete_texture(self.image);
gpu_delete_texture(self.image);
}
let b: buffer_t = buffer_create(16);
let n0: float_node_t = self.base.inputs[0].node;
+2 -2
View File
@@ -176,7 +176,7 @@ function export_arm_run_project() {
// ///end
iron_write_png(substring(project_filepath, 0, project_filepath.length - 4) + "_icon.png", mesh_icon_pixels, 256, 256, 0);
iron_delete_texture(mesh_icon);
gpu_delete_texture(mesh_icon);
///end
let is_packed: bool = ends_with(project_filepath, "_packed_.arm");
@@ -468,7 +468,7 @@ function export_arm_pack_assets(raw: project_format_t, assets: asset_t[]) {
for (let i: i32 = 0; i < temp_images.length; ++i) {
let image: gpu_texture_t = temp_images[i];
iron_delete_texture(image);
gpu_delete_texture(image);
}
}
+5 -5
View File
@@ -183,13 +183,13 @@ function import_arm_run_project(path: string) {
let rts: map_t<string, render_target_t> = render_path_render_targets;
let blend0: render_target_t = map_get(rts, "texpaint_blend0");
let _texpaint_blend0: gpu_texture_t = blend0._image;
iron_delete_texture(_texpaint_blend0);
gpu_delete_texture(_texpaint_blend0);
blend0.width = config_get_texture_res_x();
blend0.height = config_get_texture_res_y();
blend0._image = gpu_create_render_target(config_get_texture_res_x(), config_get_texture_res_y(), tex_format_t.R8);
let blend1: render_target_t = map_get(rts, "texpaint_blend1");
let _texpaint_blend1: gpu_texture_t = blend1._image;
iron_delete_texture(_texpaint_blend1);
gpu_delete_texture(_texpaint_blend1);
blend1.width = config_get_texture_res_x();
blend1.height = config_get_texture_res_y();
blend1._image = gpu_create_render_target(config_get_texture_res_x(), config_get_texture_res_y(), tex_format_t.R8);
@@ -273,13 +273,13 @@ function import_arm_run_project(path: string) {
l.paint_emis = ld.paint_emis;
l.paint_subs = ld.paint_subs;
iron_delete_texture(_texpaint);
gpu_delete_texture(_texpaint);
if (_texpaint_nor != null) {
iron_delete_texture(_texpaint_nor);
gpu_delete_texture(_texpaint_nor);
}
if (_texpaint_pack != null) {
iron_delete_texture(_texpaint_pack);
gpu_delete_texture(_texpaint_pack);
}
}
}
+7 -7
View File
@@ -51,14 +51,14 @@ function layers_resize() {
let blend0: render_target_t = map_get(rts, "texpaint_blend0");
let _texpaint_blend0: gpu_texture_t = blend0._image;
iron_delete_texture(_texpaint_blend0);
gpu_delete_texture(_texpaint_blend0);
blend0.width = config_get_texture_res_x();
blend0.height = config_get_texture_res_y();
blend0._image = gpu_create_render_target(config_get_texture_res_x(), config_get_texture_res_y(), tex_format_t.R8);
let blend1: render_target_t = map_get(rts, "texpaint_blend1");
let _texpaint_blend1: gpu_texture_t = blend1._image;
iron_delete_texture(_texpaint_blend1);
gpu_delete_texture(_texpaint_blend1);
blend1.width = config_get_texture_res_x();
blend1.height = config_get_texture_res_y();
blend1._image = gpu_create_render_target(config_get_texture_res_x(), config_get_texture_res_y(), tex_format_t.R8);
@@ -68,7 +68,7 @@ function layers_resize() {
let blur: render_target_t = map_get(rts, "texpaint_blur");
if (blur != null) {
let _texpaint_blur: gpu_texture_t = blur._image;
iron_delete_texture(_texpaint_blur);
gpu_delete_texture(_texpaint_blur);
let size_x: f32 = math_floor(config_get_texture_res_x() * 0.95);
let size_y: f32 = math_floor(config_get_texture_res_y() * 0.95);
blur.width = size_x;
@@ -120,7 +120,7 @@ function layers_make_temp_img() {
function layers_make_temp_mask_img() {
if (pipes_temp_mask_image != null && (pipes_temp_mask_image.width != config_get_texture_res_x() || pipes_temp_mask_image.height != config_get_texture_res_y())) {
let _temp_mask_image: gpu_texture_t = pipes_temp_mask_image;
iron_delete_texture(_temp_mask_image);
gpu_delete_texture(_temp_mask_image);
pipes_temp_mask_image = null;
}
if (pipes_temp_mask_image == null) {
@@ -135,9 +135,9 @@ function layers_make_export_img() {
let _expa: gpu_texture_t = layers_expa;
let _expb: gpu_texture_t = layers_expb;
let _expc: gpu_texture_t = layers_expc;
iron_delete_texture(_expa);
iron_delete_texture(_expb);
iron_delete_texture(_expc);
gpu_delete_texture(_expa);
gpu_delete_texture(_expb);
gpu_delete_texture(_expc);
layers_expa = null;
layers_expb = null;
layers_expc = null;
+4 -4
View File
@@ -223,7 +223,7 @@ function make_material_bake_node_previews() {
let key: string = keys[i];
if (array_index_of(context_raw.node_previews_used, key) == -1) {
let image: gpu_texture_t = map_get(context_raw.node_previews, key);
iron_delete_texture(image);
gpu_delete_texture(image);
map_delete(context_raw.node_previews, key);
}
}
@@ -257,7 +257,7 @@ function make_material_bake_node_preview(node: ui_node_t, group: ui_node_canvas_
let res_y: i32 = math_floor(config_get_texture_res_y() / 4);
if (image == null || image.width != res_x || image.height != res_y) {
if (image != null) {
iron_delete_texture(image);
gpu_delete_texture(image);
}
image = gpu_create_render_target(res_x, res_y);
map_set(context_raw.node_previews, id, image);
@@ -275,7 +275,7 @@ function make_material_bake_node_preview(node: ui_node_t, group: ui_node_canvas_
let res_y: i32 = math_floor(config_get_texture_res_y());
if (image == null || image.width != res_x || image.height != res_y) {
if (image != null) {
iron_delete_texture(image);
gpu_delete_texture(image);
}
image = gpu_create_render_target(res_x, res_y);
map_set(context_raw.node_previews, id, image);
@@ -293,7 +293,7 @@ function make_material_bake_node_preview(node: ui_node_t, group: ui_node_canvas_
let res_y: i32 = math_floor(config_get_texture_res_y());
if (image == null || image.width != res_x || image.height != res_y) {
if (image != null) {
iron_delete_texture(image);
gpu_delete_texture(image);
}
image = gpu_create_render_target(res_x, res_y, tex_format_t.R8);
map_set(context_raw.node_previews, id, image);
@@ -157,7 +157,7 @@ function photo_to_pbr_node_get_as_image(self: photo_to_pbr_node_t, from: i32): g
draw_begin(photo_to_pbr_node_images[from]);
draw_image(temp2, x * photo_to_pbr_node_tile_w, y * photo_to_pbr_node_tile_w);
draw_end();
iron_delete_texture(temp2);
gpu_delete_texture(temp2);
}
return photo_to_pbr_node_images[from];
+1 -1
View File
@@ -16,7 +16,7 @@ function rgb_node_create(raw: ui_node_t, args: f32_array_t): rgb_node_t {
function rgb_node_get_as_image(self: rgb_node_t, from: i32): gpu_texture_t {
if (self.image != null) {
iron_delete_texture(self.image);
gpu_delete_texture(self.image);
}
let f32a: f32_array_t = f32_array_create(4);
@@ -280,7 +280,7 @@ function text_to_photo_node_vae_decoder(latents: f32_array_t, upscale: bool): gp
while (image.width < config_get_texture_res_x()) {
let last_image: gpu_texture_t = image;
image = upscale_node_esrgan(image);
iron_delete_texture(last_image);
gpu_delete_texture(last_image);
}
return image;
}
+4 -4
View File
@@ -26,7 +26,7 @@ function upscale_node_get_as_image(self: upscale_node_t, from: i32): gpu_texture
while (upscale_node_image.width < config_get_texture_res_x()) {
let last_image: gpu_texture_t = upscale_node_image;
upscale_node_image = upscale_node_esrgan(upscale_node_image);
iron_delete_texture(last_image);
gpu_delete_texture(last_image);
}
}
return upscale_node_image;
@@ -47,7 +47,7 @@ function upscale_node_do_tile(source: gpu_texture_t): gpu_texture_t {
let size2w: i32 = math_floor(size1w * 2);
let size2h: i32 = math_floor(size1h * 2);
if (upscale_node_temp != null) {
iron_delete_texture(upscale_node_temp);
gpu_delete_texture(upscale_node_temp);
}
upscale_node_temp = gpu_create_render_target(size1w, size1h);
draw_begin(upscale_node_temp);
@@ -118,10 +118,10 @@ function upscale_node_esrgan(source: gpu_texture_t): gpu_texture_t {
draw_begin(result);
draw_sub_image(tile_result, x * tile_size2x, y * tile_size2x, 64, 64, tile_size2x, tile_size2x);
draw_end();
iron_delete_texture(tile_result);
gpu_delete_texture(tile_result);
}
}
iron_delete_texture(tile_source);
gpu_delete_texture(tile_source);
}
else {
result = upscale_node_do_tile(source); // Single tile
+3 -3
View File
@@ -25,9 +25,9 @@ function render_path_raytrace_bake_commands(parse_paint_material: (b?: bool)=>vo
let baketex0: render_target_t = map_get(render_path_render_targets, "baketex0");
let baketex1: render_target_t = map_get(render_path_render_targets, "baketex1");
let baketex2: render_target_t = map_get(render_path_render_targets, "baketex2");
iron_delete_texture(baketex0._image);
iron_delete_texture(baketex1._image);
iron_delete_texture(baketex2._image);
gpu_delete_texture(baketex0._image);
gpu_delete_texture(baketex1._image);
gpu_delete_texture(baketex2._image);
}
{
+9 -9
View File
@@ -179,15 +179,15 @@ function slot_layer_unload(raw: slot_layer_t) {
let _texpaint_pack: gpu_texture_t = raw.texpaint_pack;
let _texpaint_preview: gpu_texture_t = raw.texpaint_preview;
iron_delete_texture(_texpaint);
gpu_delete_texture(_texpaint);
if (_texpaint_nor != null) {
iron_delete_texture(_texpaint_nor);
gpu_delete_texture(_texpaint_nor);
}
if (_texpaint_pack != null) {
iron_delete_texture(_texpaint_pack);
gpu_delete_texture(_texpaint_pack);
}
if (_texpaint_preview != null) {
iron_delete_texture(_texpaint_preview);
gpu_delete_texture(_texpaint_preview);
}
map_delete(render_path_render_targets, "texpaint" + raw.ext);
@@ -261,7 +261,7 @@ function slot_layer_invert_mask(raw: slot_layer_t) {
draw_set_pipeline(null);
draw_end();
let _texpaint: gpu_texture_t = raw.texpaint;
iron_delete_texture(_texpaint);
gpu_delete_texture(_texpaint);
let rt: render_target_t = map_get(render_path_render_targets, "texpaint" + raw.id);
raw.texpaint = rt._image = inverted;
context_raw.layer_preview_dirty = true;
@@ -397,12 +397,12 @@ function slot_layer_resize_and_set_bits(raw: slot_layer_t) {
draw_end();
}
iron_delete_texture(_texpaint);
gpu_delete_texture(_texpaint);
if (_texpaint_nor != null) {
iron_delete_texture(_texpaint_nor);
gpu_delete_texture(_texpaint_nor);
}
if (_texpaint_pack != null) {
iron_delete_texture(_texpaint_pack);
gpu_delete_texture(_texpaint_pack);
}
let rt: render_target_t = map_get(rts, "texpaint" + raw.ext);
@@ -428,7 +428,7 @@ function slot_layer_resize_and_set_bits(raw: slot_layer_t) {
draw_set_pipeline(null);
draw_end();
iron_delete_texture(_texpaint);
gpu_delete_texture(_texpaint);
let rt: render_target_t = map_get(rts, "texpaint" + raw.ext);
rt._image = raw.texpaint;
+2 -2
View File
@@ -80,8 +80,8 @@ function slot_material_create(m: material_data_t = null, c: ui_node_canvas_t = n
}
function slot_material_unload(raw: slot_material_t) {
iron_delete_texture(raw.image);
iron_delete_texture(raw.image_icon);
gpu_delete_texture(raw.image);
gpu_delete_texture(raw.image_icon);
}
function slot_material_delete(raw: slot_material_t) {
+1 -1
View File
@@ -151,7 +151,7 @@ function tab_textures_draw(htab: ui_handle_t) {
f += ".png";
}
iron_write_png(path + path_sep + f, gpu_get_texture_pixels(target), target.width, target.height, 0);
iron_delete_texture(target);
gpu_delete_texture(target);
}, target);
});
});
+2 -2
View File
@@ -66,7 +66,7 @@ function ui_viewnodes_init() {
function ui_viewnodes_on_node_remove(n: ui_node_t) {
let img: gpu_texture_t = map_get(context_raw.node_preview_map, n);
if (img != null) {
iron_delete_texture(img);
gpu_delete_texture(img);
map_delete(context_raw.node_preview_map, n);
}
}
@@ -816,7 +816,7 @@ function ui_nodes_render() {
if (ui_nodes_grid_redraw) {
if (ui_nodes_grid != null) {
iron_delete_texture(ui_nodes_grid);
gpu_delete_texture(ui_nodes_grid);
}
ui_nodes_grid = ui_nodes_draw_grid(ui_nodes.zoom);
ui_nodes_grid_redraw = false;
+1 -1
View File
@@ -75,7 +75,7 @@ function ui_view2d_render() {
// Cache grid
if (ui_view2d_grid_redraw) {
if (ui_view2d_grid != null) {
iron_delete_texture(ui_view2d_grid);
gpu_delete_texture(ui_view2d_grid);
}
ui_view2d_grid = ui_nodes_draw_grid(ui_view2d_pan_scale);
ui_view2d_grid_redraw = false;
+1 -1
View File
@@ -151,7 +151,7 @@ function util_render_make_text_preview() {
tex_w = 512;
}
if (context_raw.text_tool_image != null && context_raw.text_tool_image.width < tex_w) {
iron_delete_texture(context_raw.text_tool_image);
gpu_delete_texture(context_raw.text_tool_image);
context_raw.text_tool_image = null;
}
if (context_raw.text_tool_image == null) {
+4 -4
View File
@@ -12,7 +12,7 @@ let util_uv_pipe_dilate: gpu_pipeline_t = null;
function util_uv_cache_uv_map() {
if (util_uv_uvmap != null && (util_uv_uvmap.width != config_get_texture_res_x() || util_uv_uvmap.height != config_get_texture_res_y())) {
iron_delete_texture(util_uv_uvmap);
gpu_delete_texture(util_uv_uvmap);
util_uv_uvmap = null;
util_uv_uvmap_cached = false;
}
@@ -54,7 +54,7 @@ function util_uv_cache_uv_map() {
function util_uv_cache_triangle_map() {
if (util_uv_trianglemap != null && (util_uv_trianglemap.width != config_get_texture_res_x() || util_uv_trianglemap.height != config_get_texture_res_y())) {
iron_delete_texture(util_uv_trianglemap);
gpu_delete_texture(util_uv_trianglemap);
util_uv_trianglemap = null;
util_uv_trianglemap_cached = false;
}
@@ -92,7 +92,7 @@ function util_uv_cache_triangle_map() {
function util_uv_cache_dilate_map() {
if (util_uv_dilatemap != null && (util_uv_dilatemap.width != config_get_texture_res_x() || util_uv_dilatemap.height != config_get_texture_res_y())) {
iron_delete_texture(util_uv_dilatemap);
gpu_delete_texture(util_uv_dilatemap);
util_uv_dilatemap = null;
util_uv_dilatemap_cached = false;
}
@@ -181,7 +181,7 @@ function util_uv_cache_uv_island_map() {
}
if (util_uv_uvislandmap != null) {
iron_delete_texture(util_uv_uvislandmap);
gpu_delete_texture(util_uv_uvislandmap);
}
util_uv_uvislandmap = gpu_create_texture_from_bytes(bytes, w, h, tex_format_t.R8);
util_uv_uvislandmap_cached = true;