Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a90ce61c authored by Courtney Goeltzenleuchter's avatar Courtney Goeltzenleuchter Committed by Jesse Hall
Browse files

loader: Implement new layer initialization

We now call down the instance and device chains
as part of the creation process. The loader puts
together "LinkInfo" structures that each layer
uses to reference the next layer down in the stack.
These info structures are attached to the CreateInfo
pNext structure. Also have an info structure that
the loader terminator functions (CreateInstance_Bottom
and CreateDevice_Bottom) that includes loader state
they need.
As part of this the CreateDevice function now lives
on the device chain and it has been split into
Top and Bottom functions. Top builds the LinkInfo
structures and Bottom makes the actual call to the ICD
to create the device object.

Change-Id: I5f5a6d579c34942511cce288ba8fa51f9f89f67f
(cherry picked from commit 90910952)
parent eff63118
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -560,6 +560,7 @@ bool LoadDriverDispatchTable(VkInstance instance,
       objects */}}
  {{else if eq $.Name "vkGetDeviceQueue"}}true
  {{else if eq $.Name "vkAllocateCommandBuffers"}}true
  {{else if eq $.Name "vkCreateDevice"}}true

  {{/* vkDestroy for dispatchable objects needs to handle VK_NULL_HANDLE;
       trying to dispatch through that would crash. */}}
+2 −1
Original line number Diff line number Diff line
@@ -211,6 +211,7 @@ const NameProc kLoaderGlobalProcs[] = {
const NameProc kLoaderTopProcs[] = {
    // clang-format off
    {"vkAllocateCommandBuffers", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkAllocateCommandBuffers>(AllocateCommandBuffers_Top))},
    {"vkCreateDevice", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateDevice>(CreateDevice_Top))},
    {"vkCreateInstance", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateInstance>(CreateInstance_Top))},
    {"vkDestroyDevice", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyDevice>(DestroyDevice_Top))},
    {"vkDestroyInstance", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyInstance>(DestroyInstance_Top))},
@@ -1401,7 +1402,7 @@ VKAPI_ATTR VkResult vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice ph

__attribute__((visibility("default")))
VKAPI_ATTR VkResult vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) {
    return GetDispatchTable(physicalDevice).CreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice);
    return CreateDevice_Top(physicalDevice, pCreateInfo, pAllocator, pDevice);
}

__attribute__((visibility("default")))