Skip to content

Commit

Permalink
Merge pull request #158 from Esri/prt32_update
Browse files Browse the repository at this point in the history
PRT 3.2 Update
  • Loading branch information
bneukom authored Dec 9, 2024
2 parents 0cde51b + 0cef1b4 commit f08f0f1
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@

#include "prtx/ExtensionManager.h"

// TODO get version when we automatically download PRT from github and set in build script
namespace
{
const int VERSION_MAJOR = 3;
const int VERSION_MINOR = 1;
} // namespace

extern "C"
{
CODEC_EXPORTS_API void registerExtensionFactories(prtx::ExtensionManager* manager)
Expand All @@ -37,11 +30,11 @@ extern "C"

CODEC_EXPORTS_API int getVersionMajor()
{
return VERSION_MAJOR;
return PRT_VERSION_MAJOR;
}

CODEC_EXPORTS_API int getVersionMinor()
{
return VERSION_MINOR;
return PRT_VERSION_MINOR;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,9 @@ using RuleFileInfoUPtr = std::unique_ptr<const prt::RuleFileInfo, PRTDestroyer>;
using EncoderInfoUPtr = std::unique_ptr<const prt::EncoderInfo, PRTDestroyer>;
using OcclusionSetUPtr = std::unique_ptr<prt::OcclusionSet, PRTDestroyer>;
using ResolveMapSPtr = std::shared_ptr<prt::ResolveMap const>;

template <typename T>
std::shared_ptr<T> prt_make_shared(T* ptr)
{
return std::shared_ptr<T>(ptr, PRTDestroyer {});
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace prtu

constexpr const wchar_t* ANNOT_START_RULE = L"@StartRule";

inline std::wstring detectStartRule(const RuleFileInfoUPtr& ruleFileInfo)
inline std::wstring detectStartRule(const RuleFileInfoPtr& ruleFileInfo)
{
for (size_t r = 0; r < ruleFileInfo->getNumRules(); r++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public UnrealGeometryEncoderTarget(TargetInfo Target)
bCompileAgainstApplicationCore = false;
bCompileICU = false;
bUsesSlate = false;
bDisableDebugInfo = false;
DebugInfo = DebugInfoMode.Full;
bUsePDBFiles = true;
bHasExports = true;
bIsBuildingConsoleApplication = true;
Expand Down
13 changes: 8 additions & 5 deletions VitruvioHost/Plugins/Vitruvio/Source/ThirdParty/PRT/PRT.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ public class PRT : ModuleRules

// PRT version and toolchain (needs to be correct for download URL)
private const int PrtMajor = 3;
private const int PrtMinor = 1;
private const int PrtBuild = 9666;
private const int PrtMinor = 2;
private const int PrtBuild = 10650;
private const string PrtToolchain = "win10-vc1437-x86_64-rel-opt";

private const string PrtCoreDllName = "com.esri.prt.core.dll";

Expand Down Expand Up @@ -71,7 +72,7 @@ public PRT(ReadOnlyTargetRules Target) : base(Target)
string PrtUrl = "https://github.com/Esri/esri-cityengine-sdk/releases/download";
string PrtVersion = string.Format("{0}.{1}.{2}", PrtMajor, PrtMinor, PrtBuild);

string PrtLibName = string.Format("esri_ce_sdk-{0}-{1}", PrtVersion, Platform.PrtPlatform);
string PrtLibName = string.Format("esri_ce_sdk-{0}-{1}", PrtVersion, PrtToolchain);
string PrtLibZipFile = PrtLibName + ".zip";
string PrtDownloadUrl = Path.Combine(PrtUrl, PrtVersion, PrtLibZipFile);

Expand Down Expand Up @@ -142,6 +143,10 @@ public PRT(ReadOnlyTargetRules Target) : base(Target)
// Add include search path
if (Debug) Console.WriteLine("Adding include search path " + IncludeDir);
PublicSystemIncludePaths.Add(IncludeDir);

// Add prt version defines
PublicDefinitions.Add($"PRT_VERSION_MAJOR={PrtMajor}");
PublicDefinitions.Add($"PRT_VERSION_MINOR={PrtMinor}");
}

void Copy(string SrcDir, string DstDir, List<string> Filter = null)
Expand Down Expand Up @@ -225,7 +230,6 @@ private abstract class AbstractPlatform
public abstract AbstractZipExtractor ZipExtractor { get; }

public abstract string Name { get; }
public abstract string PrtPlatform { get; }
public abstract string DynamicLibExtension { get; }

protected bool Debug;
Expand Down Expand Up @@ -266,7 +270,6 @@ private class WindowsPlatform : AbstractPlatform
public override AbstractZipExtractor ZipExtractor { get { return new WindowsZipExtractor(); } }

public override string Name { get { return "Win64"; } }
public override string PrtPlatform { get { return "win10-vc1427-x86_64-rel-opt"; } }
public override string DynamicLibExtension { get { return ".dll"; } }

public WindowsPlatform(bool Debug) : base(Debug)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2024 Esri
/* Copyright 2023 Esri
*
* Licensed under the Apache License Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -61,4 +61,4 @@ template <typename T>
std::shared_ptr<T> prt_make_shared(T* ptr)
{
return std::shared_ptr<T>(ptr, PRTDestroyer {});
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2024 Esri
/* Copyright 2023 Esri
*
* Licensed under the Apache License Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ FGenerateResultDescription VitruvioModule::BatchGenerate(TArray<FInitialShape> I

if (GenerateStatus != prt::STATUS_OK)
{
GenerateCallsCounter.Subtract(InitialShapes.Num());
UE_LOG(LogUnrealPrt, Error, TEXT("PRT generate failed: %hs"), prt::getStatusDescription(GenerateStatus))
return {};
}
Expand Down Expand Up @@ -547,6 +548,7 @@ FGenerateResultDescription VitruvioModule::BatchGenerate(TArray<FInitialShape> I

if (GenerateStatus != prt::STATUS_OK)
{
GenerateCallsCounter.Subtract(InitialShapes.Num());
UE_LOG(LogUnrealPrt, Error, TEXT("PRT generate failed: %hs"), prt::getStatusDescription(GenerateStatus))
return {};
}
Expand Down Expand Up @@ -612,6 +614,7 @@ FGenerateResultDescription VitruvioModule::Generate(const FInitialShape& Initial
const prt::Status GenerateStatus = prt::generate(Shapes.data(), Shapes.size(), nullptr, EncoderIds.data(), EncoderIds.size(),
EncoderOptions.data(), OutputHandler.Get(), PrtCache.get(), nullptr);

GenerateCallsCounter.Decrement();
if (GenerateStatus != prt::STATUS_OK)
{
UE_LOG(LogUnrealPrt, Error, TEXT("PRT generate failed: %hs"), prt::getStatusDescription(GenerateStatus))
Expand All @@ -620,7 +623,6 @@ FGenerateResultDescription VitruvioModule::Generate(const FInitialShape& Initial

CHECK_PRT_INITIALIZED()

GenerateCallsCounter.Decrement();
NotifyGenerateCompleted();

return FGenerateResultDescription{ OutputHandler->GetGeneratedModel(), OutputHandler->GetInstances(), OutputHandler->GetInstanceMeshes(),
Expand Down

0 comments on commit f08f0f1

Please sign in to comment.