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/module.hpp"
9#include "../image/module.hpp"
10#include <vulkan/vulkan.hpp>
11#include <span>
12
13namespace hi::inline v1::pipeline_alpha {
14
18struct alignas(16) vertex {
22
26
29 float alpha;
30
31 vertex(sfloat_rgba32 position, sfloat_rgba32 clipping_rectangle, float alpha) noexcept :
32 position(position), clipping_rectangle(clipping_rectangle), alpha(alpha)
33 {
34 }
35
36 static vk::VertexInputBindingDescription inputBindingDescription()
37 {
38 return {0, sizeof(vertex), vk::VertexInputRate::eVertex};
39 }
40
41 static std::vector<vk::VertexInputAttributeDescription> inputAttributeDescriptions()
42 {
43 return {
44 {0, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(vertex, position)},
45 {1, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(vertex, clipping_rectangle)},
46 {2, 0, vk::Format::eR32Sfloat, offsetof(vertex, alpha)},
47 };
48 }
49};
50
51} // namespace hi::inline v1::pipeline_alpha
DOXYGEN BUG.
Definition algorithm.hpp:13
Definition pipeline_alpha_vertex.hpp:18
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:21
float alpha
The alpha value of the resulting pixels inside the quad.
Definition pipeline_alpha_vertex.hpp:29
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:25
4 x float32 pixel format.
Definition sfloat_rgba32.hpp:22