diff --git a/Source/Engine/ShadowsOfMordor/Builder.Debug.cpp b/Source/Engine/ShadowsOfMordor/Builder.Debug.cpp index 0e1236854..5be0072b4 100644 --- a/Source/Engine/ShadowsOfMordor/Builder.Debug.cpp +++ b/Source/Engine/ShadowsOfMordor/Builder.Debug.cpp @@ -9,6 +9,8 @@ #if DEBUG_EXPORT_LIGHTMAPS_PREVIEW || DEBUG_EXPORT_CACHE_PREVIEW || DEBUG_EXPORT_HEMISPHERES_PREVIEW +#include "Engine/Engine/Globals.h" + String GetDebugDataPath() { auto result = Globals::ProjectCacheFolder / TEXT("ShadowsOfMordor_Debug"); @@ -165,7 +167,7 @@ void ShadowsOfMordor::Builder::downloadDebugHemisphereAtlases(SceneBuildCache* s GPUTexture* atlas = DebugExportHemispheresAtlases[atlasIndex]; TextureData textureData; - if (atlas->DownloadData(&textureData)) + if (atlas->DownloadData(textureData)) { LOG(Error, "Cannot download hemispheres atlas data."); continue; diff --git a/Source/Engine/ShadowsOfMordor/Builder.DoWork.cpp b/Source/Engine/ShadowsOfMordor/Builder.DoWork.cpp index fe388c039..b144a0d5a 100644 --- a/Source/Engine/ShadowsOfMordor/Builder.DoWork.cpp +++ b/Source/Engine/ShadowsOfMordor/Builder.DoWork.cpp @@ -135,7 +135,7 @@ bool ShadowsOfMordor::Builder::doWorkInner(DateTime buildStart) } } reportProgress(BuildProgressStep::RenderHemispheres, 1.0f); - return true; + return false; } #endif diff --git a/Source/Engine/ShadowsOfMordor/Builder.Jobs.cpp b/Source/Engine/ShadowsOfMordor/Builder.Jobs.cpp index 867c5b3f9..c214c7e4b 100644 --- a/Source/Engine/ShadowsOfMordor/Builder.Jobs.cpp +++ b/Source/Engine/ShadowsOfMordor/Builder.Jobs.cpp @@ -17,6 +17,7 @@ #include "Engine/Terrain/TerrainPatch.h" #include "Engine/Terrain/TerrainManager.h" #include "Engine/Foliage/Foliage.h" +#include "Engine/Graphics/GPUDevice.h" #include "Engine/Profiler/Profiler.h" namespace ShadowsOfMordor @@ -37,6 +38,8 @@ namespace ShadowsOfMordor void ShadowsOfMordor::Builder::onJobRender(GPUContext* context) { + if (_workerActiveSceneIndex < 0 || _workerActiveSceneIndex >= _scenes.Count()) + return; auto scene = _scenes[_workerActiveSceneIndex]; int32 atlasSize = (int32)scene->GetSettings().AtlasSize; @@ -465,7 +468,9 @@ void ShadowsOfMordor::Builder::onJobRender(GPUContext* context) Swap(scene->TempLightmapData, lightmapEntry.LightmapData); // Keep blurring the empty lightmap texels (from background) - const int32 blurPasses = 24; + int32 blurPasses = 24; + if (context->GetDevice()->GetRendererType() == RendererType::DirectX12) + blurPasses = 0; // TODO: fix CS_Dilate passes on D3D12 (probably UAV synchronization issue) for (int32 blurPassIndex = 0; blurPassIndex < blurPasses; blurPassIndex++) { context->UnBindSR(0);