Merge commit 'f1d9e7ae28bf0667487c939aa32b1ef833da80f4' into amzn-tommy/gitflow_211116_o3de2
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fb91c050a829ff03b972202cf8c90034e4f252d972332224791d135c07d9d528
|
||||
size 796
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:28c3cfd8958813b4b539738bfff589731da0aeec5b3376558f377da2ebe973ff
|
||||
size 5455
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8a0935be7347d695ed1716d030b5bae68153a88239b0ff15f67f900ac90be442
|
||||
size 5038
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bb243cd6d6414b4e95eab919fa94193b57825902b8d09f40ce3f334d829e74e2
|
||||
size 6286
|
||||
@@ -24,6 +24,22 @@
|
||||
<Class name="unsigned int" field="platformFlags" value="3" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::string" field="pathHint" value="shader/sceneandviewsrgs.azshader" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
<Class name="SeedInfo" field="element" version="2" type="{FACC3682-2ACA-4AA4-B85A-07AD276D18A0}">
|
||||
<Class name="AssetId" field="assetId" version="1" type="{652ED536-3402-439B-AEBE-4A5DBC554085}">
|
||||
<Class name="AZ::Uuid" field="guid" value="{FFF65E99-3A75-5734-BC40-E7D6796B1789}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="subId" value="1000" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
</Class>
|
||||
<Class name="unsigned int" field="platformFlags" value="3" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::string" field="pathHint" value="textures/defaults/defaultfallback.png.streamingimage" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
<Class name="SeedInfo" field="element" version="2" type="{FACC3682-2ACA-4AA4-B85A-07AD276D18A0}">
|
||||
<Class name="AssetId" field="assetId" version="1" type="{652ED536-3402-439B-AEBE-4A5DBC554085}">
|
||||
<Class name="AZ::Uuid" field="guid" value="{BBA1FB65-974C-55D2-B549-806FA42A2115}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="subId" value="1000" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
</Class>
|
||||
<Class name="unsigned int" field="platformFlags" value="3" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::string" field="pathHint" value="textures/defaults/missing.png.streamingimage" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</ObjectStream>
|
||||
|
||||
|
||||
@@ -25,6 +25,9 @@ namespace AZ
|
||||
const Data::Asset<Data::AssetData>& asset,
|
||||
AZStd::shared_ptr<Data::AssetDataStream> stream,
|
||||
const Data::AssetFilterCB& assetLoadFilterCB) override;
|
||||
|
||||
// Return a default fallback image if an asset is missing
|
||||
Data::AssetId AssetMissingInCatalog(const Data::Asset<Data::AssetData>& /*asset*/) override;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
|
||||
#include <Atom/RPI.Reflect/Image/StreamingImageAssetHandler.h>
|
||||
#include <AzCore/Settings/SettingsRegistry.h>
|
||||
#include <AzFramework/Asset/AssetSystemBus.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -40,5 +42,56 @@ namespace AZ
|
||||
|
||||
return loadResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Data::AssetId StreamingImageAssetHandler::AssetMissingInCatalog(const Data::Asset<Data::AssetData>& asset)
|
||||
{
|
||||
// Find out if the asset is missing completely, or just still processing
|
||||
// and escalate the asset to the top of the list
|
||||
AzFramework::AssetSystem::AssetStatus missingAssetStatus;
|
||||
AzFramework::AssetSystemRequestBus::BroadcastResult(
|
||||
missingAssetStatus, &AzFramework::AssetSystem::AssetSystemRequests::GetAssetStatusById, asset.GetId().m_guid);
|
||||
|
||||
// Determine which fallback image to use
|
||||
const char* relativePath = "textures/defaults/defaultfallback.png.streamingimage";
|
||||
|
||||
bool useDebugFallbackImages = true;
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
settingsRegistry->GetObject(useDebugFallbackImages, "/O3DE/Atom/RPI/UseDebugFallbackImages");
|
||||
}
|
||||
|
||||
if (useDebugFallbackImages)
|
||||
{
|
||||
switch (missingAssetStatus)
|
||||
{
|
||||
case AzFramework::AssetSystem::AssetStatus::AssetStatus_Queued:
|
||||
case AzFramework::AssetSystem::AssetStatus::AssetStatus_Compiling:
|
||||
relativePath = "textures/defaults/processing.png.streamingimage";
|
||||
break;
|
||||
case AzFramework::AssetSystem::AssetStatus::AssetStatus_Failed:
|
||||
relativePath = "textures/defaults/processingfailed.png.streamingimage";
|
||||
break;
|
||||
case AzFramework::AssetSystem::AssetStatus::AssetStatus_Missing:
|
||||
case AzFramework::AssetSystem::AssetStatus::AssetStatus_Unknown:
|
||||
case AzFramework::AssetSystem::AssetStatus::AssetStatus_Compiled:
|
||||
relativePath = "textures/defaults/missing.png.streamingimage";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure the fallback image has been processed
|
||||
AzFramework::AssetSystem::AssetStatus status = AzFramework::AssetSystem::AssetStatus_Unknown;
|
||||
AzFramework::AssetSystemRequestBus::BroadcastResult(
|
||||
status, &AzFramework::AssetSystemRequestBus::Events::CompileAssetSync, relativePath);
|
||||
|
||||
// Return the asset id of the fallback image
|
||||
Data::AssetId assetId{};
|
||||
bool autoRegisterIfNotFound = false;
|
||||
Data::AssetCatalogRequestBus::BroadcastResult(
|
||||
assetId, &Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, relativePath,
|
||||
azrtti_typeid<AZ::RPI::StreamingImageAsset>(), autoRegisterIfNotFound);
|
||||
|
||||
return assetId;
|
||||
}
|
||||
} // namespace RPI
|
||||
} // namespace AZ
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"O3DE": {
|
||||
"Atom": {
|
||||
"RPI": {
|
||||
"UseDebugFallbackImages": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,8 @@
|
||||
"DynamicDrawSystemDescriptor": {
|
||||
"DynamicBufferPoolSize": 50331648 // 3 * 16 * 1024 * 1024 (for 3 frames)
|
||||
}
|
||||
}
|
||||
},
|
||||
"UseDebugFallbackImages": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -163,8 +163,6 @@ namespace AZ
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// If this asset didn't load or isn't a cubemap, release it.
|
||||
configAsset.Release();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
-2
@@ -196,8 +196,6 @@ namespace AZ
|
||||
}
|
||||
else
|
||||
{
|
||||
// If this asset didn't load or isn't a cubemap, release it.
|
||||
m_configuration.m_cubemapAsset.Release();
|
||||
m_featureProcessorInterface->SetCubemap(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user