Backends: Vulkan: Added support for specifying multisample count. (#2705, #2706)

This commit is contained in:
Vilya Harvey 2019-07-31 19:50:50 +01:00 committed by omar
parent 6cf4743f17
commit 62143dff64
3 changed files with 9 additions and 1 deletions

View File

@ -36,6 +36,9 @@ HOW TO UPDATE?
Other Changes: Other Changes:
- Backends: DX11: Fixed GSGetShader() call not passing an initialized instance count, - Backends: DX11: Fixed GSGetShader() call not passing an initialized instance count,
would generally make the debug layer complain (Added in 1.72). would generally make the debug layer complain (Added in 1.72).
- Backends: Vulkan: Added support for specifying multisample count.
Set ImGui_ImplVulkan_InitInfo::MSAASamples to one of the VkSampleCountFlagBits values
to use, default is non-multisampled as before. (#2705, #2706) [@vilya]
----------------------------------------------------------------------- -----------------------------------------------------------------------

View File

@ -22,6 +22,7 @@
// CHANGELOG // CHANGELOG
// (minor and older changes stripped away, please see git history for details) // (minor and older changes stripped away, please see git history for details)
// 2019-08-01: Vulkan: Added support for specifying multisample count. Set ImGui_ImplVulkan_InitInfo::MSAASamples to one of the VkSampleCountFlagBits values to use, default is non-multisampled as before.
// 2019-05-29: Vulkan: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-05-29: Vulkan: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag.
// 2019-04-30: Vulkan: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. // 2019-04-30: Vulkan: Added support for special ImDrawCallback_ResetRenderState callback to reset render state.
// 2019-04-04: *BREAKING CHANGE*: Vulkan: Added ImageCount/MinImageCount fields in ImGui_ImplVulkan_InitInfo, required for initialization (was previously a hard #define IMGUI_VK_QUEUED_FRAMES 2). Added ImGui_ImplVulkan_SetMinImageCount(). // 2019-04-04: *BREAKING CHANGE*: Vulkan: Added ImageCount/MinImageCount fields in ImGui_ImplVulkan_InitInfo, required for initialization (was previously a hard #define IMGUI_VK_QUEUED_FRAMES 2). Added ImGui_ImplVulkan_SetMinImageCount().
@ -721,7 +722,10 @@ bool ImGui_ImplVulkan_CreateDeviceObjects()
VkPipelineMultisampleStateCreateInfo ms_info = {}; VkPipelineMultisampleStateCreateInfo ms_info = {};
ms_info.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; ms_info.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
ms_info.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT; if (v->MSAASamples != 0)
ms_info.rasterizationSamples = v->MSAASamples;
else
ms_info.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
VkPipelineColorBlendAttachmentState color_attachment[1] = {}; VkPipelineColorBlendAttachmentState color_attachment[1] = {};
color_attachment[0].blendEnable = VK_TRUE; color_attachment[0].blendEnable = VK_TRUE;

View File

@ -37,6 +37,7 @@ struct ImGui_ImplVulkan_InitInfo
VkDescriptorPool DescriptorPool; VkDescriptorPool DescriptorPool;
uint32_t MinImageCount; // >= 2 uint32_t MinImageCount; // >= 2
uint32_t ImageCount; // >= MinImageCount uint32_t ImageCount; // >= MinImageCount
VkSampleCountFlagBits MSAASamples; // >= VK_SAMPLE_COUNT_1_BIT
const VkAllocationCallbacks* Allocator; const VkAllocationCallbacks* Allocator;
void (*CheckVkResultFn)(VkResult err); void (*CheckVkResultFn)(VkResult err);
}; };