mirror of
https://gitea.windcorp.ru/Wind-Corporation/Progressia.git
synced 2025-10-14 21:33:12 +03:00
Initial commit
This commit is contained in:
60
desktop/graphics/vulkan_image.h
Normal file
60
desktop/graphics/vulkan_image.h
Normal file
@@ -0,0 +1,60 @@
|
||||
#pragma once
|
||||
|
||||
#include <boost/core/noncopyable.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "vulkan_buffer.h"
|
||||
#include "vulkan_common.h"
|
||||
|
||||
#include "../../main/rendering/image.h"
|
||||
|
||||
namespace progressia {
|
||||
namespace desktop {
|
||||
|
||||
class Image : public VkObjectWrapper {
|
||||
public:
|
||||
VkImage vk;
|
||||
VkImageView view;
|
||||
VkFormat format;
|
||||
|
||||
Image(VkImage, VkImageView, VkFormat);
|
||||
virtual ~Image();
|
||||
};
|
||||
|
||||
class ManagedImage : public Image {
|
||||
|
||||
public:
|
||||
VkDeviceMemory memory;
|
||||
Vulkan &vulkan;
|
||||
|
||||
struct State {
|
||||
VkImageLayout layout;
|
||||
VkAccessFlags accessMask;
|
||||
VkPipelineStageFlags stageMask;
|
||||
};
|
||||
|
||||
private:
|
||||
State state;
|
||||
|
||||
public:
|
||||
ManagedImage(std::size_t width, std::size_t height, VkFormat,
|
||||
VkImageAspectFlags, VkImageUsageFlags, Vulkan &);
|
||||
~ManagedImage();
|
||||
|
||||
void transition(State);
|
||||
};
|
||||
|
||||
class Texture : public ManagedImage {
|
||||
|
||||
public:
|
||||
VkSampler sampler;
|
||||
VkDescriptorSet descriptorSet;
|
||||
|
||||
Texture(const progressia::main::Image &, Vulkan &vulkan);
|
||||
~Texture();
|
||||
|
||||
void bind();
|
||||
};
|
||||
|
||||
} // namespace desktop
|
||||
} // namespace progressia
|
Reference in New Issue
Block a user