Image Editor: Remove drawing artifacts #106173

Closed
Jeroen Bakker wants to merge 13 commits from Jeroen-Bakker:image-editor-drawing-artifacts into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
4 changed files with 68 additions and 76 deletions
Showing only changes of commit cc3b1ee4f0 - Show all commits

View File

@ -5217,96 +5217,97 @@ static void gwl_registry_wp_primary_selection_device_manager_remove(GWL_Display
static const GWL_RegistryHandler gwl_registry_handlers[] = {
/* Low level interfaces. */
{
&wl_compositor_interface.name,
gwl_registry_compositor_add,
nullptr,
gwl_registry_compositor_remove,
/*interface_p*/ &wl_compositor_interface.name,
/*add_fn*/ gwl_registry_compositor_add,
/*update_fn*/ nullptr,
/*remove_fn*/ gwl_registry_compositor_remove,
},
{
&wl_shm_interface.name,
gwl_registry_wl_shm_add,
nullptr,
gwl_registry_wl_shm_remove,
/*interface_p*/ &wl_shm_interface.name,
/*add_fn*/ gwl_registry_wl_shm_add,
/*update_fn*/ nullptr,
/*remove_fn*/ gwl_registry_wl_shm_remove,
},
{
&xdg_wm_base_interface.name,
gwl_registry_xdg_wm_base_add,
nullptr,
gwl_registry_xdg_wm_base_remove,
/*interface_p*/ &xdg_wm_base_interface.name,
/*add_fn*/ gwl_registry_xdg_wm_base_add,
/*update_fn*/ nullptr,
/*remove_fn*/ gwl_registry_xdg_wm_base_remove,
},
/* Managers. */
{
&zxdg_decoration_manager_v1_interface.name,
gwl_registry_xdg_decoration_manager_add,
nullptr,
gwl_registry_xdg_decoration_manager_remove,
/*interface_p*/ &zxdg_decoration_manager_v1_interface.name,
/*add_fn*/ gwl_registry_xdg_decoration_manager_add,
/*update_fn*/ nullptr,
/*remove_fn*/ gwl_registry_xdg_decoration_manager_remove,
},
{
&zxdg_output_manager_v1_interface.name,
gwl_registry_xdg_output_manager_add,
nullptr,
gwl_registry_xdg_output_manager_remove,
/*interface_p*/ &zxdg_output_manager_v1_interface.name,
/*add_fn*/ gwl_registry_xdg_output_manager_add,
/*update_fn*/ nullptr,
/*remove_fn*/ gwl_registry_xdg_output_manager_remove,
},
{
&wl_data_device_manager_interface.name,
gwl_registry_wl_data_device_manager_add,
nullptr,
gwl_registry_wl_data_device_manager_remove,
/*interface_p*/ &wl_data_device_manager_interface.name,
/*add_fn*/ gwl_registry_wl_data_device_manager_add,
/*update_fn*/ nullptr,
/*remove_fn*/ gwl_registry_wl_data_device_manager_remove,
},
{
&zwp_primary_selection_device_manager_v1_interface.name,
gwl_registry_wp_primary_selection_device_manager_add,
nullptr,
gwl_registry_wp_primary_selection_device_manager_remove,
/*interface_p*/ &zwp_primary_selection_device_manager_v1_interface.name,
/*add_fn*/ gwl_registry_wp_primary_selection_device_manager_add,
/*update_fn*/ nullptr,
/*remove_fn*/ gwl_registry_wp_primary_selection_device_manager_remove,
},
{
&zwp_tablet_manager_v2_interface.name,
gwl_registry_wp_tablet_manager_add,
nullptr,
gwl_registry_wp_tablet_manager_remove,
/*interface_p*/ &zwp_tablet_manager_v2_interface.name,
/*add_fn*/ gwl_registry_wp_tablet_manager_add,
/*update_fn*/ nullptr,
/*remove_fn*/ gwl_registry_wp_tablet_manager_remove,
},
{
&zwp_relative_pointer_manager_v1_interface.name,
gwl_registry_wp_relative_pointer_manager_add,
nullptr,
gwl_registry_wp_relative_pointer_manager_remove,
/*interface_p*/ &zwp_relative_pointer_manager_v1_interface.name,
/*add_fn*/ gwl_registry_wp_relative_pointer_manager_add,
/*update_fn*/ nullptr,
/*remove_fn*/ gwl_registry_wp_relative_pointer_manager_remove,
},
/* Higher level interfaces. */
{
&zwp_pointer_constraints_v1_interface.name,
gwl_registry_wp_pointer_constraints_add,
nullptr,
gwl_registry_wp_pointer_constraints_remove,
/*interface_p*/ &zwp_pointer_constraints_v1_interface.name,
/*add_fn*/ gwl_registry_wp_pointer_constraints_add,
/*update_fn*/ nullptr,
/*remove_fn*/ gwl_registry_wp_pointer_constraints_remove,
},
{
&zwp_pointer_gestures_v1_interface.name,
gwl_registry_wp_pointer_gestures_add,
nullptr,
gwl_registry_wp_pointer_gestures_remove,
/*interface_p*/ &zwp_pointer_gestures_v1_interface.name,
/*add_fn*/ gwl_registry_wp_pointer_gestures_add,
/*update_fn*/ nullptr,
/*remove_fn*/ gwl_registry_wp_pointer_gestures_remove,
},
{
&xdg_activation_v1_interface.name,
gwl_registry_xdg_activation_add,
nullptr,
gwl_registry_xdg_activation_remove,
/*interface_p*/ &xdg_activation_v1_interface.name,
/*add_fn*/ gwl_registry_xdg_activation_add,
/*update_fn*/ nullptr,
/*remove_fn*/ gwl_registry_xdg_activation_remove,
},
/* Display outputs. */
{
&wl_output_interface.name,
gwl_registry_wl_output_add,
gwl_registry_wl_output_update,
gwl_registry_wl_output_remove,
/*interface_p*/ &wl_output_interface.name,
/*add_fn*/ gwl_registry_wl_output_add,
/*update_fn*/ gwl_registry_wl_output_update,
/*remove_fn*/ gwl_registry_wl_output_remove,
},
/* Seats.
* Keep the seat near the end to ensure other types are created first.
* as the seat creates data based on other interfaces. */
{
&wl_seat_interface.name,
gwl_registry_wl_seat_add,
gwl_registry_wl_seat_update,
gwl_registry_wl_seat_remove,
/*interface_p*/ &wl_seat_interface.name,
/*add_fn*/ gwl_registry_wl_seat_add,
/*update_fn*/ gwl_registry_wl_seat_update,
/*remove_fn*/ gwl_registry_wl_seat_remove,
},
{nullptr, nullptr, nullptr},
{nullptr},
};
/**

View File

@ -197,6 +197,10 @@ static void particle_batch_cache_clear_hair(ParticleHairCache *hair_cache)
GPU_BATCH_DISCARD_SAFE(hair_cache->hairs);
GPU_VERTBUF_DISCARD_SAFE(hair_cache->pos);
GPU_INDEXBUF_DISCARD_SAFE(hair_cache->indices);
MEM_SAFE_FREE(hair_cache->proc_col_buf);
MEM_SAFE_FREE(hair_cache->col_tex);
MEM_SAFE_FREE(hair_cache->col_layer_names);
}
static void particle_batch_cache_clear(ParticleSystem *psys)
@ -206,9 +210,11 @@ static void particle_batch_cache_clear(ParticleSystem *psys)
return;
}
particle_batch_cache_clear_point(&cache->point);
particle_batch_cache_clear_hair(&cache->hair);
/* All memory allocated by `cache` must be freed. */
particle_batch_cache_clear_point(&cache->point);
particle_batch_cache_clear_hair(&cache->hair);
particle_batch_cache_clear_hair(&cache->edit_hair);
GPU_BATCH_DISCARD_SAFE(cache->edit_inner_points);
@ -217,24 +223,9 @@ static void particle_batch_cache_clear(ParticleSystem *psys)
GPU_VERTBUF_DISCARD_SAFE(cache->edit_tip_pos);
}
static void particle_batch_cache_free_hair(ParticleHairCache *hair)
{
MEM_SAFE_FREE(hair->proc_col_buf);
MEM_SAFE_FREE(hair->col_tex);
MEM_SAFE_FREE(hair->col_layer_names);
}
void DRW_particle_batch_cache_free(ParticleSystem *psys)
{
particle_batch_cache_clear(psys);
ParticleBatchCache *cache = psys->batch_cache;
if (cache) {
particle_batch_cache_free_hair(&cache->hair);
particle_batch_cache_free_hair(&cache->edit_hair);
}
MEM_SAFE_FREE(psys->batch_cache);
}

View File

@ -72,7 +72,7 @@ class VKDescriptorSet : NonCopyable {
return binding;
}
friend struct VKDescriptorSetTracker;
friend class VKDescriptorSetTracker;
friend class VKShaderInterface;
};

View File

@ -47,7 +47,7 @@ template<typename T> void copy_color(T dst[4], const T *src)
static VkClearColorValue to_vk_clear_color_value(eGPUDataFormat format, const void *data)
{
VkClearColorValue result = {0.0f};
VkClearColorValue result = {{0.0f}};
switch (format) {
case GPU_DATA_FLOAT: {
const float *float_data = static_cast<const float *>(data);