Move Win32 async context ownership and trim canvas draw setup
This commit is contained in:
@@ -494,6 +494,45 @@ inline void execute_legacy_canvas_draw_merge_layer_texture(
|
||||
execution.unbind_layer_texture();
|
||||
}
|
||||
|
||||
template <typename LayerMergeT, typename SamplerT, typename FacePlaneT, typename SetActiveTextureUnit, typename PlaneTransform>
|
||||
[[nodiscard]] inline auto make_legacy_canvas_draw_merge_layer_texture_draw(
|
||||
LayerMergeT* layer_merge,
|
||||
SamplerT* sampler,
|
||||
FacePlaneT* face_plane,
|
||||
SetActiveTextureUnit set_active_texture_unit,
|
||||
glm::mat4 proj,
|
||||
glm::mat4 camera,
|
||||
PlaneTransform plane_transform)
|
||||
{
|
||||
return [layer_merge, sampler, face_plane, set_active_texture_unit, proj, camera, plane_transform](int plane_index) {
|
||||
const auto mvp = proj * camera *
|
||||
plane_transform[plane_index] *
|
||||
glm::translate(glm::vec3(0, 0, -1));
|
||||
execute_legacy_canvas_draw_merge_layer_texture(
|
||||
{
|
||||
.mvp = mvp,
|
||||
.texture_slot = 0,
|
||||
.alpha = 1.f,
|
||||
.highlight = false,
|
||||
},
|
||||
{
|
||||
.bind_sampler = [sampler, set_active_texture_unit] {
|
||||
sampler->bind(0);
|
||||
set_active_texture_unit(0);
|
||||
},
|
||||
.bind_layer_texture = [layer_merge, plane_index] {
|
||||
layer_merge->rtt(plane_index).bindTexture();
|
||||
},
|
||||
.draw = [face_plane] {
|
||||
face_plane->draw_fill();
|
||||
},
|
||||
.unbind_layer_texture = [layer_merge, plane_index] {
|
||||
layer_merge->rtt(plane_index).unbindTexture();
|
||||
},
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
inline void execute_legacy_canvas_draw_merge_layer_composite(
|
||||
bool is_temporary_erase,
|
||||
bool is_temporary_paint,
|
||||
|
||||
Reference in New Issue
Block a user