@ -821,14 +821,15 @@ static bool create_3d_lut_image(struct wlr_vk_renderer *renderer,
goto fail_imageview ;
goto fail_imageview ;
}
}
void * data ;
if ( ! span . buffer - > cpu_mapping ) {
res = vkMapMemory ( dev , span . buffer - > memory , span . alloc . start , size , 0 , & data ) ;
res = vkMapMemory ( dev , span . buffer - > memory , span . alloc . start , size , 0 , & span. buffer - > cpu_mapping ) ;
if ( res ! = VK_SUCCESS ) {
if ( res ! = VK_SUCCESS ) {
wlr_vk_error ( " vkMapMemory " , res ) ;
wlr_vk_error ( " vkMapMemory " , res ) ;
goto fail_imageview ;
goto fail_imageview ;
}
}
}
float * dst = data ;
float * dst = span. buffer - > cpu_mapping ;
size_t dim_len = lut_3d - > dim_len ;
size_t dim_len = lut_3d - > dim_len ;
for ( size_t b_index = 0 ; b_index < dim_len ; b_index + + ) {
for ( size_t b_index = 0 ; b_index < dim_len ; b_index + + ) {
for ( size_t g_index = 0 ; g_index < dim_len ; g_index + + ) {
for ( size_t g_index = 0 ; g_index < dim_len ; g_index + + ) {
@ -844,8 +845,6 @@ static bool create_3d_lut_image(struct wlr_vk_renderer *renderer,
}
}
}
}
vkUnmapMemory ( dev , span . buffer - > memory ) ;
VkCommandBuffer cb = vulkan_record_stage_cb ( renderer ) ;
VkCommandBuffer cb = vulkan_record_stage_cb ( renderer ) ;
vulkan_change_layout ( cb , * image ,
vulkan_change_layout ( cb , * image ,
VK_IMAGE_LAYOUT_UNDEFINED , VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT , 0 ,
VK_IMAGE_LAYOUT_UNDEFINED , VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT , 0 ,