From eaf407bf91a919aeb27219309ce37ae6928ffead Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 25 Mar 2024 16:59:51 -0700 Subject: [PATCH 1/2] [Impeller] use screen space coordinates for dithering. --- impeller/entity/shaders/conical_gradient_ssbo_fill.frag | 2 +- impeller/entity/shaders/linear_gradient_ssbo_fill.frag | 2 +- impeller/entity/shaders/radial_gradient_ssbo_fill.frag | 2 +- impeller/entity/shaders/sweep_gradient_ssbo_fill.frag | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/impeller/entity/shaders/conical_gradient_ssbo_fill.frag b/impeller/entity/shaders/conical_gradient_ssbo_fill.frag index 80289969b1d0d..432152ea82dc1 100644 --- a/impeller/entity/shaders/conical_gradient_ssbo_fill.frag +++ b/impeller/entity/shaders/conical_gradient_ssbo_fill.frag @@ -65,5 +65,5 @@ void main() { } frag_color = IPPremultiply(result_color) * frag_info.alpha; - frag_color = IPOrderedDither8x8(frag_color, v_position); + frag_color = IPOrderedDither8x8(frag_color, gl_FragCoord.xy); } diff --git a/impeller/entity/shaders/linear_gradient_ssbo_fill.frag b/impeller/entity/shaders/linear_gradient_ssbo_fill.frag index dcfc5918a1b9c..e64c33b4d12c1 100644 --- a/impeller/entity/shaders/linear_gradient_ssbo_fill.frag +++ b/impeller/entity/shaders/linear_gradient_ssbo_fill.frag @@ -61,5 +61,5 @@ void main() { } frag_color = IPPremultiply(frag_color) * frag_info.alpha; - frag_color = IPOrderedDither8x8(frag_color, v_position); + frag_color = IPOrderedDither8x8(frag_color, gl_FragCoord.xy); } diff --git a/impeller/entity/shaders/radial_gradient_ssbo_fill.frag b/impeller/entity/shaders/radial_gradient_ssbo_fill.frag index afb5d7a799a52..2a7390ce39e0b 100644 --- a/impeller/entity/shaders/radial_gradient_ssbo_fill.frag +++ b/impeller/entity/shaders/radial_gradient_ssbo_fill.frag @@ -61,5 +61,5 @@ void main() { } frag_color = IPPremultiply(result_color) * frag_info.alpha; - frag_color = IPOrderedDither8x8(frag_color, v_position); + frag_color = IPOrderedDither8x8(frag_color, gl_FragCoord.xy); } diff --git a/impeller/entity/shaders/sweep_gradient_ssbo_fill.frag b/impeller/entity/shaders/sweep_gradient_ssbo_fill.frag index 00a39ccbd58a1..20d7f7d91b148 100644 --- a/impeller/entity/shaders/sweep_gradient_ssbo_fill.frag +++ b/impeller/entity/shaders/sweep_gradient_ssbo_fill.frag @@ -62,5 +62,5 @@ void main() { } frag_color = IPPremultiply(result_color) * frag_info.alpha; - frag_color = IPOrderedDither8x8(frag_color, v_position); + frag_color = IPOrderedDither8x8(frag_color, gl_FragCoord.xy); } From 72d002b94eb07900f48b8f59645d70fb2cd5f145 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 25 Mar 2024 19:02:40 -0700 Subject: [PATCH 2/2] malioc_update. --- impeller/tools/malioc.json | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/impeller/tools/malioc.json b/impeller/tools/malioc.json index 02522dda4abbe..0e196dad7dd4c 100644 --- a/impeller/tools/malioc.json +++ b/impeller/tools/malioc.json @@ -1126,7 +1126,7 @@ "shortest_path_cycles": [ 0.5, 0.109375, - 0.328125, + 0.296875, 0.5, 0.0, 0.25, @@ -1136,9 +1136,9 @@ "load_store" ], "total_cycles": [ - 1.4500000476837158, + 1.4249999523162842, 0.862500011920929, - 1.4500000476837158, + 1.4249999523162842, 0.875, 4.0, 0.25, @@ -1147,8 +1147,8 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 46, - "work_registers_used": 20 + "uniform_registers_used": 44, + "work_registers_used": 17 } } } @@ -8336,7 +8336,7 @@ "shortest_path_cycles": [ 0.5625, 0.203125, - 0.296875, + 0.265625, 0.5625, 0.0, 0.25, @@ -8346,9 +8346,9 @@ "load_store" ], "total_cycles": [ - 0.78125, + 0.75, 0.421875, - 0.78125, + 0.75, 0.625, 4.0, 0.25, @@ -8358,7 +8358,7 @@ "stack_spill_bytes": 0, "thread_occupancy": 100, "uniform_registers_used": 24, - "work_registers_used": 20 + "work_registers_used": 17 } } } @@ -9205,7 +9205,7 @@ "shortest_path_cycles": [ 0.5625, 0.21875, - 0.3125, + 0.28125, 0.5625, 0.0, 0.25, @@ -9215,9 +9215,9 @@ "load_store" ], "total_cycles": [ - 0.75, + 0.71875, 0.421875, - 0.75, + 0.71875, 0.625, 4.0, 0.25, @@ -9227,7 +9227,7 @@ "stack_spill_bytes": 0, "thread_occupancy": 100, "uniform_registers_used": 22, - "work_registers_used": 20 + "work_registers_used": 17 } } } @@ -10013,7 +10013,7 @@ "shortest_path_cycles": [ 0.8125, 0.421875, - 0.359375, + 0.328125, 0.8125, 0.0, 0.25, @@ -10025,7 +10025,7 @@ "total_cycles": [ 0.875, 0.6875, - 0.800000011920929, + 0.762499988079071, 0.875, 4.0, 0.25, @@ -10034,8 +10034,8 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 28, - "work_registers_used": 23 + "uniform_registers_used": 26, + "work_registers_used": 20 } } }