vk_instance: Detect MSAA features

The MSAA _requires_ `sampleRateShading`, and also requires
`VK_KHR_create_renderpass2` and `VK_KHR_depth_stencil_resolve` for the
depth-stencil MSAA resolves.
This commit is contained in:
Wunkolo 2023-11-13 15:24:45 -08:00
parent 55c74f54d5
commit c4fcd93ff9
2 changed files with 9 additions and 0 deletions

View File

@ -448,6 +448,8 @@ bool Instance::CreateDevice() {
add_extension(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
image_format_list = add_extension(VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME);
create_renderpass2 = add_extension(VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME);
depth_stencil_resolve = add_extension(VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME);
shader_stencil_export = add_extension(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME);
external_memory_host = add_extension(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME);
tooling_info = add_extension(VK_EXT_TOOLING_INFO_EXTENSION_NAME);

View File

@ -248,6 +248,11 @@ public:
return triangle_fan_supported;
}
// Returns true when sampleRateShading, VK_KHR_create_renderpass2, VK_KHR_depth_stencil_resolve
bool IsMSAASupported() const {
return features.sampleRateShading && create_renderpass2 && depth_stencil_resolve;
}
/// Returns the minimum vertex stride alignment
u32 GetMinVertexStrideAlignment() const {
return min_vertex_stride_alignment;
@ -318,6 +323,8 @@ private:
bool index_type_uint8{};
bool fragment_shader_interlock{};
bool image_format_list{};
bool create_renderpass2{};
bool depth_stencil_resolve{};
bool pipeline_creation_cache_control{};
bool fragment_shader_barycentric{};
bool shader_stencil_export{};