MCPcopy Create free account
hub / github.com/LibreVR/Revive / ovr_GetDeviceExtensionsVk

Function ovr_GetDeviceExtensionsVk

Revive/REV_CAPI_Vk.cpp:75–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73
74OVR_PUBLIC_FUNCTION(ovrResult)
75ovr_GetDeviceExtensionsVk(
76 ovrGraphicsLuid luid,
77 char* extensionNames,
78 uint32_t* inoutExtensionNamesSize)
79{
80 if (!inoutExtensionNamesSize)
81 ovrError_InvalidParameter;
82
83 std::stringstream extensions;
84 uint32_t required = vr::VRCompositor()->GetVulkanDeviceExtensionsRequired(g_physicalDevice, nullptr, 0);
85 if (required > 0)
86 {
87 std::vector<char> openvrExtensions(required);
88 vr::VRCompositor()->GetVulkanDeviceExtensionsRequired(g_physicalDevice, openvrExtensions.data(), required);
89 extensions << openvrExtensions.data() << ' ';
90 }
91
92 extensions << VK_KHR_SWAPCHAIN_EXTENSION_NAME << ' ';
93 extensions << VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME << ' ';
94 extensions << VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME;
95
96 std::string result = extensions.str();
97 uint32_t size = *inoutExtensionNamesSize;
98 *inoutExtensionNamesSize = (uint32_t)result.size();
99 strncpy(extensionNames, result.c_str(), size);
100 return (result.size() < size) ? ovrSuccess : ovrError_InsufficientArraySize;
101}
102
103OVR_PUBLIC_FUNCTION(ovrResult)
104ovr_GetSessionPhysicalDeviceVk(

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
c_strMethod · 0.80

Tested by

no test coverage detected