@@ -529,14 +529,14 @@ static void ImGui_ImplVulkan_SetupRenderState(ImDrawData* draw_data, VkPipeline
529529 // Setup scale and translation:
530530 // Our visible imgui space lies from draw_data->DisplayPps (top left) to draw_data->DisplayPos+data_data->DisplaySize (bottom right). DisplayPos is (0,0) for single viewport apps.
531531 {
532- float scale[ 2 ];
533- scale[ 0 ] = 2 . 0f / draw_data-> DisplaySize . x ;
534- scale[ 1 ] = 2 .0f / draw_data->DisplaySize .y ;
535- float translate[ 2 ] ;
536- translate[ 0 ] = - 1 . 0f - draw_data-> DisplayPos . x * scale[ 0 ];
537- translate[ 1 ] = -1 .0f - draw_data->DisplayPos .y * scale[ 1 ];
538- vkCmdPushConstants (command_buffer, bd-> PipelineLayout , VK_SHADER_STAGE_VERTEX_BIT, sizeof ( float ) * 0 , sizeof ( float ) * 2 , scale) ;
539- vkCmdPushConstants (command_buffer, bd->PipelineLayout , VK_SHADER_STAGE_VERTEX_BIT, sizeof ( float ) * 2 , sizeof (float ) * 2 , translate );
532+ float constants[ 4 ];
533+ // Scale
534+ constants[ 0 ] = 2 .0f / draw_data->DisplaySize .x ;
535+ constants[ 1 ] = 2 . 0f / draw_data-> DisplaySize . y ;
536+ // Translate
537+ constants[ 2 ] = -1 .0f - draw_data->DisplayPos .x * constants[ 0 ];
538+ constants[ 3 ] = - 1 . 0f - draw_data-> DisplayPos . y * constants[ 1 ] ;
539+ vkCmdPushConstants (command_buffer, bd->PipelineLayout , VK_SHADER_STAGE_VERTEX_BIT, 0 , sizeof (float ) * 4 , constants );
540540 }
541541}
542542
@@ -1830,7 +1830,7 @@ void ImGui_ImplVulkanH_CreateOrResizeWindow(VkInstance instance, VkPhysicalDevic
18301830 VkCommandPoolCreateInfo pool_info = {};
18311831 pool_info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
18321832 pool_info.queueFamilyIndex = queue_family;
1833- pool_info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT ;
1833+ pool_info.flags = VK_COMMAND_POOL_CREATE_TRANSIENT_BIT ;
18341834 VkResult err = vkCreateCommandPool (device, &pool_info, allocator, &command_pool);
18351835 check_vk_result (err);
18361836
0 commit comments