Exposed transform and MDI buffers in SHBatch and exposed Batches in SHSuperBatch

This commit is contained in:
Kah Wei 2022-12-30 15:29:17 +08:00
parent 8e2c32d110
commit ce16ca6f8d
3 changed files with 30 additions and 2 deletions

View File

@ -586,6 +586,31 @@ namespace SHADE
cmdBuffer->EndLabeledSegment(); 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 */ /* SHBatch - Helper Functions */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/

View File

@ -94,6 +94,8 @@ namespace SHADE
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
Handle<SHVkPipeline> GetPipeline() const noexcept { return pipeline; }; Handle<SHVkPipeline> GetPipeline() const noexcept { return pipeline; };
bool IsEmpty() const noexcept { return subBatches.empty(); } bool IsEmpty() const noexcept { return subBatches.empty(); }
Handle<SHVkBuffer> GetTransformBuffer(uint32_t frameIndex) const noexcept;
Handle<SHVkBuffer> GetMDIBuffer(uint32_t frameIndex) const noexcept;
private: private:
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/

View File

@ -63,6 +63,7 @@ namespace SHADE
/* Getter Functions */ /* Getter Functions */
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
Handle<SHSubpass> GetSubpass() const noexcept { return subpass; }; Handle<SHSubpass> GetSubpass() const noexcept { return subpass; };
const std::vector<SHBatch>& GetBatches() const noexcept { return batches; }
private: private:
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/