Merge branch 'development' into cmake/SPEC-2513_w4267

This commit is contained in:
Esteban Papp
2021-08-02 18:03:04 -07:00
493 changed files with 7775 additions and 12867 deletions
@@ -197,10 +197,20 @@ namespace AssetProcessor
{
return priorityLeft > priorityRight;
}
// Optionally stabilize queue order on the source name.
// This is used in automated tests, to allow tests to have a stable
// order that jobs with otherwise equal priority run, so tests process
// assets in the same order each time they are run.
if (m_sortQueueOnDBSourceName)
{
return leftJob->GetJobEntry().m_databaseSourceName < rightJob->GetJobEntry().m_databaseSourceName;
}
// if we get all the way down here it means we're dealing with two assets which are not
// in any compile groups, not a priority platform, not a priority type, priority platform, etc.
// we can arrange these any way we want, but must pick at least a stable order.
return leftJob->GetJobEntry().m_jobRunKey < rightJob->GetJobEntry().m_jobRunKey;
}
@@ -50,6 +50,10 @@ namespace AssetProcessor
void AddJobIdEntry(AssetProcessor::RCJob* rcJob);
void RemoveJobIdEntry(AssetProcessor::RCJob* rcJob);
void SetQueueSortOnDBSourceName()
{
m_sortQueueOnDBSourceName = true;
}
// implement QSortFilteRProxyModel:
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;
@@ -68,6 +72,11 @@ namespace AssetProcessor
QSet<QString> m_currentlyConnectedPlatforms;
bool m_dirtyNeedsResort = false; // instead of constantly resorting, we resort only when someone wants to pull an element from us
// By default, jobs with equal priority and escalation sort on the job run key. This flag changes
// jobs to sort on the database source name. This is used for testing, to guarantee jobs run in the same
// order for those tests each time they are run.
bool m_sortQueueOnDBSourceName = false;
// ---------------------------------------------------------
// AssetProcessorPlatformBus::Handler
void AssetProcessorPlatformConnected(const AZStd::string platform) override;
@@ -163,6 +163,11 @@ namespace AssetProcessor
return ((!m_RCQueueSortModel.GetNextPendingJob()) && (m_RCJobListModel.jobsInFlight() == 0));
}
void RCController::SetQueueSortOnDBSourceName()
{
m_RCQueueSortModel.SetQueueSortOnDBSourceName();
}
void RCController::JobSubmitted(JobDetails details)
{
AssetProcessor::QueueElementID checkFile(details.m_jobEntry.m_databaseSourceName, details.m_jobEntry.m_platformInfo.m_identifier.c_str(), details.m_jobEntry.m_jobKey);
@@ -54,10 +54,11 @@ namespace AssetProcessor
void StartJob(AssetProcessor::RCJob* rcJob);
int NumberOfPendingCriticalJobsPerPlatform(QString platform);
void SetSystemRoot(const QDir& systemRoot);
int NumberOfPendingJobsPerPlatform(QString platform);
bool IsIdle();
bool IsPriorityCopyJob(AssetProcessor::RCJob* rcJob);
void SetQueueSortOnDBSourceName();
Q_SIGNALS:
void FileCompiled(JobEntry entry, AssetBuilderSDK::ProcessJobResponse response);
void FileFailed(JobEntry entry);