-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuffer_streams16.cppm
More file actions
44 lines (32 loc) · 1.06 KB
/
buffer_streams16.cppm
File metadata and controls
44 lines (32 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module;
#include <vulkan/vulkan.h>
#include <span>
#include <array>
#include <cstring>
export module vk:buffer_streams16;
export import :types;
export import :utilities;
export namespace vk {
inline namespace v1 {
/**
* @brief buffer stream for streaming arbitrary buffers of 32-bytes
*/
class buffer_stream16 {
public:
buffer_stream16() = default;
buffer_stream16(const VkDevice& p_device, const buffer_parameters& p_params);
/**
* @brief write arbitrary buffer of 32-bytes to GPU-memory
*/
void write(std::span<const uint16_t> p_data);
void copy_to_image(const VkCommandBuffer& p_command, const VkImage& p_image, image_extent p_extent);
void destroy();
operator VkBuffer() { return m_handle; }
operator VkBuffer() const { return m_handle; }
private:
VkDevice m_device=nullptr;
VkDeviceMemory m_device_memory=nullptr;
VkBuffer m_handle=nullptr;
};
};
};