2023-10-26 18:37:29 +02:00
|
|
|
#include "Pipeline.h"
|
2023-11-15 17:42:57 +01:00
|
|
|
#include "Descriptor.h"
|
2023-10-26 18:37:29 +02:00
|
|
|
#include "Graphics.h"
|
2020-05-05 01:51:13 +02:00
|
|
|
|
|
|
|
|
using namespace Seele;
|
|
|
|
|
using namespace Seele::Vulkan;
|
|
|
|
|
|
2023-11-09 22:15:51 +01:00
|
|
|
GraphicsPipeline::GraphicsPipeline(PGraphics graphics, VkPipeline handle, Gfx::OPipelineLayout pipelineLayout)
|
|
|
|
|
: Gfx::GraphicsPipeline(std::move(pipelineLayout))
|
2020-05-05 01:51:13 +02:00
|
|
|
, graphics(graphics)
|
|
|
|
|
, pipeline(handle)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GraphicsPipeline::~GraphicsPipeline()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GraphicsPipeline::bind(VkCommandBuffer handle)
|
|
|
|
|
{
|
|
|
|
|
vkCmdBindPipeline(handle, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VkPipelineLayout GraphicsPipeline::getLayout() const
|
|
|
|
|
{
|
2023-11-09 22:15:51 +01:00
|
|
|
return Gfx::PPipelineLayout(layout).cast<PipelineLayout>()->getHandle();
|
2021-05-06 17:02:10 +02:00
|
|
|
}
|
|
|
|
|
|
2023-11-09 22:15:51 +01:00
|
|
|
ComputePipeline::ComputePipeline(PGraphics graphics, VkPipeline handle, Gfx::OPipelineLayout pipelineLayout)
|
|
|
|
|
: Gfx::ComputePipeline(std::move(pipelineLayout))
|
2021-05-06 17:02:10 +02:00
|
|
|
, graphics(graphics)
|
|
|
|
|
, pipeline(handle)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ComputePipeline::~ComputePipeline()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ComputePipeline::bind(VkCommandBuffer handle)
|
|
|
|
|
{
|
|
|
|
|
vkCmdBindPipeline(handle, VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VkPipelineLayout ComputePipeline::getLayout() const
|
|
|
|
|
{
|
2023-11-09 22:15:51 +01:00
|
|
|
return Gfx::PPipelineLayout(layout).cast<PipelineLayout>()->getHandle();
|
2020-05-05 01:51:13 +02:00
|
|
|
}
|