Skip to content

Commit

Permalink
Add VK_EXT_pageable_device_local_memory support
Browse files Browse the repository at this point in the history
  • Loading branch information
whyb committed Dec 25, 2023
1 parent e56cc3a commit 091c609
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ class GpuInfoPrivate
int support_VK_EXT_descriptor_indexing;
int support_VK_EXT_memory_budget;
int support_VK_EXT_memory_priority;
int support_VK_EXT_pageable_device_local_memory;
int support_VK_EXT_queue_family_foreign;
int support_VK_AMD_device_coherent_memory;
#if __ANDROID_API__ >= 26
Expand Down Expand Up @@ -774,6 +775,11 @@ int GpuInfo::support_VK_EXT_memory_priority() const
return d->support_VK_EXT_memory_priority;
}

int GpuInfo::support_VK_EXT_pageable_device_local_memory() const
{
return d->support_VK_EXT_pageable_device_local_memory;
}

int GpuInfo::support_VK_EXT_queue_family_foreign() const
{
return d->support_VK_EXT_queue_family_foreign;
Expand Down Expand Up @@ -1675,6 +1681,7 @@ int create_gpu_instance(const char* driver_path)
gpu_info.support_VK_EXT_descriptor_indexing = 0;
gpu_info.support_VK_EXT_memory_budget = 0;
gpu_info.support_VK_EXT_memory_priority = 0;
gpu_info.support_VK_EXT_pageable_device_local_memory = 0;
gpu_info.support_VK_EXT_queue_family_foreign = 0;
gpu_info.support_VK_AMD_device_coherent_memory = 0;
#if __ANDROID_API__ >= 26
Expand Down Expand Up @@ -1736,6 +1743,8 @@ int create_gpu_instance(const char* driver_path)
gpu_info.support_VK_EXT_memory_budget = exp.specVersion;
else if (strcmp(exp.extensionName, "VK_EXT_memory_priority") == 0)
gpu_info.support_VK_EXT_memory_priority = exp.specVersion;
else if (strcmp(exp.extensionName, "VK_EXT_pageable_device_local_memory") == 0)
gpu_info.support_VK_EXT_pageable_device_local_memory = exp.specVersion;
else if (strcmp(exp.extensionName, "VK_EXT_queue_family_foreign") == 0)
gpu_info.support_VK_EXT_queue_family_foreign = exp.specVersion;
else if (strcmp(exp.extensionName, "VK_AMD_device_coherent_memory") == 0)
Expand Down Expand Up @@ -2452,6 +2461,8 @@ VulkanDevice::VulkanDevice(int device_index)
enabledExtensions.push_back("VK_EXT_memory_budget");
if (info.support_VK_EXT_memory_priority())
enabledExtensions.push_back("VK_EXT_memory_priority");
if (info.support_VK_EXT_pageable_device_local_memory())
enabledExtensions.push_back("VK_EXT_pageable_device_local_memory");
if (info.support_VK_EXT_queue_family_foreign())
enabledExtensions.push_back("VK_EXT_queue_family_foreign");
if (info.support_VK_AMD_device_coherent_memory())
Expand Down
1 change: 1 addition & 0 deletions src/gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ class NCNN_EXPORT GpuInfo
int support_VK_EXT_descriptor_indexing() const;
int support_VK_EXT_memory_budget() const;
int support_VK_EXT_memory_priority() const;
int support_VK_EXT_pageable_device_local_memory() const;
int support_VK_EXT_queue_family_foreign() const;
int support_VK_AMD_device_coherent_memory() const;
#if __ANDROID_API__ >= 26
Expand Down

0 comments on commit 091c609

Please sign in to comment.