vk: Add basic support for honeykrisp driver

This commit is contained in:
kd-11 2024-12-21 18:41:21 +03:00 committed by kd-11
parent a196bbcbcd
commit b44e2d3b30
6 changed files with 29 additions and 4 deletions

View File

@ -96,6 +96,7 @@ namespace vk
optimal_group_size = 64;
break;
case vk::driver_vendor::MVK:
case vk::driver_vendor::HONEYKRISP:
unroll_loops = true;
optimal_kernel_size = 1;
optimal_group_size = 256;

View File

@ -139,6 +139,9 @@ namespace vk
rsx_log.error("Dozen is currently unsupported. How did you even get this to run outside windows?");
#endif
break;
case driver_vendor::HONEYKRISP:
// Needs more testing
break;
default:
rsx_log.warning("Unsupported device: %s", gpu_name);
}

View File

@ -103,7 +103,11 @@ namespace vk
if (vendor_id == 0x106B)
{
return chip_class::MVK_apple;
#ifdef __APPLE__
return chip_class::APPLE_MVK;
#else
return chip_class::APPLE_HK_generic; // Lazy, but at the moment we don't care about the differences in M1, M2, M3, M4, etc
#endif
}
if (vendor_id == 0x8086)

View File

@ -31,7 +31,9 @@ namespace vk
_NV_ENUM_MAX_, // Do not insert NV enums beyond this point
// APPLE
MVK_apple,
APPLE_HK_generic,
APPLE_MVK,
_APPLE_ENUM_MAX, // Do not insert APPLE enums beyond this point
// INTEL
INTEL_generic,
@ -51,7 +53,8 @@ namespace vk
DOZEN,
LAVAPIPE,
NVK,
V3DV
V3DV,
HONEYKRISP
};
driver_vendor get_driver_vendor();

View File

@ -297,6 +297,11 @@ namespace vk
return driver_vendor::V3DV;
}
if (gpu_name.find("Apple") != umax)
{
return driver_vendor::HONEYKRISP;
}
return driver_vendor::unknown;
}
else
@ -322,6 +327,8 @@ namespace vk
return driver_vendor::NVK;
case VK_DRIVER_ID_MESA_V3DV:
return driver_vendor::V3DV;
case VK_DRIVER_ID_MESA_HONEYKRISP:
return driver_vendor::HONEYKRISP;
default:
// Mobile?
return driver_vendor::unknown;

View File

@ -9,17 +9,19 @@ namespace vk
{
VkQueryPool m_query_pool;
VkDevice m_device;
u32 m_size;
public:
query_pool(VkDevice dev, VkQueryType type, u32 size)
: m_query_pool(VK_NULL_HANDLE)
, m_device(dev)
, m_size(size)
{
VkQueryPoolCreateInfo info{};
info.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO;
info.queryType = type;
info.queryCount = size;
vkCreateQueryPool(dev, &info, nullptr, &m_query_pool);
CHECK_RESULT(vkCreateQueryPool(dev, &info, nullptr, &m_query_pool));
// Take 'size' references on this object
ref_count.release(static_cast<s32>(size));
@ -34,5 +36,10 @@ namespace vk
{
return m_query_pool;
}
inline u32 size() const
{
return m_size;
}
};
}