@@ -739,72 +739,6 @@ static void ImGui_ImplVulkan_CreateShaderModules(VkDevice device, const VkAlloca
739
739
}
740
740
}
741
741
742
- static void ImGui_ImplVulkan_CreateFontSampler (VkDevice device, const VkAllocationCallbacks* allocator)
743
- {
744
- ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData ();
745
- if (bd->FontSampler )
746
- return ;
747
-
748
- // Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling.
749
- VkSamplerCreateInfo info = {};
750
- info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
751
- info.magFilter = VK_FILTER_LINEAR;
752
- info.minFilter = VK_FILTER_LINEAR;
753
- info.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR;
754
- info.addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT;
755
- info.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT;
756
- info.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT;
757
- info.minLod = -1000 ;
758
- info.maxLod = 1000 ;
759
- info.maxAnisotropy = 1 .0f ;
760
- VkResult err = vkCreateSampler (device, &info, allocator, &bd->FontSampler );
761
- check_vk_result (err);
762
- }
763
-
764
- static void ImGui_ImplVulkan_CreateDescriptorSetLayout (VkDevice device, const VkAllocationCallbacks* allocator)
765
- {
766
- ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData ();
767
- if (bd->DescriptorSetLayout )
768
- return ;
769
-
770
- ImGui_ImplVulkan_CreateFontSampler (device, allocator);
771
- VkSampler sampler[1 ] = { bd->FontSampler };
772
- VkDescriptorSetLayoutBinding binding[1 ] = {};
773
- binding[0 ].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
774
- binding[0 ].descriptorCount = 1 ;
775
- binding[0 ].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT;
776
- binding[0 ].pImmutableSamplers = sampler;
777
- VkDescriptorSetLayoutCreateInfo info = {};
778
- info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
779
- info.bindingCount = 1 ;
780
- info.pBindings = binding;
781
- VkResult err = vkCreateDescriptorSetLayout (device, &info, allocator, &bd->DescriptorSetLayout );
782
- check_vk_result (err);
783
- }
784
-
785
- static void ImGui_ImplVulkan_CreatePipelineLayout (VkDevice device, const VkAllocationCallbacks* allocator)
786
- {
787
- ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData ();
788
- if (bd->PipelineLayout )
789
- return ;
790
-
791
- // Constants: we are using 'vec2 offset' and 'vec2 scale' instead of a full 3d projection matrix
792
- ImGui_ImplVulkan_CreateDescriptorSetLayout (device, allocator);
793
- VkPushConstantRange push_constants[1 ] = {};
794
- push_constants[0 ].stageFlags = VK_SHADER_STAGE_VERTEX_BIT;
795
- push_constants[0 ].offset = sizeof (float ) * 0 ;
796
- push_constants[0 ].size = sizeof (float ) * 4 ;
797
- VkDescriptorSetLayout set_layout[1 ] = { bd->DescriptorSetLayout };
798
- VkPipelineLayoutCreateInfo layout_info = {};
799
- layout_info.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
800
- layout_info.setLayoutCount = 1 ;
801
- layout_info.pSetLayouts = set_layout;
802
- layout_info.pushConstantRangeCount = 1 ;
803
- layout_info.pPushConstantRanges = push_constants;
804
- VkResult err = vkCreatePipelineLayout (device, &layout_info, allocator, &bd->PipelineLayout );
805
- check_vk_result (err);
806
- }
807
-
808
742
static void ImGui_ImplVulkan_CreatePipeline (VkDevice device, const VkAllocationCallbacks* allocator, VkPipelineCache pipelineCache, VkRenderPass renderPass, VkSampleCountFlagBits MSAASamples, VkPipeline* pipeline, uint32_t subpass)
809
743
{
810
744
ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData ();
@@ -889,8 +823,6 @@ static void ImGui_ImplVulkan_CreatePipeline(VkDevice device, const VkAllocationC
889
823
dynamic_state.dynamicStateCount = (uint32_t )IM_ARRAYSIZE (dynamic_states);
890
824
dynamic_state.pDynamicStates = dynamic_states;
891
825
892
- ImGui_ImplVulkan_CreatePipelineLayout (device, allocator);
893
-
894
826
VkGraphicsPipelineCreateInfo info = {};
895
827
info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
896
828
info.flags = bd->PipelineCreateFlags ;
@@ -919,6 +851,7 @@ bool ImGui_ImplVulkan_CreateDeviceObjects()
919
851
920
852
if (!bd->FontSampler )
921
853
{
854
+ // Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling.
922
855
VkSamplerCreateInfo info = {};
923
856
info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
924
857
info.magFilter = VK_FILTER_LINEAR;
0 commit comments