Reduce the complexity of VkNonDispatchableHandle
- Simplified VkNonDispatchableHandle as much as possible so
that it's just a wrapper over a uint64_t
- Centralized casting logic in vkObject.hpp
- Explicitly changed "Cast" to "vk::Cast" to differentiate
from vk::<object>::Cast
- Moved VkDescriptorSet operators from VulkanPlatform.h to
VkDescriptorPool.cpp
Bug b/129979580
Change-Id: I4fe5fcfe56029c21594088d274bae862999597ad
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/32928
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Vulkan/VkPipeline.hpp b/src/Vulkan/VkPipeline.hpp
index 0a11eb1..eba4b36 100644
--- a/src/Vulkan/VkPipeline.hpp
+++ b/src/Vulkan/VkPipeline.hpp
@@ -38,7 +38,12 @@
operator VkPipeline()
{
- return reinterpret_cast<VkPipeline::HandleType>(this);
+ return vk::TtoVkT<Pipeline, VkPipeline>(this);
+ }
+
+ static inline Pipeline* Cast(VkPipeline object)
+ {
+ return vk::VkTtoT<Pipeline, VkPipeline>(object);
}
void destroy(const VkAllocationCallbacks* pAllocator)
@@ -124,7 +129,7 @@
static inline Pipeline* Cast(VkPipeline object)
{
- return reinterpret_cast<Pipeline*>(object.get());
+ return Pipeline::Cast(object);
}
} // namespace vk