121 OUTPUT_WRITE = 1 << 1,
143 void processing_function(
const std::shared_ptr<Buffer>& buffer)
override;
144 void on_attach(
const std::shared_ptr<Buffer>& buffer)
override;
145 void on_detach(
const std::shared_ptr<Buffer>& buffer)
override;
147 [[nodiscard]]
bool is_compatible_with(
const std::shared_ptr<Buffer>& buffer)
const override;
161 void bind_buffer(
const std::string& descriptor_name,
const std::shared_ptr<VKBuffer>& buffer);
167 void unbind_buffer(
const std::string& descriptor_name);
174 [[nodiscard]] std::shared_ptr<VKBuffer> get_bound_buffer(
const std::string& descriptor_name)
const;
184 void auto_bind_buffer(
const std::shared_ptr<VKBuffer>& buffer);
197 bool hot_reload_shader();
203 void set_shader(
const std::string& shader_path);
208 [[nodiscard]]
const std::string&
get_shader_path()
const {
return m_config.shader_path; }
218 void set_push_constant_size(
size_t size);
224 template <
typename T>
227 set_push_constant_size(
sizeof(T));
237 template <
typename T>
238 void set_push_constant_data(
const T& data);
245 virtual void set_push_constant_data_raw(
const void* data,
size_t size);
264 void set_specialization_constant(uint32_t constant_id, uint32_t value);
269 void clear_specialization_constants();
293 void add_binding(
const std::string& descriptor_name,
const ShaderBinding& binding);
304 [[nodiscard]]
virtual BufferUsageHint get_buffer_usage_hint(
const std::string& descriptor_name)
const;
311 [[nodiscard]]
virtual bool is_in_place_operation(
const std::string& descriptor_name)
const;
318 [[nodiscard]]
bool has_binding(
const std::string& descriptor_name)
const;
326 [[nodiscard]] std::vector<std::string> get_binding_names()
const;
332 [[nodiscard]]
bool are_bindings_complete()
const;
341 [[nodiscard]]
bool is_shader_loaded()
const {
return m_shader_id != Portal::Graphics::INVALID_SHADER; }
363 [[nodiscard]]
virtual std::shared_ptr<VKBuffer>
get_output_buffer()
const {
return m_last_processed_buffer; }
371 return m_last_command_buffer != Portal::Graphics::INVALID_COMMAND_BUFFER;
385 virtual void on_before_compile(
const std::string& shader_path);
416 virtual void on_before_descriptors_create();
423 virtual void on_descriptors_created();
453 [[nodiscard]] std::optional<uint32_t> resolve_ds_index(uint32_t set)
const;
470 bool m_initialized {};
471 bool m_needs_pipeline_rebuild =
true;
472 bool m_needs_descriptor_rebuild =
true;
474 size_t m_auto_bind_index {};
488 bool m_engine_owns_set_zero {};
494 virtual void update_descriptors(
const std::shared_ptr<VKBuffer>& buffer);
495 virtual void cleanup();
502 void initialize_shader();