Defines cleanup

This commit is contained in:
luboslenco
2024-09-06 21:11:46 +02:00
parent 08705a515c
commit 14e01de285
69 changed files with 295 additions and 295 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ function make_material_parse_mesh_material() {
make_material_make_voxel(m);
///end
///if (iron_direct3d12 || iron_vulkan)
///if (arm_direct3d12 || arm_vulkan)
render_path_raytrace_dirty = 1;
///end
}
+1 -1
View File
@@ -148,7 +148,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte
}
frag.vvec = true;
///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan)
///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan)
node_shader_write(frag, "mat3 TBN = cotangent_frame(n, vvec, tex_coord);");
///else
node_shader_write(frag, "mat3 TBN = cotangent_frame(n, -vvec, tex_coord);");
+10 -10
View File
@@ -51,7 +51,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad
node_shader_add_uniform(frag, "vec2 gbuffer_size", "_gbuffer_size");
node_shader_add_uniform(frag, "vec4 inp", "_input_brush");
///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan)
///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan)
node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(inp.x * gbuffer_size.x, inp.y * gbuffer_size.y), 0).ba;");
///else
node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(inp.x * gbuffer_size.x, (1.0 - inp.y) * gbuffer_size.y), 0).ba;");
@@ -71,7 +71,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad
return con_paint;
}
///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan)
///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan)
node_shader_write(vert, "vec2 tpos = vec2(tex.x * 2.0 - 1.0, (1.0 - tex.y) * 2.0 - 1.0);");
// node_shader_write(vert, "vec2 tpos = vec2(frac(tex.x * tex_scale) * 2.0 - 1.0, (1.0 - frac(tex.y * tex_scale)) * 2.0 - 1.0);"); // 3D View
///else
@@ -111,7 +111,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad
node_shader_write(frag, "float dist = 0.0;");
///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan)
///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan)
node_shader_write(frag, "float depth = textureLod(gbufferD, inp.xy, 0.0).r;");
///else
node_shader_write(frag, "float depth = textureLod(gbufferD, vec2(inp.x, 1.0 - inp.y), 0.0).r;");
@@ -123,7 +123,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad
node_shader_write(frag, "winp.xyz /= winp.w;");
frag.wposition = true;
///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan)
///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan)
node_shader_write(frag, "float depthlast = textureLod(gbufferD, inplast.xy, 0.0).r;");
///else
node_shader_write(frag, "float depthlast = textureLod(gbufferD, vec2(inplast.x, 1.0 - inplast.y), 0.0).r;");
@@ -157,7 +157,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad
if (context_raw.tool == workspace_tool_t.CLONE) {
// node_shader_add_uniform(frag, "vec2 clone_delta", "_clone_delta");
// ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan)
// ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan)
// node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2((sp.xy + clone_delta) * gbuffer_size), 0).ba;");
// ///else
// node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2((sp.x + clone_delta.x) * gbuffer_size.x, (1.0 - (sp.y + clone_delta.y)) * gbuffer_size.y), 0).ba;");
@@ -181,7 +181,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad
// node_shader_write(frag, "float opacity = mat_opacity * brush_opacity;");
}
else { // Blur
// ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan)
// ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan)
// node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(sp.x * gbuffer_size.x, sp.y * gbuffer_size.y), 0).ba;");
// ///else
// node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(sp.x * gbuffer_size.x, (1.0 - sp.y) * gbuffer_size.y), 0).ba;");
@@ -199,7 +199,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad
// node_shader_add_uniform(frag, "vec2 texpaint_size", "_texpaint_size");
// node_shader_write(frag, "float blur_step = 1.0 / texpaint_size.x;");
// if (context_raw.blur_directional) {
// ///if (iron_direct3d11 || iron_direct3d12 || iron_metal)
// ///if (arm_direct3d11 || arm_direct3d12 || arm_metal)
// node_shader_write(frag, "const float blur_weight[7] = {1.0 / 28.0, 2.0 / 28.0, 3.0 / 28.0, 4.0 / 28.0, 5.0 / 28.0, 6.0 / 28.0, 7.0 / 28.0};");
// ///else
// node_shader_write(frag, "const float blur_weight[7] = float[](1.0 / 28.0, 2.0 / 28.0, 3.0 / 28.0, 4.0 / 28.0, 5.0 / 28.0, 6.0 / 28.0, 7.0 / 28.0);");
@@ -207,7 +207,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad
// node_shader_add_uniform(frag, "vec3 brush_direction", "_brush_direction");
// node_shader_write(frag, "vec2 blur_direction = brush_direction.yx;");
// node_shader_write(frag, "for (int i = 0; i < 7; ++i) {");
// ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan)
// ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan)
// node_shader_write(frag, "vec2 tex_coord_inp2 = texelFetch(gbuffer2, ivec2((sp.x + blur_direction.x * blur_step * float(i)) * gbuffer_size.x, (sp.y + blur_direction.y * blur_step * float(i)) * gbuffer_size.y), 0).ba;");
// ///else
// node_shader_write(frag, "vec2 tex_coord_inp2 = texelFetch(gbuffer2, ivec2((sp.x + blur_direction.x * blur_step * float(i)) * gbuffer_size.x, (1.0 - (sp.y + blur_direction.y * blur_step * float(i))) * gbuffer_size.y), 0).ba;");
@@ -224,7 +224,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad
// node_shader_write(frag, "}");
// }
// else {
// ///if (iron_direct3d11 || iron_direct3d12 || iron_metal)
// ///if (arm_direct3d11 || arm_direct3d12 || arm_metal)
// node_shader_write(frag, "const float blur_weight[15] = {0.034619 / 2.0, 0.044859 / 2.0, 0.055857 / 2.0, 0.066833 / 2.0, 0.076841 / 2.0, 0.084894 / 2.0, 0.090126 / 2.0, 0.09194 / 2.0, 0.090126 / 2.0, 0.084894 / 2.0, 0.076841 / 2.0, 0.066833 / 2.0, 0.055857 / 2.0, 0.044859 / 2.0, 0.034619 / 2.0};");
// ///else
// node_shader_write(frag, "const float blur_weight[15] = float[](0.034619 / 2.0, 0.044859 / 2.0, 0.055857 / 2.0, 0.066833 / 2.0, 0.076841 / 2.0, 0.084894 / 2.0, 0.090126 / 2.0, 0.09194 / 2.0, 0.090126 / 2.0, 0.084894 / 2.0, 0.076841 / 2.0, 0.066833 / 2.0, 0.055857 / 2.0, 0.044859 / 2.0, 0.034619 / 2.0);");
@@ -266,7 +266,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad
// Manual blending to preserve memory
frag.wvpposition = true;
node_shader_write(frag, "vec2 sample_tc = vec2(wvpposition.xy / wvpposition.w) * 0.5 + 0.5;");
///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan)
///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan)
node_shader_write(frag, "sample_tc.y = 1.0 - sample_tc.y;");
///end
node_shader_add_uniform(frag, "sampler2D paintmask");
+2 -2
View File
@@ -147,7 +147,7 @@ function photo_to_pbr_node_get_as_image(self: photo_to_pbr_node_t, from: i32): i
}
}
///if (iron_metal || iron_vulkan)
///if (arm_metal || arm_vulkan)
if (from == channel_type_t.BASE_COLOR) {
photo_to_pbr_node_bgra_swap(u8a.buffer);
}
@@ -165,7 +165,7 @@ function photo_to_pbr_node_get_as_image(self: photo_to_pbr_node_t, from: i32): i
return photo_to_pbr_node_images[from];
}
///if (iron_metal || iron_vulkan)
///if (arm_metal || arm_vulkan)
function photo_to_pbr_node_bgra_swap(buffer: buffer_t) {
let u8a: buffer_t = buffer;
for (let i: i32 = 0; i < math_floor(buffer.length / 4); ++i) {
+4 -4
View File
@@ -62,7 +62,7 @@ function render_path_paint_commands_paint(dilation: bool = true) {
if (context_raw.tool == workspace_tool_t.PICKER) {
///if iron_metal
///if arm_metal
// render_path_set_target("texpaint_picker");
// render_path_clear_target(0xff000000);
// render_path_set_target("texpaint_nor_picker");
@@ -96,7 +96,7 @@ function render_path_paint_commands_paint(dilation: bool = true) {
}
// Picked surface values
// ///if (iron_metal || iron_vulkan)
// ///if (arm_metal || arm_vulkan)
// context_raw.pickedColor.base.Rb = a.get(2);
// context_raw.pickedColor.base.Gb = a.get(1);
// context_raw.pickedColor.base.Bb = a.get(0);
@@ -202,7 +202,7 @@ function render_path_paint_draw_cursor(mx: f32, my: f32, radius: f32, tint_r: f3
let help_mat: mat4_t = mat4_identity();
mat4_get_inv(help_mat, scene_camera.vp);
g4_set_mat(base_cursor_inv_vp, help_mat);
///if (iron_metal || iron_vulkan)
///if (arm_metal || arm_vulkan)
let vs: vertex_structure_t[] = [{name: "tex", data: "short2norm"}];
g4_set_vertex_buffer(mesh_data_get(geom, vs));
///else
@@ -245,7 +245,7 @@ function render_path_paint_draw() {
if (context_raw.brush_blend_dirty) {
context_raw.brush_blend_dirty = false;
///if iron_metal
///if arm_metal
render_path_set_target("texpaint_blend0");
render_path_clear_target(0x00000000);
render_path_set_target("texpaint_blend1");
+2 -2
View File
@@ -114,14 +114,14 @@ function ui_nodes_ext_draw_buttons(ew: f32, start_y: f32) {
context_raw.ddirty = 2;
app_remove_render_2d(ui_nodes_ext_delay_idle_sleep);
///if (iron_direct3d12 || iron_vulkan || iron_metal)
///if (arm_direct3d12 || arm_vulkan || arm_metal)
render_path_raytrace_ready = false;
///end
}
ui._x += ew + 3;
ui._y = 2 + start_y;
///if (iron_android || iron_ios)
///if (arm_android || arm_ios)
let base_res_combo: string[] = ["2K", "4K"];
ui_combo(base_res_handle, base_res_combo, tr("Resolution"));
///else