Merge pull request #238 from SHADE-DP/Fix-BatchPersistence

Fixed ghosts of a renderable being rendered when a material is changed
This commit is contained in:
XiaoQiDigipen 2022-11-21 20:27:48 +08:00 committed by GitHub
commit 6d8fba8e05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ namespace SHADE
void SHSuperBatch::Remove(const SHRenderable* renderable) noexcept void SHSuperBatch::Remove(const SHRenderable* renderable) noexcept
{ {
Handle<SHMaterial> baseMat = renderable->GetMaterial()->GetBaseMaterial(); Handle<SHMaterial> baseMat = (renderable->HasMaterialChanged() ? renderable->GetPrevMaterial() : renderable->GetMaterial())->GetBaseMaterial();
const Handle<SHVkPipeline> PIPELINE = baseMat->HasPipelineChanged() ? baseMat->GetPrevPipeline() : baseMat->GetPipeline(); const Handle<SHVkPipeline> PIPELINE = baseMat->HasPipelineChanged() ? baseMat->GetPrevPipeline() : baseMat->GetPipeline();
// Check if we have a Batch with the same pipeline yet // Check if we have a Batch with the same pipeline yet