[UI] Replace ImmediateTexture handles with pointers + small cleanup

This commit is contained in:
Triang3l
2020-09-27 16:30:53 +03:00
parent f5f8714c3f
commit c2e8c5554d
6 changed files with 8 additions and 23 deletions

View File

@@ -152,7 +152,6 @@ class VulkanImmediateTexture : public ImmediateTexture {
VkResult Initialize(VkDescriptorSetLayout descriptor_set_layout,
VkImageView image_view) {
handle = reinterpret_cast<uintptr_t>(this);
image_view_ = image_view;
VkResult status;
@@ -191,7 +190,6 @@ class VulkanImmediateTexture : public ImmediateTexture {
}
VkResult Initialize(VkDescriptorSetLayout descriptor_set_layout) {
handle = reinterpret_cast<uintptr_t>(this);
VkResult status;
// Create image object.
@@ -824,7 +822,7 @@ void VulkanImmediateDrawer::Draw(const ImmediateDraw& draw) {
}
// Setup texture binding.
auto texture = reinterpret_cast<VulkanImmediateTexture*>(draw.texture_handle);
auto texture = static_cast<VulkanImmediateTexture*>(draw.texture);
if (texture) {
if (texture->layout() != VK_IMAGE_LAYOUT_GENERAL) {
texture->TransitionLayout(current_cmd_buffer_, VK_IMAGE_LAYOUT_GENERAL);