From cf6c7c4d8d3b7f23847939a5506ee50e5345629a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 19 Aug 2021 18:26:43 -0700 Subject: [PATCH] some unused fixes Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/Component/ComponentApplication.cpp | 2 +- .../AzCore/Component/EntitySerializer.cpp | 9 +++---- .../AzCore/AzCore/Component/EntityUtils.cpp | 2 +- .../AzCore/Serialization/AZStdContainers.inl | 2 +- .../AzCore/AzCore/Serialization/DataPatch.cpp | 1 - .../Serialization/std/VariantReflection.inl | 4 +-- .../AzFramework/FileTag/FileTag.cpp | 2 +- .../EntityVisibilityBoundsUnionSystem.cpp | 3 --- .../Process/ProcessWatcher_Linux.cpp | 2 -- .../TcpTransport/TcpListenThread.cpp | 6 ++--- .../AzNetworking/UdpTransport/DtlsSocket.cpp | 2 +- .../AzNetworking/UdpTransport/UdpSocket.cpp | 1 - .../AzNetworking/Utilities/Endian.h | 4 +-- Code/Framework/AzTest/AzTest/Utils.cpp | 1 - Code/LauncherUnified/Launcher.cpp | 4 +-- .../AWSCognitoUserManagementController.cpp | 2 +- .../Source/PostProcessing/BloomBlurPass.cpp | 2 -- .../RHI/Code/Include/Atom/RHI.Reflect/Bits.h | 26 ++----------------- .../Code/Include/Atom/RHI/IndexBufferView.h | 4 +-- .../Include/Atom/RHI/IndirectBufferView.h | 4 +-- .../Code/Include/Atom/RHI/StreamBufferView.h | 4 +-- .../RHI/Code/Source/RHI/DrawPacketBuilder.cpp | 2 +- .../Code/Source/RHI/PipelineStateCache.cpp | 2 +- .../Code/Source/RHI/AsyncUploadQueue.cpp | 10 +------ .../Code/Source/RHI/BufferPoolResolver.cpp | 1 - .../Code/Source/RHI/CommandListAllocator.cpp | 2 +- .../Vulkan/Code/Source/RHI/CommandQueue.cpp | 2 +- .../RHI/Vulkan/Code/Source/RHI/Device.cpp | 1 - .../Code/Source/RHI/NullDescriptorManager.cpp | 1 - .../Code/Source/RHI/StreamingImagePool.cpp | 1 - .../Source/Animation/UiAnimationSystem.cpp | 1 - 31 files changed, 28 insertions(+), 82 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp index 5114ea19ec..17da3fd1e9 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp @@ -1294,7 +1294,7 @@ namespace AZ void Visit(AZStd::string_view path, AZStd::string_view, AZ::SettingsRegistryInterface::Type, AZStd::string_view value) override { // Remove last path segment and check if the key corresponds to the Modules array - AZStd::optional moduleIndex = AZ::StringFunc::TokenizeLast(path, "/"); + AZ::StringFunc::TokenizeLast(path, "/"); if (path.ends_with("/Modules")) { // Remove the "Modules" path segment to be at the GemName key diff --git a/Code/Framework/AzCore/AzCore/Component/EntitySerializer.cpp b/Code/Framework/AzCore/AzCore/Component/EntitySerializer.cpp index 16452be76d..df6aacd50b 100644 --- a/Code/Framework/AzCore/AzCore/Component/EntitySerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Component/EntitySerializer.cpp @@ -89,12 +89,9 @@ namespace AZ result.Combine(componentLoadResult); } - { - JSR::ResultCode runtimeActiveLoadResult = - ContinueLoadingFromJsonObjectField(&entityInstance->m_isRuntimeActiveByDefault, - azrtti_typeidm_isRuntimeActiveByDefault)>(), - inputValue, "IsRuntimeActive", context); - } + ContinueLoadingFromJsonObjectField(&entityInstance->m_isRuntimeActiveByDefault, + azrtti_typeidm_isRuntimeActiveByDefault)>(), + inputValue, "IsRuntimeActive", context); return context.Report( result, diff --git a/Code/Framework/AzCore/AzCore/Component/EntityUtils.cpp b/Code/Framework/AzCore/AzCore/Component/EntityUtils.cpp index 8241400aac..fcc8cd6424 100644 --- a/Code/Framework/AzCore/AzCore/Component/EntityUtils.cpp +++ b/Code/Framework/AzCore/AzCore/Component/EntityUtils.cpp @@ -165,7 +165,7 @@ namespace AZ AZStd::fixed_vector knownBaseClasses = { typeToExamine }; // avoid allocating heap here if possible. 64 types are 64*sizeof(Uuid) which is only 1k. bool foundBaseClass = false; - auto enumerateBaseVisitor = [&foundBaseClass, &baseClassVisitor, &knownBaseClasses](const AZ::SerializeContext::ClassData* classData, const TypeId& examineTypeId) + auto enumerateBaseVisitor = [&baseClassVisitor, &knownBaseClasses](const AZ::SerializeContext::ClassData* classData, const TypeId& examineTypeId) { if (!classData) { diff --git a/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl b/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl index 9eb65dec76..bae79a6fe7 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl @@ -1320,7 +1320,7 @@ namespace AZ (void)classElement; void* reserveElement{}; using DummyArray = bool[]; - DummyArray{ true, (ReserveElementTuple(tupleRef, classElement, reserveElement))... }; + [[maybe_unused]] DummyArray dummy = { true, (ReserveElementTuple(tupleRef, classElement, reserveElement))... }; return reserveElement; } diff --git a/Code/Framework/AzCore/AzCore/Serialization/DataPatch.cpp b/Code/Framework/AzCore/AzCore/Serialization/DataPatch.cpp index edc0e8398b..01a98667fa 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/DataPatch.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/DataPatch.cpp @@ -135,7 +135,6 @@ namespace AZ AZStd::list m_dynamicClassElements; ///< Storage for class elements that represent dynamic serializable fields. }; - static bool ConvertLegacyBoolToEnum(AZ::SerializeContext& context, AZStd::any& patchAny, const DataNode& sourceNode); static void ReportDataPatchMismatch(SerializeContext* context, const SerializeContext::ClassElement* classElement, const TypeId& patchDataTypeId); //========================================================================= diff --git a/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl b/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl index 391133dd9f..70972bb846 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl @@ -483,9 +483,9 @@ namespace AZ } private: static void ObjectStreamWriter(SerializeContext::EnumerateInstanceCallContext& callContext, const void* variantPtr, - const SerializeContext::ClassData& variantClassData, const SerializeContext::ClassElement* variantClassElement) + [[maybe_unused]] const SerializeContext::ClassData& variantClassData, const SerializeContext::ClassElement* variantClassElement) { - auto alternativeVisitor = [&callContext, &variantClassData, variantClassElement](auto&& elementAlt) + auto alternativeVisitor = [&callContext, variantClassElement](auto&& elementAlt) { using AltType = AZStd::remove_cvref_t; const SerializeContext& context = *callContext.m_context; diff --git a/Code/Framework/AzFramework/AzFramework/FileTag/FileTag.cpp b/Code/Framework/AzFramework/AzFramework/FileTag/FileTag.cpp index 87866581d3..c402e6c5bc 100644 --- a/Code/Framework/AzFramework/AzFramework/FileTag/FileTag.cpp +++ b/Code/Framework/AzFramework/AzFramework/FileTag/FileTag.cpp @@ -366,7 +366,7 @@ namespace AzFramework AZStd::set tags; AZStd::string resolvedFilePath = ResolveFilePath(filePath); - auto found = AZStd::find_if(m_fileTagsMap.begin(), m_fileTagsMap.end(), [filePath, resolvedFilePath, this](auto& entry) -> bool + auto found = AZStd::find_if(m_fileTagsMap.begin(), m_fileTagsMap.end(), [filePath, resolvedFilePath](auto& entry) -> bool { return resolvedFilePath == ResolveFilePath(entry.first); }); diff --git a/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityBoundsUnionSystem.cpp b/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityBoundsUnionSystem.cpp index bfa9dfcf9e..f1be8c506d 100644 --- a/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityBoundsUnionSystem.cpp +++ b/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityBoundsUnionSystem.cpp @@ -54,9 +54,6 @@ namespace AzFramework if (auto instance_it = m_entityVisibilityBoundsUnionInstanceMapping.find(entity); instance_it == m_entityVisibilityBoundsUnionInstanceMapping.end()) { - AZ::TransformInterface* transformInterface = entity->GetTransform(); - const AZ::Vector3 entityPosition = transformInterface->GetWorldTranslation(); - EntityVisibilityBoundsUnionInstance instance; instance.m_localEntityBoundsUnion = CalculateEntityLocalBoundsUnion(entity); instance.m_visibilityEntry.m_typeFlags = VisibilityEntry::TYPE_Entity; diff --git a/Code/Framework/AzFramework/Platform/Linux/AzFramework/Process/ProcessWatcher_Linux.cpp b/Code/Framework/AzFramework/Platform/Linux/AzFramework/Process/ProcessWatcher_Linux.cpp index 8deed820d3..eb60b8e6ae 100644 --- a/Code/Framework/AzFramework/Platform/Linux/AzFramework/Process/ProcessWatcher_Linux.cpp +++ b/Code/Framework/AzFramework/Platform/Linux/AzFramework/Process/ProcessWatcher_Linux.cpp @@ -202,8 +202,6 @@ namespace AzFramework bool ProcessLauncher::LaunchProcess(const ProcessLaunchInfo& processLaunchInfo, ProcessData& processData) { - bool result = false; - // note that the convention here is that it uses windows-shell style escaping of combined args with spaces in it // (so surrounding with quotes like param="hello world") // this is so that the callers (which could be numerous) do not have to worry about this and sprinkle ifdefs diff --git a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpListenThread.cpp b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpListenThread.cpp index 758cff3337..9a3c038a73 100644 --- a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpListenThread.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpListenThread.cpp @@ -64,7 +64,7 @@ namespace AzNetworking { --m_listenPortCount; - auto visitor = [this, &tcpNetworkInterface](ListenPort& listenPort) + auto visitor = [&tcpNetworkInterface](ListenPort& listenPort) { if (listenPort.m_tcpNetworkInterface == &tcpNetworkInterface) { @@ -120,7 +120,7 @@ namespace AzNetworking auto readCallback = [this, newConnection, connectionLength](SocketFd socketFd) { - auto visitor = [this, newConnection, connectionLength, socketFd](ListenPort& listenPort) + auto visitor = [this, newConnection, socketFd](ListenPort& listenPort) { if (listenPort.m_listenSocket.GetSocketFd() == socketFd) { @@ -132,7 +132,7 @@ namespace AzNetworking auto writeCallback = [](SocketFd) {}; m_tcpSocketManager.ProcessEvents(updateRateMs, readCallback, writeCallback); - auto cleanupUnused = [this](AZ::ThreadSafeDeque::DequeType& deque) + auto cleanupUnused = [](AZ::ThreadSafeDeque::DequeType& deque) { AZStd::remove_if(deque.begin(), deque.end(), [](ListenPort& listenPort) { return listenPort.m_tcpNetworkInterface == nullptr; }); }; diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/DtlsSocket.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/DtlsSocket.cpp index 1944995bac..ee784b6ffb 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/DtlsSocket.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/DtlsSocket.cpp @@ -86,7 +86,7 @@ namespace AzNetworking #if AZ_TRAIT_USE_OPENSSL uint8_t encrpytedSendBuffer[MaxUdpTransmissionUnit]; // Write out the packet we were requested to send - const int32_t sentBytesRaw = SSL_write(dtlsEndpoint.m_sslSocket, data, size); + SSL_write(dtlsEndpoint.m_sslSocket, data, size); const int32_t sentBytesEnc = BIO_read(dtlsEndpoint.m_writeBio, encrpytedSendBuffer, sizeof(encrpytedSendBuffer)); // Track encryption metrics diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpSocket.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpSocket.cpp index 997fc323a9..44f6562c84 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpSocket.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpSocket.cpp @@ -160,7 +160,6 @@ namespace AzNetworking const AZ::TimeMs jitterMs = aznumeric_cast(m_random.GetRandom()) % (connectionQuality.m_varianceMs > AZ::TimeMs{ 0 } ? connectionQuality.m_varianceMs : AZ::TimeMs{ 1 }); - const AZ::TimeMs currTimeMs = AZ::GetElapsedTimeMs(); const AZ::TimeMs deferTimeMs = (connectionQuality.m_latencyMs) + jitterMs; DeferredData deferred = DeferredData(address, data, size, encrypt, dtlsEndpoint); diff --git a/Code/Framework/AzNetworking/AzNetworking/Utilities/Endian.h b/Code/Framework/AzNetworking/AzNetworking/Utilities/Endian.h index 08ca785f72..67165c380d 100644 --- a/Code/Framework/AzNetworking/AzNetworking/Utilities/Endian.h +++ b/Code/Framework/AzNetworking/AzNetworking/Utilities/Endian.h @@ -14,14 +14,14 @@ #include #if AZ_TRAIT_NEEDS_HTONLL -static const uint64_t htonll(uint64_t value) +const uint64_t htonll(uint64_t value) { const uint32_t hiValue = htonl(static_cast(value >> 32)); const uint32_t loValue = htonl(static_cast(value & 0x00000000FFFFFFFF)); return static_cast(hiValue) << 32 | static_cast(loValue); } -static const uint64_t ntohll(uint64_t value) +const uint64_t ntohll(uint64_t value) { return htonll(value); } diff --git a/Code/Framework/AzTest/AzTest/Utils.cpp b/Code/Framework/AzTest/AzTest/Utils.cpp index 0fe701ca5a..e8885e6996 100644 --- a/Code/Framework/AzTest/AzTest/Utils.cpp +++ b/Code/Framework/AzTest/AzTest/Utils.cpp @@ -121,7 +121,6 @@ namespace AZ char** SplitCommandLine(int& size, char* const cmdLine) { std::vector tokens; - char* next_token = nullptr; char* tok = azstrtok(cmdLine, 0, " ", &next_token); while (tok != NULL) { diff --git a/Code/LauncherUnified/Launcher.cpp b/Code/LauncherUnified/Launcher.cpp index 30db54dab2..07da69cbe9 100644 --- a/Code/LauncherUnified/Launcher.cpp +++ b/Code/LauncherUnified/Launcher.cpp @@ -451,8 +451,6 @@ namespace O3DELauncher // The command line overrides are stored in the following fixed strings // until the ComponentApplication constructor can parse the command line parameters FixedValueString projectNameOptionOverride; - FixedValueString projectPathOptionOverride; - FixedValueString enginePathOptionOverride; // Insert the project_name option to the front const AZStd::string_view launcherProjectName = GetProjectName(); @@ -467,6 +465,8 @@ namespace O3DELauncher // Non-host platforms cannot use the project path that is #defined within the launcher. // In this case the the result of AZ::Utils::GetDefaultAppRoot is used instead #if !AZ_TRAIT_OS_IS_HOST_OS_PLATFORM + FixedValueString projectPathOptionOverride; + FixedValueString enginePathOptionOverride; AZStd::string_view projectPath; // Make sure the defaultAppRootPath variable is in scope long enough until the projectPath string_view is used below AZStd::optional defaultAppRootPath = AZ::Utils::GetDefaultAppRootPath(); diff --git a/Gems/AWSClientAuth/Code/Source/UserManagement/AWSCognitoUserManagementController.cpp b/Gems/AWSClientAuth/Code/Source/UserManagement/AWSCognitoUserManagementController.cpp index 19827f7013..42ee0065ad 100644 --- a/Gems/AWSClientAuth/Code/Source/UserManagement/AWSCognitoUserManagementController.cpp +++ b/Gems/AWSClientAuth/Code/Source/UserManagement/AWSCognitoUserManagementController.cpp @@ -229,7 +229,7 @@ namespace AWSClientAuth AZ::JobContext* jobContext = nullptr; AWSCore::AWSCoreRequestBus::BroadcastResult(jobContext, &AWSCore::AWSCoreRequests::GetDefaultJobContext); - AZ::Job* enableMFAJob = AZ::CreateJobFunction([this, cognitoIdentityProviderClient, accessToken]() + AZ::Job* enableMFAJob = AZ::CreateJobFunction([cognitoIdentityProviderClient, accessToken]() { Aws::CognitoIdentityProvider::Model::SetUserMFAPreferenceRequest confirmForgotPasswordRequest; Aws::CognitoIdentityProvider::Model::SMSMfaSettingsType settings; diff --git a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomBlurPass.cpp b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomBlurPass.cpp index 3fcff54eaa..b91990f6c9 100644 --- a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomBlurPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomBlurPass.cpp @@ -271,8 +271,6 @@ namespace AZ void BloomBlurPass::BuildKernelData() { - RHI::Size sourceImageSize; - m_weightData.clear(); m_offsetData.clear(); m_kernelRadiusData.clear(); diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/Bits.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/Bits.h index 6659383c2f..973076fe71 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/Bits.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/Bits.h @@ -280,27 +280,5 @@ namespace AZ } } - -// Emits an error when padding is introduced into a struct. -#if defined (AZ_COMPILER_MSVC) - -#define AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN \ - __pragma(warning(push)) \ - __pragma(warning(error : 4820)) - -#define AZ_ASSERT_NO_ALIGNMENT_PADDING_END \ - __pragma(warning(pop)) - -#elif defined (AZ_COMPILER_CLANG) || defined (AZ_COMPILER_GCC) - -#define AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic error \"-Wpadded\"") - -#define AZ_ASSERT_NO_ALIGNMENT_PADDING_END \ - _Pragma("GCC diagnostic pop") - -#else -#define AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN -#define AZ_ASSERT_NO_ALIGNMENT_PADDING_END -#endif +#define AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN AZ_PUSH_DISABLE_WARNING(4820, "-Wpadded") +#define AZ_ASSERT_NO_ALIGNMENT_PADDING_END AZ_POP_DISABLE_WARNING diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/IndexBufferView.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/IndexBufferView.h index 7219709109..d512b1a12d 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/IndexBufferView.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/IndexBufferView.h @@ -26,7 +26,7 @@ namespace AZ AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN - class IndexBufferView + class alignas(8) IndexBufferView { public: IndexBufferView() = default; @@ -58,8 +58,6 @@ namespace AZ uint32_t m_byteOffset = 0; uint32_t m_byteCount = 0; IndexFormat m_format = IndexFormat::Uint32; - // Padding the size so it's 8 bytes aligned - uint32_t m_pad = 0; }; AZ_ASSERT_NO_ALIGNMENT_PADDING_END diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/IndirectBufferView.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/IndirectBufferView.h index 7014fd030c..5622b66adf 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/IndirectBufferView.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/IndirectBufferView.h @@ -21,7 +21,7 @@ namespace AZ //! Provides a view into a buffer, to be used as an indirect buffer. The content of the view is a contiguous //! list of commands sequences. It is provided to the RHI back-end at draw time. - class IndirectBufferView + class alignas(8) IndirectBufferView { public: IndirectBufferView() = default; @@ -59,8 +59,6 @@ namespace AZ uint32_t m_byteOffset = 0; uint32_t m_byteCount = 0; uint32_t m_byteStride = 0; - // Padding the size so it's 8 bytes aligned - uint32_t m_pad = 0; }; AZ_ASSERT_NO_ALIGNMENT_PADDING_END diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/StreamBufferView.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/StreamBufferView.h index 9c9a16e8df..068c44db73 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/StreamBufferView.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/StreamBufferView.h @@ -31,7 +31,7 @@ namespace AZ * or interleaved in a single StreamBufferView (one view having multiple StreamChannelDescriptors). * - The view will correspond to a single StreamBufferDescriptor. */ - class StreamBufferView + class alignas(8) StreamBufferView { public: StreamBufferView() = default; @@ -64,8 +64,6 @@ namespace AZ uint32_t m_byteOffset = 0; uint32_t m_byteCount = 0; uint32_t m_byteStride = 0; - // Padding the size so it's 8 bytes aligned - uint32_t m_pad = 0; }; AZ_ASSERT_NO_ALIGNMENT_PADDING_END diff --git a/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp b/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp index 7bfaed0a31..ebda9732df 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp @@ -119,7 +119,7 @@ namespace AZ LinearAllocator linearAllocator; linearAllocator.Init(linearAllocatorDesc); - const VirtualAddress drawPacketOffset = linearAllocator.Allocate( + [[maybe_unused]] const VirtualAddress drawPacketOffset = linearAllocator.Allocate( sizeof(DrawPacket), AZStd::alignment_of::value); diff --git a/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp b/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp index 69eee86108..7f026453d7 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp @@ -177,7 +177,7 @@ namespace AZ */ AZStd::vector threadLibraries; - m_threadLibrarySet.ForEach([this, handle, &threadLibraries](const ThreadLibrarySet& threadLibrarySet) + m_threadLibrarySet.ForEach([handle, &threadLibraries](const ThreadLibrarySet& threadLibrarySet) { const ThreadLibraryEntry& threadLibraryEntry = threadLibrarySet[handle.GetIndex()]; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/AsyncUploadQueue.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/AsyncUploadQueue.cpp index 8f44abccef..529e0bc10e 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/AsyncUploadQueue.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/AsyncUploadQueue.cpp @@ -63,7 +63,6 @@ namespace AZ const uint8_t* sourceData = reinterpret_cast(request.m_sourceData); const size_t byteCount = request.m_byteCount; - const size_t byteOffset = request.m_byteOffset; auto* buffer = static_cast(request.m_buffer); RHI::BufferPool* bufferPool = static_cast(buffer->GetPool()); @@ -189,8 +188,6 @@ namespace AZ // Set pipeline barriers before copy. EmmitPrologueMemoryBarrier(request, residentMip); - const uint16_t arraySize = image->GetDescriptor().m_arraySize; - const uint16_t imageMipLevels = image->GetDescriptor().m_mipLevels; const static uint32_t bufferOffsetAlign = 4; // refer VkBufferImageCopy in the spec. // Variables for split subresource slice. @@ -213,11 +210,7 @@ namespace AZ // ImageHeight must be bigger than or equal to the Image's row count. Images with a RowCount that is less than the ImageHeight indicates a block compression. // Images with a RowCount which is higher than the ImageHeight indicates a planar image, which is not supported for streaming images. - if (subresourceLayout.m_size.m_height < subresourceLayout.m_rowCount) - { - AZ_Error("StreamingImage", false, "AsyncUploadQueue::QueueUpload expects ImageHeight '%d' to be bigger than or equal to the image's RowCount '%d'.", subresourceLayout.m_size.m_height, subresourceLayout.m_rowCount); - RHI::AsyncWorkHandle::Null; - } + AZ_Error("StreamingImage", subresourceLayout.m_size.m_height < subresourceLayout.m_rowCount, "AsyncUploadQueue::QueueUpload expects ImageHeight '%d' to be bigger than or equal to the image's RowCount '%d'.", subresourceLayout.m_size.m_height, subresourceLayout.m_rowCount); // The final staging size for each CopyTextureRegion command uint32_t stagingSize = stagingSlicePitch; @@ -596,7 +589,6 @@ namespace AZ uint32_t residentMip) { const auto& image = static_cast(*request.m_image); - const RHI::ImageBindFlags bindFlags = image.GetDescriptor().m_bindFlags; const VkImageLayout layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; const uint32_t beforeMip = residentMip; const uint32_t afterMip = beforeMip - static_cast(request.m_mipSlices.size()); diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/BufferPoolResolver.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/BufferPoolResolver.cpp index ba67f11c32..a94e610b49 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/BufferPoolResolver.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/BufferPoolResolver.cpp @@ -94,7 +94,6 @@ namespace AZ void BufferPoolResolver::Resolve(CommandList& commandList) { auto& device = static_cast(commandList.GetDevice()); - VkBufferCopy bufCopy{}; for (const BufferUploadPacket& packet : m_uploadPackets) { Buffer* stagingBuffer = packet.m_stagingBuffer.get(); diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandListAllocator.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandListAllocator.cpp index 09179c7110..bac7a69c9a 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandListAllocator.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandListAllocator.cpp @@ -100,7 +100,7 @@ namespace AZ commandPoolAllocatorDescriptor.m_collectLatency = descriptor.m_frameCountMax; commadPoolAllocator.Init(commandPoolAllocatorDescriptor); - m_commandListSubAllocators[queueFamilyIndex].SetInitFunction([this, &commadPoolAllocator] + m_commandListSubAllocators[queueFamilyIndex].SetInitFunction([&commadPoolAllocator] (Internal::CommandListSubAllocator& subAllocator) { subAllocator.Init(commadPoolAllocator); diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandQueue.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandQueue.cpp index 6929b63ac4..fdb583d10f 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandQueue.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandQueue.cpp @@ -109,7 +109,7 @@ namespace AZ { // The queue doesn't have an explicit way to signal a fence, so // we submit an empty work batch with only a fence to signal. - QueueCommand([this, &fence](void* queue) + QueueCommand([&fence](void* queue) { Queue* vulkanQueue = static_cast(queue); vulkanQueue->SubmitCommandBuffers( diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Device.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Device.cpp index 15a532f832..4f800f114b 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Device.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Device.cpp @@ -190,7 +190,6 @@ namespace AZ if (majorVersion >= 1 && minorVersion >= 2) { vulkan12Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; - VkPhysicalDeviceVulkan12Features physicalDeviceVulkan12Features = physicalDevice.GetPhysicalDeviceVulkan12Features(); vulkan12Features.drawIndirectCount = physicalDevice.GetPhysicalDeviceVulkan12Features().drawIndirectCount; vulkan12Features.shaderFloat16 = physicalDevice.GetPhysicalDeviceVulkan12Features().shaderFloat16; vulkan12Features.shaderInt8 = physicalDevice.GetPhysicalDeviceVulkan12Features().shaderInt8; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/NullDescriptorManager.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/NullDescriptorManager.cpp index 316144f323..6d16cdc284 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/NullDescriptorManager.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/NullDescriptorManager.cpp @@ -73,7 +73,6 @@ namespace AZ Device& device = static_cast(GetDevice()); const uint32_t imageDimension = 8; - const uint32_t pixelSize = 4; // fill out the different options for the types of image null descriptors m_imageNullDescriptor.m_images.resize(static_cast(ImageTypes::Count)); diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/StreamingImagePool.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/StreamingImagePool.cpp index 586470da0a..d00e597ae6 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/StreamingImagePool.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/StreamingImagePool.cpp @@ -153,7 +153,6 @@ namespace AZ } const VkMemoryRequirements memoryRequirements = GetMemoryRequirements(image.GetDescriptor(), targetMipLevel); - const uint16_t residentMipLevelBefore = static_cast(image.GetResidentMipLevel()); RHI::HeapMemoryUsage& memoryUsage = m_memoryUsage.GetHeapMemoryUsage(RHI::HeapMemoryLevel::Device); const size_t imageSizeBefore = image.GetResidentSizeInBytes(); diff --git a/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp b/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp index 35fde93e83..c2a2e16db7 100644 --- a/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp +++ b/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp @@ -106,7 +106,6 @@ void UiAnimationSystem::DoNodeStaticInitialisation() bool UiAnimationSystem::Load(const char* pszFile, const char* pszMission) { INDENT_LOG_DURING_SCOPE (true, "UI Animation system is loading the file '%s' (mission='%s')", pszFile, pszMission); - LOADING_TIME_PROFILE_SECTION(GetISystem()); XmlNodeRef rootNode = m_pSystem->LoadXmlFromFile(pszFile); if (!rootNode)