Own canvas async work and thin NodeCanvas composite

This commit is contained in:
2026-06-16 07:10:09 +02:00
parent 75f57213ca
commit 4d7a23a1fd
7 changed files with 279 additions and 78 deletions

View File

@@ -175,6 +175,20 @@ struct LegacyCanvasDrawMergeFinalPlaneCompositeExecution {
std::function<void()> unbind_merged_texture;
};
struct LegacyCanvasDrawMergeCacheToScreenCompositeUniforms {
LegacyCanvasDrawMergeCheckerboardUniforms checkerboard;
LegacyCanvasDrawMergeTextureUniforms texture;
};
struct LegacyCanvasDrawMergeCacheToScreenCompositeExecution {
std::function<void()> enable_blend;
std::function<void(const LegacyCanvasDrawMergeCheckerboardUniforms&, int)> draw_checkerboard_plane;
std::function<void()> bind_sampler;
std::function<void()> bind_cache_texture;
std::function<void()> draw_cache_texture;
std::function<void()> unbind_cache_texture;
};
struct LegacyCanvasDrawMergeDisplayResolveUniforms {
LegacyCanvasDrawMergeTextureUniforms texture;
};
@@ -447,6 +461,23 @@ inline void execute_legacy_canvas_draw_merge_final_plane_composite(
execution.unbind_merged_texture();
}
inline void execute_legacy_canvas_draw_merge_cache_to_screen_composite(
const LegacyCanvasDrawMergeCacheToScreenCompositeUniforms& uniforms,
const LegacyCanvasDrawMergeCacheToScreenCompositeExecution& execution)
{
execution.enable_blend();
for (int plane_index = 0; plane_index < 6; ++plane_index) {
execution.draw_checkerboard_plane(uniforms.checkerboard, plane_index);
}
execution.bind_sampler();
execution.bind_cache_texture();
setup_legacy_canvas_draw_merge_texture_shader(uniforms.texture);
execution.draw_cache_texture();
execution.unbind_cache_texture();
}
inline void execute_legacy_canvas_draw_merge_display_resolve(
const LegacyCanvasDrawMergeDisplayResolveUniforms& uniforms,
const LegacyCanvasDrawMergeDisplayResolveExecution& execution)