7#include "gfx_pipeline_vulkan_intf.hpp"
8#include "../container/container.hpp"
9#include "../image/image.hpp"
11#include "../geometry/geometry.hpp"
12#include "../macros.hpp"
13#include <vma/vk_mem_alloc.h>
14#include <vulkan/vulkan.hpp>
18hi_export_module(hikogui.GFX : gfx_pipeline_override_intf);
20hi_export
namespace hi {
inline namespace v1 {
52 static vk::VertexInputBindingDescription inputBindingDescription()
54 return {0,
sizeof(
vertex), vk::VertexInputRate::eVertex};
60 {0, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(vertex,
position)},
62 {2, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(vertex,
color)},
63 {3, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(vertex,
blend_factor)},
69 sfloat_rg32 windowExtent =
extent2{0.0, 0.0};
70 sfloat_rg32 viewportScale =
scale2{0.0, 0.0};
74 return {{vk::ShaderStageFlagBits::eVertex | vk::ShaderStageFlagBits::eFragment, 0,
sizeof(
push_constants)}};
79 gfx_device
const& device;
81 vk::ShaderModule vertexShaderModule;
82 vk::ShaderModule fragmentShaderModule;
96 void destroy(gfx_device
const *vulkanDevice);
98 void drawInCommandBuffer(vk::CommandBuffer
const& commandBuffer);
104 void teardownShaders(gfx_device
const *vulkanDevice);
107 vector_span<vertex> vertexBufferData;
117 void draw_in_command_buffer(vk::CommandBuffer commandBuffer,
draw_context const& context)
override;
120 push_constants pushConstants;
122 vk::Buffer vertexBuffer;
123 VmaAllocation vertexBufferAllocation;
129 [[nodiscard]]
size_t getDescriptorSetVersion()
const override;
131 [[nodiscard]] vk::VertexInputBindingDescription createVertexInputBindingDescription()
const override;
135 void build_vertex_buffers()
override;
136 void teardown_vertex_buffers()
override;
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
This is a RGBA floating point color.
Definition color_intf.hpp:49
A color for each corner of a quad.
Definition quad_color.hpp:22
Class which represents an axis-aligned rectangle.
Definition aarectangle.hpp:33
A high-level geometric extent.
Definition extent2.hpp:32
Draw context for drawing using the HikoGUI shaders.
Definition draw_context_intf.hpp:209
Definition gfx_pipeline_override_vulkan_intf.hpp:24
Definition gfx_pipeline_override_vulkan_intf.hpp:29
sfloat_rgba32 clipping_rectangle
The position in pixels of the clipping rectangle relative to the bottom-left corner of the window,...
Definition gfx_pipeline_override_vulkan_intf.hpp:37
sfloat_rgba16 color
The color value of the resulting pixels inside the quad.
Definition gfx_pipeline_override_vulkan_intf.hpp:41
sfloat_rgba32 position
The pixel-coordinates where the origin is located relative to the bottom-left corner of the window.
Definition gfx_pipeline_override_vulkan_intf.hpp:32
sfloat_rgba16 blend_factor
The blend-factor value of the resulting pixels inside the quad.
Definition gfx_pipeline_override_vulkan_intf.hpp:45
Definition gfx_pipeline_override_vulkan_intf.hpp:68
Definition gfx_pipeline_override_vulkan_intf.hpp:78
void destroy(gfx_device const *vulkanDevice)
Definition gfx_pipeline_override_vulkan_impl.hpp:140