HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
pipeline_alpha_vertex.hpp
1// Copyright Take Vos 2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "../vector_span.hpp"
8#include "../geometry/axis_aligned_rectangle.hpp"
9#include "../rapid/sfloat_rgba16.hpp"
10#include "../rapid/sfloat_rgba32.hpp"
11#include "../rapid/sfloat_rgb32.hpp"
12#include "../rapid/int_abgr8_pack.hpp"
13#include <vulkan/vulkan.hpp>
14#include <span>
15
16namespace hi::inline v1::pipeline_alpha {
17
21struct alignas(16) vertex {
25
29
32 float alpha;
33
34 vertex(sfloat_rgba32 position, sfloat_rgba32 clipping_rectangle, float alpha) noexcept :
35 position(position), clipping_rectangle(clipping_rectangle), alpha(alpha)
36 {
37 }
38
39 static vk::VertexInputBindingDescription inputBindingDescription()
40 {
41 return {0, sizeof(vertex), vk::VertexInputRate::eVertex};
42 }
43
44 static std::vector<vk::VertexInputAttributeDescription> inputAttributeDescriptions()
45 {
46 return {
47 {0, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(vertex, position)},
48 {1, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(vertex, clipping_rectangle)},
49 {2, 0, vk::Format::eR32Sfloat, offsetof(vertex, alpha)},
50 };
51 }
52};
53
54} // namespace hi::inline v1::pipeline_alpha
DOXYGEN BUG.
Definition algorithm.hpp:15
Definition pipeline_alpha_vertex.hpp:21
sfloat_rgba32 position
The pixel-coordinates where the origin is located relative to the bottom-left corner of the window.
Definition pipeline_alpha_vertex.hpp:24
float alpha
The alpha value of the resulting pixels inside the quad.
Definition pipeline_alpha_vertex.hpp:32
sfloat_rgba32 clipping_rectangle
The position in pixels of the clipping rectangle relative to the bottom-left corner of the window,...
Definition pipeline_alpha_vertex.hpp:28
Definition sfloat_rgba32.hpp:15