Fix release build errors on Linux/Mac (#4474)

* - Fix unused release warnings
- Fixed compile errors from missing includes
- Commented out missing AZ_ATOM_PROFILE_FUNCTION macro

Signed-off-by: Steve Pham <spham@amazon.com>

* Deleted AZ_ATOM_PROFILE_FUNCTION

Signed-off-by: Steve Pham <spham@amazon.com>

* Adding more unused errors from windows release build, and updates based on PR suggestions

Signed-off-by: Steve Pham <spham@amazon.com>
monroegm-disable-blank-issue-2
Steve Pham 4 years ago committed by GitHub
parent 6c3ac70531
commit 6dcdb5787a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,7 +21,7 @@
namespace AzToolsFramework namespace AzToolsFramework
{ {
constexpr const char s_traceName[] = "ArchiveComponent"; [[maybe_unused]] constexpr const char s_traceName[] = "ArchiveComponent";
constexpr AZ::u32 s_compressionMethod = AZ::IO::INestedArchive::METHOD_DEFLATE; constexpr AZ::u32 s_compressionMethod = AZ::IO::INestedArchive::METHOD_DEFLATE;
constexpr AZ::s32 s_compressionLevel = AZ::IO::INestedArchive::LEVEL_NORMAL; constexpr AZ::s32 s_compressionLevel = AZ::IO::INestedArchive::LEVEL_NORMAL;
constexpr CompressionCodec::Codec s_compressionCodec = CompressionCodec::Codec::ZLIB; constexpr CompressionCodec::Codec s_compressionCodec = CompressionCodec::Codec::ZLIB;

@ -927,7 +927,7 @@ namespace AzToolsFramework
PrefabDomValue& instance = instanceIterator->value; PrefabDomValue& instance = instanceIterator->value;
AZ_Assert(instance.IsObject(), "Nested instance DOM provided is not a valid JSON object."); AZ_Assert(instance.IsObject(), "Nested instance DOM provided is not a valid JSON object.");
PrefabDomValueReference sourceTemplateName = PrefabDomUtils::FindPrefabDomValue(instance, PrefabDomUtils::SourceName); [[maybe_unused]] PrefabDomValueReference sourceTemplateName = PrefabDomUtils::FindPrefabDomValue(instance, PrefabDomUtils::SourceName);
AZ_Assert(sourceTemplateName, "Couldn't find source template name in the DOM of the nested instance while creating a link."); AZ_Assert(sourceTemplateName, "Couldn't find source template name in the DOM of the nested instance while creating a link.");
AZ_Assert(sourceTemplateName->get() == sourceTemplate.GetFilePath().c_str(), AZ_Assert(sourceTemplateName->get() == sourceTemplate.GetFilePath().c_str(),
"The name of the source template in the nested instance DOM does not match the name of the source template already loaded"); "The name of the source template in the nested instance DOM does not match the name of the source template already loaded");

@ -9,6 +9,7 @@
#pragma once #pragma once
#include <AzCore/Asset/AssetCommon.h> #include <AzCore/Asset/AssetCommon.h>
#include <AzCore/Asset/AssetSerializer.h>
#include <AzFramework/Asset/GenericAssetHandler.h> #include <AzFramework/Asset/GenericAssetHandler.h>
#include <TressFX/TressFXAsset.h> #include <TressFX/TressFXAsset.h>

@ -39,7 +39,7 @@ namespace AZ
Data::Instance<RPI::ShaderResourceGroup> UtilityClass::CreateShaderResourceGroup( Data::Instance<RPI::ShaderResourceGroup> UtilityClass::CreateShaderResourceGroup(
Data::Instance<RPI::Shader> shader, Data::Instance<RPI::Shader> shader,
const char* shaderResourceGroupId, const char* shaderResourceGroupId,
const char* moduleName) [[maybe_unused]] const char* moduleName)
{ {
Data::Instance<RPI::ShaderResourceGroup> srg = RPI::ShaderResourceGroup::Create(shader->GetAsset(), AZ::Name{ shaderResourceGroupId }); Data::Instance<RPI::ShaderResourceGroup> srg = RPI::ShaderResourceGroup::Create(shader->GetAsset(), AZ::Name{ shaderResourceGroupId });
if (!srg) if (!srg)
@ -54,7 +54,7 @@ namespace AZ
//! If srg is nullptr the index handle will NOT be set. //! If srg is nullptr the index handle will NOT be set.
//! This can be useful when creating a constant buffer or an image. //! This can be useful when creating a constant buffer or an image.
Data::Instance<RPI::Buffer> UtilityClass::CreateBuffer( Data::Instance<RPI::Buffer> UtilityClass::CreateBuffer(
const char* warningHeader, [[maybe_unused]] const char* warningHeader,
SrgBufferDescriptor& bufferDesc, SrgBufferDescriptor& bufferDesc,
Data::Instance<RPI::ShaderResourceGroup> srg) Data::Instance<RPI::ShaderResourceGroup> srg)
{ {
@ -84,7 +84,7 @@ namespace AZ
} }
bool UtilityClass::BindBufferToSrg( bool UtilityClass::BindBufferToSrg(
const char* warningHeader, [[maybe_unused]] const char* warningHeader,
Data::Instance<RPI::Buffer> buffer, Data::Instance<RPI::Buffer> buffer,
SrgBufferDescriptor& bufferDesc, SrgBufferDescriptor& bufferDesc,
Data::Instance<RPI::ShaderResourceGroup> srg) Data::Instance<RPI::ShaderResourceGroup> srg)

@ -201,7 +201,6 @@ namespace AZ
void HairFeatureProcessor::Simulate(const FeatureProcessor::SimulatePacket& packet) void HairFeatureProcessor::Simulate(const FeatureProcessor::SimulatePacket& packet)
{ {
AZ_PROFILE_FUNCTION(AzRender); AZ_PROFILE_FUNCTION(AzRender);
AZ_ATOM_PROFILE_FUNCTION("Hair", "HairFeatureProcessor: Simulate");
AZ_UNUSED(packet); AZ_UNUSED(packet);
if (m_hairRenderObjects.empty()) if (m_hairRenderObjects.empty())
@ -250,7 +249,6 @@ namespace AZ
void HairFeatureProcessor::Render([[maybe_unused]] const FeatureProcessor::RenderPacket& packet) void HairFeatureProcessor::Render([[maybe_unused]] const FeatureProcessor::RenderPacket& packet)
{ {
AZ_PROFILE_FUNCTION(AzRender); AZ_PROFILE_FUNCTION(AzRender);
AZ_ATOM_PROFILE_FUNCTION("Hair", "HairFeatureProcessor: Render");
if (!m_initialized || !m_addDispatchEnabled) if (!m_initialized || !m_addDispatchEnabled)
{ // Skip adding dispatches / Draw packets for this frame until initialized and the shaders are ready { // Skip adding dispatches / Draw packets for this frame until initialized and the shaders are ready

@ -387,7 +387,7 @@ namespace AZ
//! Updates the buffers data for the hair generation. //! Updates the buffers data for the hair generation.
//! Notice: does not update the bone matrices that will be updated every frame. //! Notice: does not update the bone matrices that will be updated every frame.
bool HairRenderObject::UploadGPUData(const char* name, AMD::TressFXAsset* asset) bool HairRenderObject::UploadGPUData([[maybe_unused]] const char* name, AMD::TressFXAsset* asset)
{ {
// The following must correlate the order in HairGenerationBuffersSemantics // The following must correlate the order in HairGenerationBuffersSemantics
void* buffersData[uint8_t(HairGenerationBuffersSemantics::NumBufferStreams)] = { void* buffersData[uint8_t(HairGenerationBuffersSemantics::NumBufferStreams)] = {
@ -526,7 +526,7 @@ namespace AZ
//! Creation of the render Srg m_hairRenderSrg, followed by creation and binding of the //! Creation of the render Srg m_hairRenderSrg, followed by creation and binding of the
//! GPU render resources: vertex thickness, vertex UV, hair albedo maps and two constant buffers. //! GPU render resources: vertex thickness, vertex UV, hair albedo maps and two constant buffers.
bool HairRenderObject::CreateRenderingGPUResources( bool HairRenderObject::CreateRenderingGPUResources(
Data::Instance<RPI::Shader> shader, AMD::TressFXAsset& asset, const char* assetName) Data::Instance<RPI::Shader> shader, AMD::TressFXAsset& asset, [[maybe_unused]] const char* assetName)
{ {
//-------------------- Render Srg Creation --------------------- //-------------------- Render Srg Creation ---------------------
m_hairRenderSrg = UtilityClass::CreateShaderResourceGroup(shader, "HairRenderingMaterialSrg", "Hair Gem"); m_hairRenderSrg = UtilityClass::CreateShaderResourceGroup(shader, "HairRenderingMaterialSrg", "Hair Gem");
@ -592,7 +592,7 @@ namespace AZ
return false; return false;
} }
RHI::ResultCode result = bufferPool->InitBuffer(request); [[maybe_unused]] RHI::ResultCode result = bufferPool->InitBuffer(request);
AZ_Error("Hair Gem", result == RHI::ResultCode::Success, "Failed to initialize index buffer - error [%d]", result); AZ_Error("Hair Gem", result == RHI::ResultCode::Success, "Failed to initialize index buffer - error [%d]", result);
// create index buffer view // create index buffer view

@ -776,9 +776,11 @@ namespace AMD
EI_Read((char*)&skinData.weight[j], sizeof(AMD::real32), ioObject); EI_Read((char*)&skinData.weight[j], sizeof(AMD::real32), ioObject);
} }
#if defined(AZ_ENABLE_TRACING)
float weightSum = skinData.weight[0] + skinData.weight[1] + skinData.weight[2] + skinData.weight[3]; float weightSum = skinData.weight[0] + skinData.weight[1] + skinData.weight[2] + skinData.weight[3];
AZ_Assert(weightSum > 0.0f, "Weight sum should be greater than 0"); AZ_Assert(weightSum > 0.0f, "Weight sum should be greater than 0");
#endif // AZ_ENABLE_TRACING
assert(skinData.weight[0] != 0.0f); assert(skinData.weight[0] != 0.0f);
// If bone index is -1, then it means that there is no bone associated to this. In this case we simply replace it with zero. // If bone index is -1, then it means that there is no bone associated to this. In this case we simply replace it with zero.
@ -854,9 +856,11 @@ namespace AMD
stream->Read(sizeof(AMD::real32), &skinData.weight[j]); stream->Read(sizeof(AMD::real32), &skinData.weight[j]);
} }
#if defined(AZ_ENABLE_TRACING)
float weightSum = skinData.weight[0] + skinData.weight[1] + skinData.weight[2] + skinData.weight[3]; float weightSum = skinData.weight[0] + skinData.weight[1] + skinData.weight[2] + skinData.weight[3];
AZ_Assert(weightSum > 0.0f, "Weight sum should be greater than 0"); AZ_Assert(weightSum > 0.0f, "Weight sum should be greater than 0");
#endif // AZ_ENABLE_TRACING
assert(skinData.weight[0] != 0.0f); assert(skinData.weight[0] != 0.0f);
// If bone index is -1, then it means that there is no bone associated to this. In this case we simply replace it with zero. // If bone index is -1, then it means that there is no bone associated to this. In this case we simply replace it with zero.

@ -27,6 +27,8 @@
#include <AzCore/Serialization/EditContext.h> #include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/SerializeContext.h> #include <AzCore/Serialization/SerializeContext.h>
#include <Assets/HairAsset.h>
namespace AMD namespace AMD
{ {
void TressFXSimulationSettings::Reflect(AZ::ReflectContext* context) void TressFXSimulationSettings::Reflect(AZ::ReflectContext* context)

Loading…
Cancel
Save