MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / CanBatch

Method CanBatch

Source/Engine/Renderer/RenderList.cpp:1180–1198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1178}
1179
1180bool SurfaceDrawCallHandler::CanBatch(const DrawCall& a, const DrawCall& b, DrawPass pass)
1181{
1182 // TODO: find reason why batching static meshes with lightmap causes problems with sampling in shader (flickering when meshes in batch order gets changes due to async draw calls collection)
1183 if (a.Surface.Lightmap == nullptr && b.Surface.Lightmap == nullptr &&
1184 a.Surface.Skinning == nullptr && b.Surface.Skinning == nullptr)
1185 {
1186 if (a.Material != b.Material)
1187 {
1188 // Batch simple materials during depth-only drawing (when using default vertex shader and no pixel shader)
1189 if (pass == DrawPass::Depth)
1190 {
1191 return IsSimpleMaterial(a.Material->GetInfo()) && IsSimpleMaterial(b.Material->GetInfo());
1192 }
1193 return false;
1194 }
1195 return true;
1196 }
1197 return false;
1198}

Callers 1

SortDrawCallsMethod · 0.80

Calls 2

IsSimpleMaterialFunction · 0.85
GetInfoMethod · 0.45

Tested by

no test coverage detected