sandbox
Loading...
Searching...
No Matches
query_pool.hpp
1// SPDX-License-Identifier: MIT
2#ifndef LIBSBX_GRAPHICS_DEVICES_QUERY_POOL_HPP_
3#define LIBSBX_GRAPHICS_DEVICES_QUERY_POOL_HPP_
4
5#include <vulkan/vulkan.h>
6
7#include <libsbx/units/time.hpp>
8
9#include <libsbx/graphics/commands/command_buffer.hpp>
10#include <libsbx/graphics/devices/logical_device.hpp>
11
12namespace sbx::graphics {
13
15
16public:
17
18 using handle_type = VkQueryPool;
19
20 query_pool(const logical_device& logical_device, const VkQueryType type, const std::uint32_t query_count);
21
22 query_pool(const query_pool&) = delete;
23
25
26 auto operator=(const query_pool&) -> query_pool& = delete;
27
28 auto handle() const -> handle_type;
29
30 operator handle_type() const;
31
32 auto reset(command_buffer& command_buffer, std::uint32_t first_query = 0u, std::uint32_t count = 0u) const -> void;
33
34 auto write_timestamp(command_buffer& command_buffer, const VkPipelineStageFlagBits stage, const std::uint32_t query_index) const -> void;
35
36 auto get_duration(const std::uint32_t begin, const std::uint32_t end) const -> units::millisecond;
37
38private:
39
40 handle_type _handle;
41 VkQueryType _type;
42 std::uint32_t _query_count;
43
44}; // class query_pool
45
46} // namespace sbx::graphics
47
48#endif // LIBSBX_GRAPHICS_DEVICES_QUERY_POOL_HPP_
Definition: command_buffer.hpp:15
Definition: logical_device.hpp:61
Definition: query_pool.hpp:14
Definition: quantity.hpp:66