Adds unused calls to Trace functions to prevent constant failures in release builds

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-09-09 09:11:19 -07:00
committed by GitHub
32 changed files with 73 additions and 80 deletions
@@ -153,7 +153,9 @@ namespace AZ
void AssetCreator<AssetDataT>::ReportError([[maybe_unused]] const char* format, [[maybe_unused]] Args... args)
{
++m_errorCount;
#if defined(AZ_ENABLE_TRACING) // disabling since it requires argument expansion in this context
AZ_Error(m_assetClassName, false, format, args...);
#endif
}
template<typename AssetDataT>
@@ -161,7 +163,9 @@ namespace AZ
void AssetCreator<AssetDataT>::ReportWarning([[maybe_unused]] const char* format, [[maybe_unused]] Args... args)
{
++m_warningCount;
#if defined(AZ_ENABLE_TRACING) // disabling since it requires argument expansion in this context
AZ_Warning(m_assetClassName, false, format, args...);
#endif
}
template<typename AssetDataT>
@@ -1078,9 +1078,7 @@ namespace AZ
template<typename T>
void ModelAssetBuilderComponent::ValidateStreamSize([[maybe_unused]] size_t expectedVertexCount, [[maybe_unused]] const AZStd::vector<T>& bufferData, [[maybe_unused]] AZ::RHI::Format format, [[maybe_unused]] const char* streamName) const
{
#if defined(AZ_ENABLE_TRACING)
size_t actualVertexCount = (bufferData.size() * sizeof(T)) / RHI::GetFormatSize(format);
#endif
AZ_Error(s_builderName, expectedVertexCount == actualVertexCount, "VertexStream '%s' does not match the expected vertex count. This typically means multiple sub-meshes have mis-matched vertex stream layouts (such as one having more uv sets than the other) but are assigned the same material in the dcc tool so they were merged.", streamName);
}
@@ -70,11 +70,9 @@ namespace AZ::RPI
{
const Containers::SceneGraph& sceneGraph = scene.GetGraph();
#if defined(AZ_ENABLE_TRACING)
const auto baseMeshIt = AZStd::find(sceneGraph.GetContentStorage().cbegin(), sceneGraph.GetContentStorage().cend(), sourceMesh.m_meshData);
const Containers::SceneGraph::NodeIndex baseMeshIndex = sceneGraph.ConvertToNodeIndex(baseMeshIt);
const AZStd::string_view baseMeshName{sceneGraph.GetNodeName(baseMeshIndex).GetName(), sceneGraph.GetNodeName(baseMeshIndex).GetNameLength()};
#endif
// Get the blend shapes for the given mesh
AZStd::unordered_map<AZStd::string, SourceBlendShapeInfo> blendShapeInfos = GetBlendShapeInfos(scene, sourceMesh.m_meshData.get());
@@ -90,10 +88,8 @@ namespace AZ::RPI
AZ_Assert(blendShapeData, "Node is expected to be a blend shape.");
if (blendShapeData)
{
#if defined(AZ_ENABLE_TRACING)
const Containers::SceneGraph::NodeIndex morphMeshParentIndex = sceneGraph.GetNodeParent(sceneNodeIndex);
const AZStd::string_view sourceMeshName{sceneGraph.GetNodeName(morphMeshParentIndex).GetName(), sceneGraph.GetNodeName(morphMeshParentIndex).GetNameLength()};
#endif
AZ_Assert(AZ::StringFunc::Equal(baseMeshName, sourceMeshName, /*bCaseSensitive=*/true),
"Scene graph mesh node (%.*s) has a different name than the product mesh (%.*s).",
@@ -419,9 +419,7 @@ namespace AZ
{
if (!materialPropertyDependencies.test(index.GetIndex()))
{
#if defined(AZ_ENABLE_TRACING)
const MaterialPropertyDescriptor* propertyDescriptor = materialPropertiesLayout.GetPropertyDescriptor(index);
#endif
AZ_Error("MaterialFunctor", false, "Material functor accessing an unregistered material property '%s'.",
propertyDescriptor ? propertyDescriptor->GetName().GetCStr() : "<unknown>");
}
@@ -206,10 +206,7 @@ namespace EditorPythonBindings
if (eventName == e.m_name)
{
AZStd::string eventNameValue{ eventName };
#if defined(AZ_ENABLE_TRACING)
const auto& callbackIt = m_callbackMap.find(eventNameValue);
#endif
AZ_Warning("python", m_callbackMap.end() == callbackIt, "Replacing callback for eventName:%s", eventNameValue.c_str());
AZ_Warning("python", m_callbackMap.end() == m_callbackMap.find(eventNameValue), "Replacing callback for eventName:%s", eventNameValue.c_str());
m_callbackMap[eventNameValue] = callback;
return true;
}
@@ -253,12 +253,10 @@ namespace BenchmarkAssetBuilder
// and 2 bytes of storage for text-based formats.
// This is just an approximate total size because there's a bit of additional overhead
// for asset headers and the other fields in the generated asset.
#if defined(AZ_ENABLE_TRACING)
uint64_t approximateTotalStorageBytes =
(settingsPtr->m_assetStorageType == AZ::DataStream::StreamType::ST_BINARY)
? UINT64_C(1) * totalGeneratedBytes
: UINT64_C(2) * totalGeneratedBytes;
#endif
AZ_TracePrintf(AssetBuilderSDK::InfoWindow,
"Benchmark asset generation will generate %" PRIu64 " assets "
@@ -154,9 +154,7 @@ namespace ScriptCanvasEditor
const ScriptEvents::ScriptEvent& definition = data->m_definition;
#if defined(AZ_ENABLE_TRACING)
bool recategorize = previousDefinition ? definition.GetCategory().compare(previousDefinition->GetCategory()) != 0 : false;
#endif
AZ_Warning("ScriptCanvas", !recategorize, "Unable to recategorize ScriptEvents events while open. Please close and re-open the Script Canvas Editor to see the new categorization");
if (definition.GetName().empty())
@@ -116,7 +116,7 @@ namespace ScriptCanvas
return;
}
#else
AZ_Assert(m_runtimeAsset.Get(), "RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run", m_runtimeOverrides.m_runtimeAsset.GetId().ToString<AZStd::string>().data());
AZ_Assert(m_runtimeOverrides.m_runtimeAsset.Get(), "RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run", m_runtimeOverrides.m_runtimeAsset.GetId().ToString<AZStd::string>().data());
#endif
AZ_PROFILE_SCOPE(ScriptCanvas, "RuntimeComponent::InitializeExecution (%s)", m_runtimeOverrides.m_runtimeAsset.GetId().ToString<AZStd::string>().c_str());
@@ -130,7 +130,7 @@ namespace ScriptCanvas
return;
}
#else
AZ_Assert(m_executionState, "RuntimeComponent::m_runtimeAsset AssetId: %s failed to create an execution state, possibly due to missing dependent asset, script will not run", m_runtimeAsset.GetId().ToString<AZStd::string>().data());
AZ_Assert(m_executionState, "RuntimeComponent::m_runtimeAsset AssetId: %s failed to create an execution state, possibly due to missing dependent asset, script will not run", m_runtimeOverrides.m_runtimeAsset.GetId().ToString<AZStd::string>().data());
#endif
AZ::EntityBus::Handler::BusConnect(GetEntityId());
@@ -73,9 +73,7 @@ namespace WhiteBox
for (AZ::u32 i = 0; i < triangleCount; ++i)
{
#if defined(AZ_ENABLE_TRACING)
const auto& trianglePositions = trianglesPositions[i];
#endif
const auto& triangleUVs = trianglesUVs[i];
const auto& triangleEdges = trianglesEdges[i];