externals: Update MoltenVK (#2492)

This commit is contained in:
squidbus 2025-02-21 02:41:36 -08:00 committed by GitHub
parent 745cdd89fd
commit 5b3e156197
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 16 additions and 8 deletions

@ -1 +1 @@
Subproject commit 0c090001cb42997031cfe43914340e2639944972 Subproject commit 2048427e50f9eb20f2b8f98d316ecaee398c9b91

@ -1 +1 @@
Subproject commit 1a7b7ef6de02cf6767e42b10ddad217c45e90d47 Subproject commit 2c32b6bf86f3c4a5539aa1f0bacbd59fe61759cf

View file

@ -247,9 +247,7 @@ bool Instance::CreateDevice() {
add_extension(VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME); add_extension(VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME);
add_extension(VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME); add_extension(VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME);
add_extension(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); add_extension(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME);
// Currently causes issues with Reshade on AMD proprietary, disable until figured out. add_extension(VK_EXT_TOOLING_INFO_EXTENSION_NAME);
tooling_info = GetDriverID() != vk::DriverId::eAmdProprietary &&
add_extension(VK_EXT_TOOLING_INFO_EXTENSION_NAME);
const bool maintenance4 = add_extension(VK_KHR_MAINTENANCE_4_EXTENSION_NAME); const bool maintenance4 = add_extension(VK_KHR_MAINTENANCE_4_EXTENSION_NAME);
add_extension(VK_KHR_SWAPCHAIN_EXTENSION_NAME); add_extension(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
@ -539,7 +537,8 @@ void Instance::CollectDeviceParameters() {
} }
void Instance::CollectToolingInfo() { void Instance::CollectToolingInfo() {
if (!tooling_info) { if (GetDriverID() == vk::DriverId::eAmdProprietary) {
// Currently causes issues with Reshade on AMD proprietary, disabled until fix released.
return; return;
} }
const auto [tools_result, tools] = physical_device.getToolPropertiesEXT(); const auto [tools_result, tools] = physical_device.getToolPropertiesEXT();

View file

@ -333,7 +333,6 @@ private:
bool shader_stencil_export{}; bool shader_stencil_export{};
bool image_load_store_lod{}; bool image_load_store_lod{};
bool amd_gcn_shader{}; bool amd_gcn_shader{};
bool tooling_info{};
bool portability_subset{}; bool portability_subset{};
}; };

View file

@ -278,6 +278,7 @@ vk::UniqueInstance CreateInstance(Frontend::WindowSystemType window_type, bool e
vk::Bool32 enable_force_barriers = vk::True; vk::Bool32 enable_force_barriers = vk::True;
#ifdef __APPLE__ #ifdef __APPLE__
const vk::Bool32 mvk_debug_mode = enable_crash_diagnostic ? vk::True : vk::False; const vk::Bool32 mvk_debug_mode = enable_crash_diagnostic ? vk::True : vk::False;
constexpr vk::Bool32 mvk_use_mtlheap = vk::True;
#endif #endif
const std::array layer_setings = { const std::array layer_setings = {
@ -353,7 +354,16 @@ vk::UniqueInstance CreateInstance(Frontend::WindowSystemType window_type, bool e
.type = vk::LayerSettingTypeEXT::eBool32, .type = vk::LayerSettingTypeEXT::eBool32,
.valueCount = 1, .valueCount = 1,
.pValues = &mvk_debug_mode, .pValues = &mvk_debug_mode,
} },
// Use MTLHeap to back device memory, which among other things allows us to
// use VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT via memory aliasing.
vk::LayerSettingEXT{
.pLayerName = "MoltenVK",
.pSettingName = "MVK_CONFIG_USE_MTLHEAP",
.type = vk::LayerSettingTypeEXT::eBool32,
.valueCount = 1,
.pValues = &mvk_use_mtlheap,
},
#endif #endif
}; };