From 87549a3e6c9012c4616198b65d4b3f566b7be370 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sat, 28 Jan 2023 01:31:07 +0100 Subject: [PATCH] Fix sort order usage in multi-pass drawing of the Mesh --- Source/Engine/Graphics/Models/Mesh.cpp | 2 +- Source/Engine/Renderer/RenderList.cpp | 2 +- Source/Engine/Scripting/BinaryModule.cpp | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Graphics/Models/Mesh.cpp b/Source/Engine/Graphics/Models/Mesh.cpp index b3ffae11c..7b0130874 100644 --- a/Source/Engine/Graphics/Models/Mesh.cpp +++ b/Source/Engine/Graphics/Models/Mesh.cpp @@ -575,7 +575,7 @@ void Mesh::Draw(const RenderContextBatch& renderContextBatch, const DrawInfo& in const auto shadowsMode = entry.ShadowsMode & slot.ShadowsMode; const auto drawModes = info.DrawModes & material->GetDrawModes(); if (drawModes != DrawPass::None) - renderContextBatch.GetMainContext().List->AddDrawCall(renderContextBatch, drawModes, info.Flags, shadowsMode, info.Bounds, drawCall, entry.ReceiveDecals); + renderContextBatch.GetMainContext().List->AddDrawCall(renderContextBatch, drawModes, info.Flags, shadowsMode, info.Bounds, drawCall, entry.ReceiveDecals, info.SortOrder); } bool Mesh::DownloadDataGPU(MeshBufferType type, BytesContainer& result) const diff --git a/Source/Engine/Renderer/RenderList.cpp b/Source/Engine/Renderer/RenderList.cpp index 53e007e17..f34c2c358 100644 --- a/Source/Engine/Renderer/RenderList.cpp +++ b/Source/Engine/Renderer/RenderList.cpp @@ -637,7 +637,7 @@ void RenderList::SortDrawCalls(const RenderContext& renderContext, bool reverseD Sorting::QuickSort(list.Batches.Get(), list.Batches.Count()); } -bool CanUseInstancing(DrawPass pass) +FORCE_INLINE bool CanUseInstancing(DrawPass pass) { return pass == DrawPass::GBuffer || pass == DrawPass::Depth; } diff --git a/Source/Engine/Scripting/BinaryModule.cpp b/Source/Engine/Scripting/BinaryModule.cpp index 598091ba2..c26f9e13b 100644 --- a/Source/Engine/Scripting/BinaryModule.cpp +++ b/Source/Engine/Scripting/BinaryModule.cpp @@ -871,9 +871,7 @@ ScriptingTypeHandle ManagedBinaryModule::FindType(MonoClass* klass) { int32 typeIndex; if (typeModule->ClassToTypeIndex.TryGet(klass, typeIndex)) - { return ScriptingTypeHandle(typeModule, typeIndex); - } } return ScriptingTypeHandle(); }