Etterna 0.75.1
Loading...
Searching...
No Matches
Texture.h
1#ifndef RENDERER_VK_TEXTURE_H
2#define RENDERER_VK_TEXTURE_H
3
4#include <vulkan/vulkan_raii.hpp>
5#include <vk_mem_alloc.h>
6#include <RageUtil/Graphics/RageSurface.h>
7#include "PersistentBuffer.h"
8
9struct Texture
10{
11 enum
12 {
13 Wrapping = 0b01,
14 Filtering = 0b10,
15 PossibleSamplerCount = 4,
16 MaxTextures = 1 << 15,
17 };
18 VmaAllocation allocation = nullptr;
19 VmaAllocator allocator = nullptr;
20 vk::Image image = {};
21 vk::ImageView view = nullptr;
22 uint32_t width = 0;
23 uint32_t height = 0;
24 bool initialized = false;
25 bool dirty = false;
26 vk::ImageLayout currentLayout = vk::ImageLayout::eUndefined;
27
28 // used to temporarily store RageSurface data to not rely on ownership shenanigans
29 PersistentBuffer imageBuffer;
30
31 void InitImageBuffer();
32 void DestroyImageBuffer();
33};
34
35#endif
Definition PersistentBuffer.h:8
Definition Texture.h:10