Files
o3de/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.inl
T
amzn-mike ee6ceba5ce Add serialized output version (xml) of debug scene graph (#3437)
* Add serialized output version (xml) of debug scene graph

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Fix line endings

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Fix line endings

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Update fbx unit tests to check for dbgsg.xml file

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Add dbgsg.xml comparison

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Move dbgsg files to SceneDebug sub folder

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Add shaderball.dbgsg.xml and multiple_mesh_multiple_material_override.dbgsg.xml

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Add shaderball dbgsg.xml product.

Update code to look in SceneDebug for dbgsg files
Fix extension concatenation

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Remove unnecessary dbgsg.xml file

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>
2021-10-26 09:07:22 -07:00

40 lines
1.2 KiB
C++

/*
* 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
*
*/
#pragma once
namespace AZ::SceneAPI::Utilities
{
template <typename T>
void DebugOutput::Write(const char* name, const AZStd::vector<T>& data)
{
size_t hash = AZStd::hash_range(data.begin(), data.end());
m_output += AZStd::string::format("\t%s: Count %zu. Hash: %zu\n", name, data.size(), hash);
AddToNode(AZStd::string::format("%s - Count", name).c_str(), data.size());
AddToNode(AZStd::string::format("%s - Hash", name).c_str(), hash);
}
template <typename T>
void DebugOutput::Write(const char* name, const AZStd::vector<AZStd::vector<T>>& data)
{
size_t hash = 0;
for (auto&& vector : data)
{
AZStd::hash_combine(hash, AZStd::hash_range(vector.begin(), vector.end()));
}
m_output += AZStd::string::format("\t%s: Count %zu. Hash: %zu\n", name, data.size(), hash);
AddToNode(AZStd::string::format("%s - Count", name).c_str(), data.size());
AddToNode(AZStd::string::format("%s - Hash", name).c_str(), hash);
}
}