mirror of
https://github.com/elwrcl/copnix.git
synced 2026-10-31 22:28:03 +03:00
vk patch
This commit is contained in:
2 files changed
+1
-166
No files matched your search
@@ -41,22 +41,16 @@ HaVK14_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
|
||||
link = (VkLayerInstanceCreateInfo *)link->pNext;
|
||||
|
||||
if (!link) return VK_ERROR_INITIALIZATION_FAILED;
|
||||
|
||||
g_next_gipa = link->u.pLayerInfo->pfnNextGetInstanceProcAddr;
|
||||
link->u.pLayerInfo = link->u.pLayerInfo->pNext;
|
||||
|
||||
PFN_vkCreateInstance next_ci =
|
||||
(PFN_vkCreateInstance)g_next_gipa(NULL, "vkCreateInstance");
|
||||
|
||||
VkResult res = next_ci(pCreateInfo, pAllocator, pInstance);
|
||||
if (res != VK_SUCCESS) return res;
|
||||
|
||||
g_next_gdp = (PFN_vkGetPhysicalDeviceProperties)
|
||||
g_next_gipa(*pInstance, "vkGetPhysicalDeviceProperties");
|
||||
|
||||
g_next_gdp2 = (PFN_vkGetPhysicalDeviceProperties2)
|
||||
g_next_gipa(*pInstance, "vkGetPhysicalDeviceProperties2");
|
||||
|
||||
if (!g_next_gdp2) {
|
||||
g_next_gdp2 = (PFN_vkGetPhysicalDeviceProperties2)
|
||||
g_next_gipa(*pInstance, "vkGetPhysicalDeviceProperties2KHR");
|
||||
@@ -70,12 +64,8 @@ HaVK14_GetPhysicalDeviceProperties(VkPhysicalDevice device,
|
||||
VkPhysicalDeviceProperties *props)
|
||||
{
|
||||
if (g_next_gdp) g_next_gdp(device, props);
|
||||
|
||||
if (props && is_intel_below_14(props->vendorID, props->apiVersion)) {
|
||||
props->apiVersion = HASVK14_API_VERSION;
|
||||
|
||||
strncpy(props->deviceName, "Intel(R) HD Graphics 9000 (IVB GT2)", VK_MAX_PHYSICAL_DEVICE_NAME_SIZE - 1);
|
||||
props->deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE - 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,17 +74,11 @@ HaVK14_GetPhysicalDeviceProperties2(VkPhysicalDevice device,
|
||||
VkPhysicalDeviceProperties2 *props2)
|
||||
{
|
||||
if (g_next_gdp2) g_next_gdp2(device, props2);
|
||||
|
||||
if (!props2) return;
|
||||
|
||||
VkPhysicalDeviceProperties *props = &props2->properties;
|
||||
if (!is_intel_below_14(props->vendorID, props->apiVersion)) return;
|
||||
|
||||
props->apiVersion = HASVK14_API_VERSION;
|
||||
|
||||
strncpy(props->deviceName, "Intel(R) HD Graphics 9000 (IVB GT2)", VK_MAX_PHYSICAL_DEVICE_NAME_SIZE - 1);
|
||||
props->deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE - 1] = '\0';
|
||||
|
||||
VkBaseOutStructure *s = (VkBaseOutStructure *)props2->pNext;
|
||||
while (s) {
|
||||
if (s->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES) {
|
||||
@@ -114,6 +98,7 @@ HaVK14_GetPhysicalDeviceProperties2(VkPhysicalDevice device,
|
||||
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
|
||||
HaVK14_GetInstanceProcAddr(VkInstance instance, const char *pName)
|
||||
{
|
||||
|
||||
#define INTERCEPT(fn) \
|
||||
if (strcmp(pName, "vk" #fn) == 0) return (PFN_vkVoidFunction)HaVK14_##fn;
|
||||
|
||||
|
||||
Reference in new issue
Block a user