Refactor UniformBuffers and DescriptorSets
- Refactor UniformBuffers to keep track of the uniforms it contains - Refactor DescriptorSets to initialize UniformsBuffers and keep track of all its bindings - DescriptorSets can now be created from the Pipeline - Add custom DescriptorSets to Renderer
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#include "copium/renderer/Batch.h"
|
||||
|
||||
#include "copium/renderer/RendererVertex.h"
|
||||
|
||||
namespace Copium
|
||||
{
|
||||
Batch::Batch(Vulkan& vulkan, Pipeline& pipeline, DescriptorPool& descriptorPool, int vertexCount, const std::vector<const Sampler*> samplers)
|
||||
: vulkan{vulkan},
|
||||
pipeline{pipeline},
|
||||
vertexBuffer{vulkan, RendererVertex::GetDescriptor(), vertexCount},
|
||||
descriptorSet{pipeline.CreateDescriptorSet(descriptorPool, 0)}
|
||||
{
|
||||
descriptorSet->SetSamplers(samplers, 0);
|
||||
}
|
||||
|
||||
RendererVertexBuffer& Batch::GetVertexBuffer()
|
||||
{
|
||||
return vertexBuffer;
|
||||
}
|
||||
|
||||
DescriptorSet& Batch::GetDescriptorSet()
|
||||
{
|
||||
return *descriptorSet;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user