Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions vulkan/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1597,11 +1597,13 @@ bool Context::create_device(VkPhysicalDevice gpu_, VkSurfaceKHR surface,
enabled_extensions.push_back(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME);
}

#ifndef __APPLE__
if (has_extension(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME))
{
enabled_extensions.push_back(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME);
ADD_CHAIN(ext.barycentric_features, FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR);
}
#endif

if (ext.supports_video_queue && has_extension(VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME))
{
Expand Down
5 changes: 5 additions & 0 deletions vulkan/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,11 @@ void Device::init_workarounds()
// Events are not supported in MoltenVK.
// TODO: Use VK_KHR_portability_subset to determine this.
workarounds.emulate_event_as_pipeline_barrier = true;
if (ext.vk13_features.synchronization2)
{
LOGW("Disabling synchronization2 on Metal emulation.\n");
ext.vk13_features.synchronization2 = VK_FALSE;
}
LOGW("Emulating events as pipeline barriers on Metal emulation.\n");
LOGW("Disabling push descriptors on Metal emulation.\n");
#else
Expand Down
27 changes: 13 additions & 14 deletions vulkan/wsi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,20 @@ bool WSI::init_context_from_platform(unsigned num_thread_indices, const Context:
new_context->set_num_thread_indices(num_thread_indices);
new_context->set_system_handles(system_handles);

if (!new_context->init_instance(
instance_ext.data(), instance_ext.size(),
CONTEXT_CREATION_ENABLE_ADVANCED_WSI_BIT |
CONTEXT_CREATION_ENABLE_PUSH_DESCRIPTOR_BIT |
CONTEXT_CREATION_ENABLE_DESCRIPTOR_BUFFER_BIT |
ContextCreationFlags context_flags = video_context_flags;

#ifndef __APPLE__
context_flags |= CONTEXT_CREATION_ENABLE_ADVANCED_WSI_BIT |
CONTEXT_CREATION_ENABLE_PUSH_DESCRIPTOR_BIT |
CONTEXT_CREATION_ENABLE_DESCRIPTOR_BUFFER_BIT;
#endif

#ifdef GRANITE_VULKAN_SYSTEM_HANDLES
CONTEXT_CREATION_ENABLE_PIPELINE_BINARY_BIT |
context_flags |= CONTEXT_CREATION_ENABLE_PIPELINE_BINARY_BIT;
#endif
video_context_flags))

if (!new_context->init_instance(
instance_ext.data(), instance_ext.size(), context_flags))
{
LOGE("Failed to create Vulkan instance.\n");
return false;
Expand All @@ -387,13 +392,7 @@ bool WSI::init_context_from_platform(unsigned num_thread_indices, const Context:
bool ret = new_context->init_device(
VK_NULL_HANDLE, tmp_surface,
device_ext.data(), device_ext.size(),
CONTEXT_CREATION_ENABLE_ADVANCED_WSI_BIT |
CONTEXT_CREATION_ENABLE_PUSH_DESCRIPTOR_BIT |
CONTEXT_CREATION_ENABLE_DESCRIPTOR_BUFFER_BIT |
#ifdef GRANITE_VULKAN_SYSTEM_HANDLES
CONTEXT_CREATION_ENABLE_PIPELINE_BINARY_BIT |
#endif
video_context_flags);
context_flags);

if (tmp_surface)
platform->destroy_surface(new_context->get_instance(), tmp_surface);
Expand Down