HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
pipeline_image_vertex.hpp
1// Copyright Take Vos 2019-2020.
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 "pipeline_image_image_location.hpp"
8#include "../geometry/axis_aligned_rectangle.hpp"
9#include "../color/sfloat_rgb32.hpp"
10#include "../color/sfloat_rgba32.hpp"
11#include <vulkan/vulkan.hpp>
12
13namespace tt::pipeline_image {
14
18struct vertex {
21
24
27
32
33 static vk::VertexInputBindingDescription inputBindingDescription()
34 {
35 return {
36 0, sizeof(vertex), vk::VertexInputRate::eVertex
37 };
38 }
39
40 static std::vector<vk::VertexInputAttributeDescription> inputAttributeDescriptions()
41 {
42 return {
43 { 0, 0, vk::Format::eR32G32B32Sfloat, offsetof(vertex, position) },
44 { 1, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(vertex, clippingRectangle) },
45 { 2, 0, vk::Format::eR32G32B32Sfloat, offsetof(vertex, atlasPosition) },
46 };
47 }
48};
49}
Definition sfloat_rgb32.hpp:12
Definition sfloat_rgba32.hpp:15
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:18
Definition pipeline_image_vertex.hpp:18
sfloat_rgb32 position
The pixel-coordinates where the origin is located relative to the bottom-left corner of the window.
Definition pipeline_image_vertex.hpp:20
sfloat_rgb32 atlasPosition
The x, y coordinate inside the texture-atlas, z is used as an index in the texture-atlas array.
Definition pipeline_image_vertex.hpp:26
sfloat_rgba32 clippingRectangle
The position in pixels of the clipping rectangle relative to the bottom-left corner of the window,...
Definition pipeline_image_vertex.hpp:23