Fix empty draw call submitting

This commit is contained in:
Wojciech Figat
2022-12-15 17:33:14 +01:00
parent b9244df8f7
commit 3fcbcacd43
2 changed files with 4 additions and 2 deletions

View File

@@ -574,7 +574,8 @@ void Mesh::Draw(const RenderContextBatch& renderContextBatch, const DrawInfo& in
// Push draw call to the render lists
const auto shadowsMode = (ShadowsCastingMode)(entry.ShadowsMode & slot.ShadowsMode);
const DrawPass drawModes = (DrawPass)(info.DrawModes & material->GetDrawModes());
renderContextBatch.GetMainContext().List->AddDrawCall(renderContextBatch, drawModes, info.Flags, shadowsMode, info.Bounds, drawCall, entry.ReceiveDecals);
if (drawModes != DrawPass::None)
renderContextBatch.GetMainContext().List->AddDrawCall(renderContextBatch, drawModes, info.Flags, shadowsMode, info.Bounds, drawCall, entry.ReceiveDecals);
}
bool Mesh::DownloadDataGPU(MeshBufferType type, BytesContainer& result) const

View File

@@ -278,7 +278,8 @@ void SkinnedMesh::Draw(const RenderContextBatch& renderContextBatch, const DrawI
// Push draw call to the render lists
const auto shadowsMode = (ShadowsCastingMode)(entry.ShadowsMode & slot.ShadowsMode);
const DrawPass drawModes = (DrawPass)(info.DrawModes & material->GetDrawModes());
renderContextBatch.GetMainContext().List->AddDrawCall(renderContextBatch, drawModes, StaticFlags::None, shadowsMode, info.Bounds, drawCall, entry.ReceiveDecals);
if (drawModes != DrawPass::None)
renderContextBatch.GetMainContext().List->AddDrawCall(renderContextBatch, drawModes, StaticFlags::None, shadowsMode, info.Bounds, drawCall, entry.ReceiveDecals);
}
bool SkinnedMesh::DownloadDataGPU(MeshBufferType type, BytesContainer& result) const