Refactored Graphics #297
|
@ -586,6 +586,31 @@ namespace SHADE
|
|||
cmdBuffer->EndLabeledSegment();
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* SHBatch - Getter Functions */
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
Handle<SHVkBuffer> SHBatch::GetTransformBuffer(uint32_t frameIndex) const noexcept
|
||||
{
|
||||
if (frameIndex >= transformDataBuffer.size())
|
||||
{
|
||||
SHLOG_WARNING("[SHBatch] Attempted to retrieve a transform buffer of an invalid index.");
|
||||
return {};
|
||||
}
|
||||
|
||||
return transformDataBuffer[frameIndex];
|
||||
}
|
||||
|
||||
Handle<SHVkBuffer> SHBatch::GetMDIBuffer(uint32_t frameIndex) const noexcept
|
||||
{
|
||||
if (frameIndex >= drawDataBuffer.size())
|
||||
{
|
||||
SHLOG_WARNING("[SHBatch] Attempted to retrieve a MDI draw data buffer of an invalid index.");
|
||||
return {};
|
||||
}
|
||||
|
||||
return drawDataBuffer[frameIndex];
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* SHBatch - Helper Functions */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
|
|
@ -94,6 +94,8 @@ namespace SHADE
|
|||
/*-----------------------------------------------------------------------------*/
|
||||
Handle<SHVkPipeline> GetPipeline() const noexcept { return pipeline; };
|
||||
bool IsEmpty() const noexcept { return subBatches.empty(); }
|
||||
Handle<SHVkBuffer> GetTransformBuffer(uint32_t frameIndex) const noexcept;
|
||||
Handle<SHVkBuffer> GetMDIBuffer(uint32_t frameIndex) const noexcept;
|
||||
|
||||
private:
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
|
@ -122,7 +124,7 @@ namespace SHADE
|
|||
std::unique_ptr<char> matPropsData;
|
||||
Byte matPropsDataSize = 0;
|
||||
Byte singleMatPropAlignedSize = 0;
|
||||
Byte singleMatPropSize = 0;
|
||||
Byte singleMatPropSize = 0;
|
||||
bool isCPUBuffersDirty = true;
|
||||
// GPU Buffers
|
||||
TripleBuffer drawDataBuffer;
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace SHADE
|
|||
/*-----------------------------------------------------------------------------*/
|
||||
void Add(const SHRenderable* renderable) noexcept;
|
||||
void Remove(const SHRenderable* renderable) noexcept;
|
||||
void Clear() noexcept;
|
||||
void Clear() noexcept;
|
||||
void UpdateBuffers(uint32_t frameIndex, Handle<SHVkDescriptorPool> descPool);
|
||||
void Build(Handle<SHVkLogicalDevice> device, Handle<SHVkDescriptorPool> descPool, uint32_t frameIndex) noexcept;
|
||||
void Draw(Handle<SHVkCommandBuffer> cmdBuffer, uint32_t frameIndex) noexcept;
|
||||
|
@ -63,6 +63,7 @@ namespace SHADE
|
|||
/* Getter Functions */
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
Handle<SHSubpass> GetSubpass() const noexcept { return subpass; };
|
||||
const std::vector<SHBatch>& GetBatches() const noexcept { return batches; }
|
||||
|
||||
private:
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
|
|
Loading…
Reference in New Issue