8 #ifndef LLUVIA_CORE_NODE_COMPUTE_NODE_H_
9 #define LLUVIA_CORE_NODE_COMPUTE_NODE_H_
38 class ComputeNode :
public Node,
public std::enable_shared_from_this<ll::ComputeNode> {
62 ComputeNode(
const std::shared_ptr<ll::vulkan::Device>& device,
64 const std::weak_ptr<ll::Interpreter>& interpreter);
233 bool hasPort(const std::
string& name) const noexcept override;
241 void bind(const std::
string& name, const std::shared_ptr<
ll::
Object>& obj) override;
253 void initPortBindings();
259 std::vector<vk::DescriptorPoolSize> getDescriptorPoolSizes() const noexcept;
260 uint32_t countDescriptorType(const vk::DescriptorType type) const noexcept;
262 std::shared_ptr<
ll::vulkan::Device> m_device;
264 vk::DescriptorSetLayout m_descriptorSetLayout;
266 vk::PipelineLayout m_pipelineLayout;
267 vk::Pipeline m_pipeline;
269 vk::DescriptorSet m_descriptorSet;
270 vk::DescriptorPool m_descriptorPool;
274 std::vector<vk::DescriptorSetLayoutBinding> m_parameterBindings;
281 std::map<std::
string, std::shared_ptr<
ll::
Object>> m_objects;
ComputeNodeDescriptor class.
Node class and related enums.
Objects to manage raw portions of allocated memory.
Definition: Buffer.h:57
Class for command buffer.
Definition: CommandBuffer.h:63
Class for describing a compute node node.
Definition: ComputeNodeDescriptor.h:33
Class representing compute nodes.
Definition: ComputeNode.h:38
void setGridX(const uint32_t x) noexcept
Sets the grid size in the X axis.
ComputeNode(const ComputeNode &node)=delete
std::shared_ptr< ll::Program > getProgram() const noexcept
Gets the program object associated to this node.
void bind(const std::string &name, const std::shared_ptr< ll::Object > &obj) override
Binds a ll::Object as port index for this node.
uint32_t getGridZ() const noexcept
Gets the grid size in Z dimension.
std::string getFunctionName() const noexcept
Gets the function name within the shader module this node runs.
ll::NodeType getType() const noexcept override
Gets the node type.
const ll::PushConstants & getPushConstants() const noexcept
ll::vec3ui getLocalShape() const noexcept
Gets the local group shape.
void record(ll::CommandBuffer &commandBuffer) const override
Records the operations required to run this node in a ll::CommandBuffer.
ComputeNode & operator=(const ComputeNode &node)=delete
uint32_t getGridY() const noexcept
Gets the grid size in Y dimension.
void setGridY(const uint32_t y) noexcept
Sets the grid size in the Y axis.
ComputeNode(ComputeNode &&node)=delete
std::shared_ptr< ll::Object > getPort(const std::string &name) const override
Gets a port descriptor given its name.
void setGridZ(const uint32_t z) noexcept
Sets the grid size in the Z axis.
void setGridShape(const ll::vec3ui &shape) noexcept
Sets the grid shape.
ComputeNode(const std::shared_ptr< ll::vulkan::Device > &device, const ll::ComputeNodeDescriptor &descriptor, const std::weak_ptr< ll::Interpreter > &interpreter)
Constructs the object.
bool hasPort(const std::string &name) const noexcept override
Returns whether or not a port exists with a given name.
uint32_t getLocalZ() const noexcept
Gets the local group size in Z dimension.
void setPushConstants(const ll::PushConstants &constants) noexcept
ll::vec3ui getGridShape() const noexcept
Gets the grid shape.
uint32_t getGridX() const noexcept
Gets the grid size in X dimension.
uint32_t getLocalX() const noexcept
Gets the local group size in X dimension.
void setParameter(const std::string &name, const ll::Parameter &value) override
Sets a parameter.
const ll::Parameter & getParameter(const std::string &name) const override
Gets a parameter.
ComputeNode & operator=(ComputeNode &&node)=delete
const ll::ComputeNodeDescriptor & getDescriptor() const noexcept
Gets the descriptor.
uint32_t getLocalY() const noexcept
Gets the local group size in Y dimension.
void configureGridShape(const ll::vec3ui &globalShape) noexcept
Configures the grid shape given a global shape.
Represents portions of a ll::Image to be sent as parameter to a GLSL shader.
Definition: ImageView.h:149
Definition: Interpreter.h:34
Base class for all types that can be used in computer shaders.
Definition: Object.h:94
Definition: Parameter.h:23
Definition: PortDescriptor.h:27
Class representing Vulkan shader modules in SPIR-V representation.
Definition: Program.h:37
Definition: PushConstants.h:20
NodeType
Class for node type.
Definition: NodeType.h:19