| 1178 | } |
| 1179 | |
| 1180 | bool 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 | } |
no test coverage detected