-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6021c2d
commit 95992c4
Showing
11 changed files
with
581 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
source/vulkan_renderer/lib/inc/tactile/vulkan_renderer/vulkan_texture.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (C) 2024 Albin Johansson (GNU General Public License v3.0) | ||
|
||
#pragma once | ||
|
||
#include <expected> // expected | ||
#include <filesystem> // path | ||
|
||
#include <vk_mem_alloc.h> | ||
#include <vulkan/vulkan.h> | ||
|
||
#include "tactile/base/prelude.hpp" | ||
#include "tactile/base/render/texture.hpp" | ||
#include "tactile/vulkan_renderer/api.hpp" | ||
#include "tactile/vulkan_renderer/vulkan_image.hpp" | ||
#include "vulkan_image_view.hpp" | ||
|
||
namespace tactile { | ||
|
||
class TACTILE_VULKAN_API VulkanTexture final : public ITexture | ||
{ | ||
public: | ||
[[nodiscard]] | ||
auto get_handle() const -> void* override; | ||
|
||
[[nodiscard]] | ||
auto get_size() const -> TextureSize override; | ||
|
||
[[nodiscard]] | ||
auto get_path() const -> const std::filesystem::path& override; | ||
|
||
VulkanImage image {}; | ||
VulkanImageView view {}; | ||
std::filesystem::path path {}; | ||
void* imgui_handle {}; | ||
}; | ||
|
||
[[nodiscard]] | ||
TACTILE_VULKAN_API auto load_vulkan_texture(VkDevice device, | ||
VkQueue queue, | ||
VkCommandPool command_pool, | ||
VmaAllocator allocator, | ||
VkSampler sampler, | ||
const std::filesystem::path& image_path) | ||
-> std::expected<VulkanTexture, VkResult>; | ||
|
||
} // namespace tactile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.