-
Vulkan dispatchable objects · 767b41b1Alexis Hetu authored
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>
767b41b1
×