Fixed ghosts of a renderable being rendered when a material is changed #238

Merged
Pycorax merged 1 commits from Fix-BatchPersistence into main 2022-11-21 20:27:48 +08:00
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