Blender V5.3
vk_pipeline_data.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "GPU_framebuffer.hh"
13
18
27
28 bool operator==(const StencilState &other) const noexcept
29 {
30 return compare_mask == other.compare_mask && reference == other.reference &&
31 write_mask == other.write_mask;
32 }
33 bool operator!=(const StencilState &other) const noexcept
34 {
35 return !(*this == other);
36 }
37};
38
45 VkPipeline vk_pipeline;
46 VkPipelineLayout vk_pipeline_layout;
47 VkDescriptorSet vk_descriptor_set;
48
51};
52
60
61 bool operator==(const VKViewportData &other) const
62 {
63 if (viewports.size() != other.viewports.size() || scissors.size() != other.scissors.size()) {
64 return false;
65 }
66
67 if (memcmp(viewports.data(), other.viewports.data(), viewports.size() * sizeof(VkViewport)) !=
68 0)
69 {
70 return false;
71 }
72
73 if (memcmp(scissors.data(), other.scissors.data(), scissors.size() * sizeof(VkRect2D)) != 0) {
74 return false;
75 }
76
77 return true;
78 }
79
80 bool operator!=(const VKViewportData &other) const
81 {
82 return !(*this == other);
83 }
84
85 void reset()
86 {
87 viewports.clear();
88 scissors.clear();
89 }
90
100 {
101 viewports.clear();
102 scissors.clear();
103 viewports.extend(other.viewports);
104 scissors.extend(other.scissors);
105
106 return *this;
107 }
108};
109
113 std::optional<VKVertexInputDescriptionPool::Key> vertex_input_description;
114 std::optional<float> line_width;
115 std::optional<StencilState> stencil_state;
116 std::optional<VkFrontFace> front_face;
117
118 void reset()
119 {
120 pipeline_data = {};
121 viewport.reset();
123 line_width.reset();
124 stencil_state.reset();
125 front_face.reset();
126 }
127};
128
131 VkPipeline vk_pipeline;
132 VkDescriptorSet vk_descriptor_set;
133 VkPipelineLayout vk_pipeline_layout;
134};
135
138 VkIndexType index_type;
139
140 bool operator==(const VKIndexBufferBinding &other) const
141 {
144 }
145 bool operator!=(const VKIndexBufferBinding &other) const
146 {
147 return !(*this == other);
148 }
149};
150
154 VkBuffer buffer[16];
155 VkDeviceSize offset[16];
156
165 bool operator!=(const VKVertexBufferBindings &other) const
166 {
167 return !(*this == other);
168 }
169};
170
179 struct {
184 std::optional<float> line_width;
185 std::optional<StencilState> stencil_state;
186 std::optional<VkFrontFace> front_face;
187 std::optional<VKVertexInputDescriptionPool::Key> vertex_input_description;
189};
190
201void vk_pipeline_dynamic_graphics_build_commands(VKCommandBufferInterface &command_buffer,
202 const VKPipelineDataGraphics &graphics,
203 VKBoundPipelines &r_bound_pipelines);
204
218void vk_pipeline_data_build_commands(VKCommandBufferInterface &command_buffer,
219 const VKPipelineData &pipeline_data,
220 Span<uint8_t> storage_push_constants,
221 VKBoundPipeline &r_bound_pipeline,
222 VkPipelineBindPoint vk_pipeline_bind_point,
223 VkShaderStageFlags vk_shader_stage_flags);
224
225void vk_index_buffer_binding_build_links(VKResourceStateTracker &resources,
226 VKRenderGraphLinks &links,
227 const VKIndexBufferBinding &index_buffer_binding);
228void vk_index_buffer_binding_build_commands(VKCommandBufferInterface &command_buffer,
229 const VKIndexBufferBinding &index_buffer_binding,
230 VKIndexBufferBinding &r_bound_index_buffer);
231void vk_vertex_buffer_bindings_build_links(VKResourceStateTracker &resources,
232 VKRenderGraphLinks &links,
233 const VKVertexBufferBindings &vertex_buffers);
234void vk_vertex_buffer_bindings_build_commands(VKCommandBufferInterface &command_buffer,
235 const VKVertexBufferBindings &vertex_buffer_bindings,
236 VKVertexBufferBindings &r_bound_vertex_buffers);
237
238} // namespace blender::gpu::render_graph
constexpr Span()=default
void vk_index_buffer_binding_build_commands(VKCommandBufferInterface &command_buffer, const VKIndexBufferBinding &index_buffer_binding, VKIndexBufferBinding &r_bound_index_buffer)
void vk_pipeline_dynamic_graphics_build_commands(VKCommandBufferInterface &command_buffer, const VKPipelineDataGraphics &graphics, VKBoundPipelines &r_bound_pipelines)
void vk_vertex_buffer_bindings_build_commands(VKCommandBufferInterface &command_buffer, const VKVertexBufferBindings &vertex_buffer_bindings, VKVertexBufferBindings &r_bound_vertex_buffers)
void vk_pipeline_data_build_commands(VKCommandBufferInterface &command_buffer, const VKPipelineData &pipeline_data, Span< uint8_t > storage_push_constants, VKBoundPipeline &r_bound_pipeline, VkPipelineBindPoint vk_pipeline_bind_point, VkShaderStageFlags vk_shader_stage_flags)
void vk_vertex_buffer_bindings_build_links(VKResourceStateTracker &resources, VKRenderGraphLinks &links, const VKVertexBufferBindings &vertex_buffers)
void vk_index_buffer_binding_build_links(VKResourceStateTracker &resources, VKRenderGraphLinks &links, const VKIndexBufferBinding &index_buffer_binding)
uint64_t ResourceHandle
Definition vk_common.hh:68
unsigned int uint32_t
Definition BKE_text.h:81
unsigned char uint8_t
Definition BKE_text.h:79
bool operator!=(const StencilState &other) const noexcept
bool operator==(const StencilState &other) const noexcept
std::optional< VKVertexInputDescriptionPool::Key > vertex_input_description
struct blender::gpu::render_graph::VKBoundPipelines::@354275304307172366215375121273352137136061330352 graphics
bool operator==(const VKIndexBufferBinding &other) const
bool operator!=(const VKIndexBufferBinding &other) const
std::optional< VKVertexInputDescriptionPool::Key > vertex_input_description
bool operator!=(const VKVertexBufferBindings &other) const
bool operator==(const VKVertexBufferBindings &other) const
Vector< VkViewport, GPU_MAX_VIEWPORTS > viewports
Vector< VkRect2D, GPU_MAX_VIEWPORTS > scissors
bool operator!=(const VKViewportData &other) const
VKViewportData & operator=(const VKViewportData &other)
bool operator==(const VKViewportData &other) const
int size() const
Definition vector.hh:130