Vulkan dispatchable objects
Vulkan has a few dispatchable objects: Instance, Device, Physical Device,
Command Buffer and Queue. These objects, when loaded through an ICD, are
constrained to have a bit of memory allocated at the beginning of these
objects to contain loader data.
In order to do this, a wrapper class, DispatchableObject, was created to handle
pointing directly to the loader data when casting to the associated VK handle
and similarly back to a pointer to the internal object. Note that Queue, being
allocated within another object, and not directly through the API, simply have
the loader data at the beginning of the class, without requiring a wrapper class.
Also, since all these object are allocated through a custom placement new
operator, they have to be deallocated through an associated destroy() function,
so the DispatchableObject destructor is deleted, in order to prevent these
objects from being released any other way.
Bug b/116336664
Change-Id: Iac749f6adcba0eaf7557f0df876ac0474081d9cc
Reviewed-on: https://swiftshader-review.googlesource.com/c/20948Tested-by:
Alexis Hétu <sugoi@google.com>
Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
Showing
src/Vulkan/VkCommandBuffer.cpp
0 → 100644
src/Vulkan/VkCommandBuffer.hpp
0 → 100644
src/Vulkan/VkConfig.h
0 → 100644
src/Vulkan/VkDevice.cpp
0 → 100644
src/Vulkan/VkDevice.hpp
0 → 100644
src/Vulkan/VkInstance.cpp
0 → 100644
src/Vulkan/VkInstance.hpp
0 → 100644
src/Vulkan/VkMemory.cpp
0 → 100644
src/Vulkan/VkMemory.h
0 → 100644
src/Vulkan/VkObject.hpp
0 → 100644
src/Vulkan/VkPhysicalDevice.cpp
0 → 100644
This diff is collapsed.
Click to expand it.
src/Vulkan/VkPhysicalDevice.hpp
0 → 100644
src/Vulkan/VkQueue.cpp
0 → 100644
src/Vulkan/VkQueue.hpp
0 → 100644
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to comment