31 void set_geometry_shader(
const std::string& geometry_path);
32 void set_tess_control_shader(
const std::string& tess_control_path);
33 void set_tess_eval_shader(
const std::string& tess_eval_path);
34 void set_fragment_shader(
const std::string& fragment_path);
35 void set_target_window(
const std::shared_ptr<Core::Window>&
window,
const std::shared_ptr<VKBuffer>&
buffer);
42 void on_attach(
const std::shared_ptr<Buffer>&
buffer)
override;
49 void on_detach(
const std::shared_ptr<Buffer>&
buffer)
override;
52 void set_visible(
bool visible,
const std::shared_ptr<VKBuffer>&
buffer);
55 bool is_visible(
const std::shared_ptr<VKBuffer>&
buffer)
const;
64 void record_draw(
const std::shared_ptr<VKBuffer>&
buffer);
69 if (m_primitive_topology ==
topology) {
73 m_needs_pipeline_rebuild =
true;
79 if (m_polygon_mode ==
mode) {
82 m_polygon_mode =
mode;
83 m_needs_pipeline_rebuild =
true;
89 if (m_cull_mode ==
mode) {
93 m_needs_pipeline_rebuild =
true;
104 const std::shared_ptr<Core::VKImage>& texture,
105 vk::Sampler sampler =
nullptr);
114 const std::string& descriptor_name,
115 const std::shared_ptr<Core::VKImage>& texture,
116 vk::Sampler sampler =
nullptr);
121 bool is_pipeline_ready()
const {
return m_pipeline_id != Portal::Graphics::INVALID_RENDER_PIPELINE; }
134 void set_vertex_range(uint32_t first_vertex, uint32_t vertex_count);
145 void set_buffer_vertex_layout(
146 const std::shared_ptr<VKBuffer>&
buffer,
155 if (m_blend_attachment.has_value() && *m_blend_attachment == config) {
158 m_blend_attachment = config;
159 m_needs_pipeline_rebuild =
true;
163 void enable_alpha_blending();
166 void disable_alpha_blending();
175 void set_alpha_blending(
bool enabled);
180 return m_blend_attachment.has_value() && m_blend_attachment->blend_enable;
198 void disable_depth_test();
211 void set_view_transform(
213 bool enable_depth =
true,
222 void set_view_transform_source(
224 bool enable_depth =
true,
234 void set_geometry_transform(
const glm::mat4& transform);
237 void set_geometry_transform_source(std::function<glm::mat4()> fn);
264 void set_triangulate(
bool enabled);
275 void set_scissor(std::optional<Kinesis::Scissor> scissor) { m_scissor = scissor; }
276 [[nodiscard]]
const std::optional<Kinesis::Scissor>&
get_scissor()
const {
return m_scissor; }
296 void set_runs(std::vector<Portal::Graphics::DrawRun> runs);
299 [[nodiscard]]
const std::vector<Portal::Graphics::DrawRun>&
get_runs()
const {
return m_runs; }
306 [[nodiscard]] uint32_t milled_vertex_count()
const;
309 void initialize_pipeline(
const std::shared_ptr<VKBuffer>&
buffer)
override;
319 void execute_shader(
const std::shared_ptr<VKBuffer>&
buffer)
override;
320 void initialize_descriptors(
const std::shared_ptr<VKBuffer>&
buffer)
override;
326 void cleanup()
override;
342 return m_published_render_transform;
346 [[nodiscard]] vk::Rect2D resolve_scissor_rect(uint32_t
width, uint32_t
height)
const noexcept;
351 bool use_reflection {};
352 std::unique_ptr<Portal::Graphics::PrimitiveMill>
mill;
354 uint32_t first_vertex {};
355 uint32_t vertex_count {};
356 uint32_t index_count {};
357 bool geometry_prepared {};
366 Portal::Graphics::INVALID_DESCRIPTOR_SET
389 bool m_depth_enabled {};
402 uint32_t m_binding_wait_ticks {};
408 void retire_current_pipeline();
415 void collect_retired_pipelines();
416 bool m_view_transform_active {};
417 uint32_t m_first_vertex { 0 };
418 uint32_t m_vertex_count { 0 };
419 uint32_t m_instance_count { 1 };
427 bool m_triangulate {};
429 std::vector<Portal::Graphics::DrawRun>
m_runs;
432 uint32_t m_last_milled_vertex_count {};
447 void prepare_geometry(
const std::shared_ptr<VKBuffer>&
buffer, BufferState& state);
450 void record_draw(
const std::shared_ptr<VKBuffer>&
buffer,
const BufferState& state);
452 BufferState* get_or_cache_buffer_state(
const std::shared_ptr<VKBuffer>&
buffer);