Merge branch 'development' into cmake/SPEC-7179
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> # Conflicts: # Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin_precompiled.h # Code/Editor/Plugins/EditorCommon/EditorCommon_precompiled.h # Code/Editor/Plugins/EditorCommon/stdafx.cpp # Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin_precompiled.h # Code/Editor/Plugins/PerforcePlugin/PerforcePlugin_precompiled.h # Code/Editor/Plugins/ProjectSettingsTool/ProjectSettingsTool_precompiled.h # Code/Framework/AzToolsFramework/AzToolsFramework/AzToolsFramework_precompiled.h # Code/Tools/AssetProcessor/native/precompiled.h # Code/Tools/Standalone/StandaloneTools_precompiled.h # Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer_precompiled.h # Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageProcessing_precompiled.h # Gems/Atom/RHI/DX12/Code/Source/RHI/Atom_RHI_DX12_precompiled.h # Gems/Atom/RHI/Metal/Code/Include/Platform/Mac/Atom_RHI_Metal_precompiled_Platform.h # Gems/Atom/RHI/Metal/Code/Include/Platform/iOS/Atom_RHI_Metal_precompiled_Platform.h # Gems/Atom/RHI/Metal/Code/Source/Atom_RHI_Metal_precompiled.h # Gems/Atom/RHI/Metal/Code/atom_rhi_metal_common_files.cmake # Gems/Atom/RHI/Null/Code/Source/Atom_RHI_Null_precompiled.h # Gems/Atom/RHI/Null/Code/atom_rhi_null_common_files.cmake # Gems/Atom/RHI/Vulkan/Code/Include/Platform/Android/Atom_RHI_Vulkan_precompiled_Platform.h # Gems/Atom/RHI/Vulkan/Code/Include/Platform/Linux/Atom_RHI_Vulkan_precompiled_Platform.h # Gems/Atom/RHI/Vulkan/Code/Include/Platform/Mac/Atom_RHI_Vulkan_precompiled_Platform.h # Gems/Atom/RHI/Vulkan/Code/Include/Platform/Windows/Atom_RHI_Vulkan_precompiled_Platform.h # Gems/Atom/RHI/Vulkan/Code/Source/Atom_RHI_Vulkan_precompiled.h # Gems/Atom/RHI/Vulkan/Code/Source/RHI/SwapChain.cpp # Gems/Atom/RHI/Vulkan/Code/atom_rhi_vulkan_common_files.cmake # Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/AtomFont_precompiled.h # Gems/Blast/Code/Source/StdAfx.cpp # Gems/Camera/Code/Source/Camera_precompiled.h # Gems/EMotionFX/Code/Source/EMotionFX_precompiled.h # Gems/FastNoise/Code/Source/FastNoise_precompiled.h # Gems/Gestures/Code/Source/Gestures_precompiled.h # Gems/GradientSignal/Code/Source/GradientSignal_precompiled.h # Gems/GraphCanvas/Code/precompiled.h # Gems/ImGui/Code/Source/ImGui_precompiled.h # Gems/InAppPurchases/Code/Source/InAppPurchases_precompiled.h # Gems/LmbrCentral/Code/Source/LmbrCentral_precompiled.h # Gems/LmbrCentral/Code/Tests/ShapeGeometryUtilTest.cpp # Gems/LyShine/Code/Editor/UiCanvasEditor_precompiled.h # Gems/LyShine/Code/Source/Animation/LyShine_precompiled.h # Gems/LyShine/Code/Source/LyShine_precompiled.h # Gems/LyShineExamples/Code/Source/LyShineExamples_precompiled.h # Gems/Maestro/Code/Source/Cinematics/Maestro_precompiled.h # Gems/Maestro/Code/Source/Maestro_precompiled.h # Gems/MessagePopup/Code/Source/MessagePopup_precompiled.h # Gems/Metastream/Code/Source/Metastream_precompiled.h # Gems/Microphone/Code/Source/Microphone_precompiled.h # Gems/Multiplayer/Code/Source/Multiplayer_precompiled.h # Gems/PhysX/Code/NumericalMethods/Source/NumericalMethods_precompiled.h # Gems/PhysX/Code/Source/PhysXUnsupported_precompiled.h # Gems/PhysX/Code/Source/PhysX_precompiled.h # Gems/PhysX/Code/physx_unsupported_files.cmake # Gems/PhysXDebug/Code/Source/PhysXDebugUnsupported_precompiled.h # Gems/PhysXDebug/Code/Source/PhysXDebug_precompiled.h # Gems/ScriptCanvas/Code/Editor/precompiled.h # Gems/ScriptCanvas/Code/Source/precompiled.h # Gems/ScriptCanvasDeveloper/Code/Source/precompiled.h # Gems/ScriptCanvasPhysics/Code/Source/ScriptCanvasPhysics_precompiled.h # Gems/ScriptEvents/Code/Source/precompiled.h # Gems/ScriptEvents/Code/Tests/Editor/EditorTests.cpp # Gems/ScriptedEntityTweener/Code/Source/ScriptedEntityTweener_precompiled.h # Gems/SliceFavorites/Code/Source/SliceFavorites_precompiled.h # Gems/StartingPointCamera/Code/Source/StartingPointCamera_precompiled.h # Gems/StartingPointInput/Code/Source/StartingPointInput_precompiled.h # Gems/StartingPointMovement/Code/Source/StartingPointMovement_precompiled.h # Gems/SurfaceData/Code/Source/SurfaceData_precompiled.h # Gems/TextureAtlas/Code/Source/TextureAtlas_precompiled.h # Gems/TickBusOrderViewer/Code/Source/TickBusOrderViewer_precompiled.h # Gems/Twitch/Code/Source/Twitch_precompiled.h # Gems/VirtualGamepad/Code/Source/VirtualGamepad_precompiled.h # Gems/WhiteBox/Code/Source/WhiteBoxUnsupported_precompiled.h # Gems/WhiteBox/Code/Source/WhiteBox_precompiled.h
This commit is contained in:
+84
-76
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
@@ -849,6 +850,32 @@ namespace AzToolsFramework
|
||||
"SELECT * FROM ProductDependencies WHERE UnresolvedPath LIKE \":%\"";
|
||||
static const auto s_queryProductDependencyExclusions = MakeSqlQuery(GET_PRODUCT_DEPENDENCY_EXCLUSIONS, GET_PRODUCT_DEPENDENCY_EXCLUSIONS_STATEMENT, LOG_NAME);
|
||||
|
||||
static const char* CREATE_UNRESOLVED_PRODUCT_DEPENDENCIES_TEMP_TABLE =
|
||||
"AssetProcessor::CreateUnresolvedProductDependenciesTempTable";
|
||||
static const char* CREATE_UNRESOLVED_PRODUCT_DEPENDENCIES_TEMP_TABLE_STATEMENT =
|
||||
"CREATE TEMPORARY TABLE QueryProductDependenciesUnresolvedAdvanced(search)";
|
||||
static const auto s_createUnresolvedProductDependenciesTempTable = MakeSqlQuery(
|
||||
CREATE_UNRESOLVED_PRODUCT_DEPENDENCIES_TEMP_TABLE, CREATE_UNRESOLVED_PRODUCT_DEPENDENCIES_TEMP_TABLE_STATEMENT, LOG_NAME);
|
||||
|
||||
static const char* INSERT_PRODUCT_DEPENDENCY_TEMP_TABLE_VALUES = "AssetProcessor::InsertProductDependencyTempTableValues";
|
||||
static const char* INSERT_PRODUCT_DEPENDENCY_TEMP_TABLE_VALUES_STATEMENT =
|
||||
"INSERT INTO QueryProductDependenciesUnresolvedAdvanced VALUES (:filename)";
|
||||
static const auto s_queryInsertProductDependencyTempTableValues = MakeSqlQuery(
|
||||
INSERT_PRODUCT_DEPENDENCY_TEMP_TABLE_VALUES,
|
||||
INSERT_PRODUCT_DEPENDENCY_TEMP_TABLE_VALUES_STATEMENT,
|
||||
LOG_NAME,
|
||||
SqlParam<const char*>(":filename"));
|
||||
|
||||
static const char* GET_UNRESOLVED_PRODUCT_DEPENDENCIES_USING_TEMP_TABLE =
|
||||
"AssetProcessor::GetUnresolvedProductDependenciesUsingTempTable";
|
||||
static const char* GET_UNRESOLVED_PRODUCT_DEPENDENCIES_USING_TEMP_TABLE_STATEMENT =
|
||||
"SELECT * FROM ProductDependencies INNER JOIN QueryProductDependenciesUnresolvedAdvanced "
|
||||
"ON (UnresolvedPath LIKE \"%*%\" AND search LIKE REPLACE(UnresolvedPath, \"*\", \"%\")) OR search = UnresolvedPath";
|
||||
static const auto s_queryGetUnresolvedProductDependenciesUsingTempTable = MakeSqlQuery(
|
||||
GET_UNRESOLVED_PRODUCT_DEPENDENCIES_USING_TEMP_TABLE,
|
||||
GET_UNRESOLVED_PRODUCT_DEPENDENCIES_USING_TEMP_TABLE_STATEMENT,
|
||||
LOG_NAME);
|
||||
|
||||
// lookup by primary key
|
||||
static const char* QUERY_FILE_BY_FILEID = "AzToolsFramework::AssetDatabase::QueryFileByFileID";
|
||||
static const char* QUERY_FILE_BY_FILEID_STATEMENT =
|
||||
@@ -1813,6 +1840,9 @@ namespace AzToolsFramework
|
||||
AddStatement(m_databaseConnection, s_queryAllProductdependencies);
|
||||
AddStatement(m_databaseConnection, s_queryUnresolvedProductDependencies);
|
||||
AddStatement(m_databaseConnection, s_queryProductDependencyExclusions);
|
||||
AddStatement(m_databaseConnection, s_createUnresolvedProductDependenciesTempTable);
|
||||
AddStatement(m_databaseConnection, s_queryInsertProductDependencyTempTableValues);
|
||||
AddStatement(m_databaseConnection, s_queryGetUnresolvedProductDependenciesUsingTempTable);
|
||||
|
||||
AddStatement(m_databaseConnection, s_queryFileByFileid);
|
||||
AddStatement(m_databaseConnection, s_queryFilesByFileName);
|
||||
@@ -2479,88 +2509,26 @@ namespace AzToolsFramework
|
||||
return s_queryProductDependencyExclusions.BindAndQuery(*m_databaseConnection, handler, &GetProductDependencyResult);
|
||||
}
|
||||
|
||||
bool AssetDatabaseConnection::QueryProductDependenciesUnresolvedAdvanced(const AZStd::vector<AZStd::string>& searchPaths, productDependencyAndPathHandler handler)
|
||||
bool AssetDatabaseConnection::QueryProductDependenciesUnresolvedAdvanced(
|
||||
const AZStd::vector<AZStd::string>& searchPaths, productDependencyAndPathHandler handler)
|
||||
{
|
||||
AZStd::string sql = R"END(select c.*, b.search FROM (select REPLACE(UnresolvedPath, "*", "%") as search, ProductDependencyID from ProductDependencies where UnresolvedPath LIKE "%*%") as a, ()END";
|
||||
ScopedTransaction transaction(m_databaseConnection);
|
||||
|
||||
bool first = true;
|
||||
bool result = s_createUnresolvedProductDependenciesTempTable.BindAndStep(*m_databaseConnection);
|
||||
|
||||
for(int i = 0; i < searchPaths.size(); ++i)
|
||||
for (auto&& path : searchPaths)
|
||||
{
|
||||
if(first)
|
||||
{
|
||||
sql += "SELECT ? as search ";
|
||||
first = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
sql += "UNION SELECT ? ";
|
||||
}
|
||||
result = s_queryInsertProductDependencyTempTableValues.BindAndStep(*m_databaseConnection, path.c_str()) && result;
|
||||
}
|
||||
|
||||
sql += R"END() as b
|
||||
INNER JOIN ProductDependencies as c ON c.ProductDependencyID = a.ProductDependencyID
|
||||
WHERE b.search LIKE a.search
|
||||
UNION SELECT p.*, UnresolvedPath
|
||||
FROM ProductDependencies as p
|
||||
WHERE UnresolvedPath != ""
|
||||
)END";
|
||||
result = s_queryGetUnresolvedProductDependenciesUsingTempTable.BindAndQuery(
|
||||
*m_databaseConnection, handler, &GetProductDependencyAndPathResult) &&
|
||||
result;
|
||||
|
||||
first = true;
|
||||
result = m_databaseConnection->ExecuteRawSqlQuery("DROP TABLE QueryProductDependenciesUnresolvedAdvanced", nullptr, nullptr) &&
|
||||
result;
|
||||
|
||||
for (int i = 0; i < searchPaths.size(); ++i)
|
||||
{
|
||||
if(first)
|
||||
{
|
||||
sql += " AND ";
|
||||
first = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
sql += " OR ";
|
||||
}
|
||||
|
||||
sql += "UnresolvedPath = ?";
|
||||
}
|
||||
|
||||
bool result = m_databaseConnection->ExecuteRawSqlQuery(sql, [handler](sqlite3_stmt* statement)
|
||||
{
|
||||
ProductDependencyDatabaseEntry entry;
|
||||
|
||||
entry.m_productDependencyID = SQLite::GetColumnInt64(statement, 0);
|
||||
entry.m_productPK = SQLite::GetColumnInt64(statement, 1);
|
||||
entry.m_dependencySourceGuid = SQLite::GetColumnUuid(statement, 2);
|
||||
entry.m_dependencySubID = GetColumnInt(statement, 3);
|
||||
entry.m_platform = GetColumnText(statement, 4);
|
||||
entry.m_dependencyFlags = GetColumnInt64(statement, 5);
|
||||
entry.m_unresolvedPath = GetColumnText(statement, 6);
|
||||
entry.m_dependencyType = static_cast<ProductDependencyDatabaseEntry::DependencyType>(GetColumnInt(statement, 7));
|
||||
entry.m_fromAssetId = sqlite3_column_int(statement, 8);
|
||||
|
||||
AZStd::string matchedPath = GetColumnText(statement, 9);
|
||||
|
||||
handler(entry, matchedPath);
|
||||
|
||||
return true;
|
||||
}, [&searchPaths](sqlite3_stmt* statement)
|
||||
{
|
||||
int index = 1;
|
||||
|
||||
for (const auto& path : searchPaths)
|
||||
{
|
||||
[[maybe_unused]] int res = sqlite3_bind_text(statement, index, path.c_str(), static_cast<int>(path.size()), nullptr);
|
||||
AZ_Assert(res == SQLITE_OK, "Statement::BindValueText: failed to bind!");
|
||||
++index;
|
||||
}
|
||||
|
||||
// Bind the same ones again since we looped this twice when making the query above
|
||||
for (const auto& path : searchPaths)
|
||||
{
|
||||
[[maybe_unused]] int res = sqlite3_bind_text(statement, index, path.c_str(), static_cast<int>(path.size()), nullptr);
|
||||
AZ_Assert(res == SQLITE_OK, "Statement::BindValueText: failed to bind!");
|
||||
++index;
|
||||
}
|
||||
});
|
||||
transaction.Commit();
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -2875,6 +2843,46 @@ namespace AzToolsFramework
|
||||
return GetResult(callName, statement, handler);
|
||||
}
|
||||
|
||||
bool GetProductDependencyAndPathResult(
|
||||
[[maybe_unused]] const char* callName,
|
||||
Statement* statement,
|
||||
AssetDatabaseConnection::productDependencyAndPathHandler handler)
|
||||
{
|
||||
Statement::SqlStatus result = statement->Step();
|
||||
|
||||
ProductDependencyDatabaseEntry productDependency;
|
||||
|
||||
AZStd::string relativeSearchPath;
|
||||
auto boundColumns = CombineColumns(productDependency.GetColumns(), MakeColumns(MakeColumn("search", relativeSearchPath)));
|
||||
|
||||
bool validResult = result == Statement::SqlDone;
|
||||
while (result == Statement::SqlOK)
|
||||
{
|
||||
if (!boundColumns.Fetch(statement))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (handler(productDependency, relativeSearchPath))
|
||||
{
|
||||
result = statement->Step();
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Statement::SqlDone;
|
||||
}
|
||||
validResult = true;
|
||||
}
|
||||
|
||||
if (result == Statement::SqlError)
|
||||
{
|
||||
AZ_Warning(LOG_NAME, false, "Error occurred while stepping %s", callName);
|
||||
return false;
|
||||
}
|
||||
|
||||
return validResult;
|
||||
}
|
||||
|
||||
bool GetMissingProductDependencyResult(const char* callName, SQLite::Statement* statement, AssetDatabaseConnection::missingProductDependencyHandler handler)
|
||||
{
|
||||
return GetResult(callName, statement, handler);
|
||||
|
||||
+5
-2
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
@@ -614,6 +615,7 @@ namespace AzToolsFramework
|
||||
|
||||
//! Returns any unresolved dependencies which match (by exact or wildcard match) the input searchPaths
|
||||
//! The extra path returned for each row is the searchPath entry that was matched with the returned dependency entry
|
||||
//! @param searchPaths vector of relative paths to search for matches
|
||||
bool QueryProductDependenciesUnresolvedAdvanced(const AZStd::vector<AZStd::string>& searchPaths, productDependencyAndPathHandler handler);
|
||||
|
||||
bool QueryMissingProductDependencyByProductId(AZ::s64 productId, missingProductDependencyHandler handler);
|
||||
@@ -668,6 +670,7 @@ namespace AzToolsFramework
|
||||
bool GetProductResult(const char* callName, SQLite::Statement* statement, AssetDatabaseConnection::productHandler handler, AZ::Uuid builderGuid = AZ::Uuid::CreateNull(), const char* jobKey = nullptr, AssetSystem::JobStatus status = AssetSystem::JobStatus::Any);
|
||||
bool GetLegacySubIDsResult(const char* callname, SQLite::Statement* statement, AssetDatabaseConnection::legacySubIDsHandler handler);
|
||||
bool GetProductDependencyResult(const char* callName, SQLite::Statement* statement, AssetDatabaseConnection::productDependencyHandler handler);
|
||||
bool GetProductDependencyAndPathResult(const char* callName, SQLite::Statement* statement, AssetDatabaseConnection::productDependencyAndPathHandler handler);
|
||||
bool GetMissingProductDependencyResult(const char* callName, SQLite::Statement* statement, AssetDatabaseConnection::missingProductDependencyHandler handler);
|
||||
bool GetCombinedDependencyResult(const char* callName, SQLite::Statement* statement, AssetDatabaseConnection::combinedProductDependencyHandler handler);
|
||||
bool GetFileResult(const char* callName, SQLite::Statement* statement, AssetDatabaseConnection::fileHandler handler);
|
||||
|
||||
Reference in New Issue
Block a user