27 m_pc.
mode =
static_cast<uint32_t
>(mode);
55 std::shared_ptr<Core::VKImage>
image,
81 auto vk_buf = std::dynamic_pointer_cast<VKBuffer>(buffer);
84 "UVFieldProcessor requires a VKBuffer");
91 "UVFieldProcessor attached ({} bytes)", vk_buf->get_size_bytes());
112 "UVFieldProcessor: sampler creation failed, texture will not be sampled");
116 foundry.update_descriptor_image(
121 vk::ImageLayout::eShaderReadOnlyOptimal);
124 "UVFieldProcessor: texture descriptor written (binding 1, view={:p}, sampler={:p})",
125 static_cast<void*
>(
static_cast<VkImageView
>(
m_texture->get_image_view())),
126 static_cast<void*
>(
static_cast<VkSampler
>(
m_sampler)));
131 const std::shared_ptr<VKBuffer>& buffer)
143 "UVFieldProcessor dispatch: {} vertices, mode={}, write_colour={}, has_texture={}",
#define MF_ERROR(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
#define MF_RT_DEBUG(comp, ctx,...)
virtual void on_attach(const std::shared_ptr< Buffer > &)
Called when this processor is attached to a buffer.
Specialized ShaderProcessor for Compute Pipelines.
bool m_needs_descriptor_rebuild
void set_push_constant_data(const T &data)
Update push constant data (type-safe)
void bind_buffer(const std::string &descriptor_name, const std::shared_ptr< VKBuffer > &buffer)
Bind a VKBuffer to a named shader descriptor.
std::vector< Portal::Graphics::DescriptorSetID > m_descriptor_set_ids
void clear_texture()
Remove the texture source.
void set_texture(std::shared_ptr< Core::VKImage > image, const Portal::Graphics::SamplerConfig &config={})
Bind a texture to sample colour from at computed UV coordinates.
void set_axis(const glm::vec3 &axis)
Set projection axis.
Portal::Graphics::SamplerConfig m_sampler_config
bool on_before_execute(Portal::Graphics::CommandBufferID cmd_id, const std::shared_ptr< VKBuffer > &buffer) override
Called before each process callback.
void set_scale(float scale)
Set UV scale.
void set_origin(const glm::vec3 &origin)
Set world-space origin of the projection.
void on_attach(const std::shared_ptr< Buffer > &buffer) override
Called when this processor is attached to a buffer.
std::shared_ptr< Core::VKImage > m_texture
void set_projection(UVProjectionMode mode)
Set projection mode.
void on_descriptors_created() override
Called after descriptor sets are created.
void set_aux(float aux)
Set auxiliary projection parameter.
static SamplerForge & instance()
UVProjectionMode
Projection mode encoded in push constants for uv_field.comp.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.
Describes how a VKBuffer binds to a shader descriptor.
std::unordered_map< std::string, ShaderBinding > bindings
size_t push_constant_size