some unused fixes

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-19 18:26:43 -07:00
parent 63cd3db956
commit cf6c7c4d8d
31 changed files with 28 additions and 82 deletions
@@ -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<AZStd::string_view> 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
@@ -89,12 +89,9 @@ namespace AZ
result.Combine(componentLoadResult);
}
{
JSR::ResultCode runtimeActiveLoadResult =
ContinueLoadingFromJsonObjectField(&entityInstance->m_isRuntimeActiveByDefault,
azrtti_typeid<decltype(entityInstance->m_isRuntimeActiveByDefault)>(),
inputValue, "IsRuntimeActive", context);
}
ContinueLoadingFromJsonObjectField(&entityInstance->m_isRuntimeActiveByDefault,
azrtti_typeid<decltype(entityInstance->m_isRuntimeActiveByDefault)>(),
inputValue, "IsRuntimeActive", context);
return context.Report(
result,
@@ -165,7 +165,7 @@ namespace AZ
AZStd::fixed_vector<TypeId, 64> 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)
{
@@ -1320,7 +1320,7 @@ namespace AZ
(void)classElement;
void* reserveElement{};
using DummyArray = bool[];
DummyArray{ true, (ReserveElementTuple<Indices>(tupleRef, classElement, reserveElement))... };
[[maybe_unused]] DummyArray dummy = { true, (ReserveElementTuple<Indices>(tupleRef, classElement, reserveElement))... };
return reserveElement;
}
@@ -135,7 +135,6 @@ namespace AZ
AZStd::list<SerializeContext::ClassElement> 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);
//=========================================================================
@@ -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<decltype(elementAlt)>;
const SerializeContext& context = *callContext.m_context;
@@ -366,7 +366,7 @@ namespace AzFramework
AZStd::set<AZStd::string> 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);
});
@@ -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;
@@ -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
@@ -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<ListenPort>::DequeType& deque)
auto cleanupUnused = [](AZ::ThreadSafeDeque<ListenPort>::DequeType& deque)
{
AZStd::remove_if(deque.begin(), deque.end(), [](ListenPort& listenPort) { return listenPort.m_tcpNetworkInterface == nullptr; });
};
@@ -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
@@ -160,7 +160,6 @@ namespace AzNetworking
const AZ::TimeMs jitterMs = aznumeric_cast<AZ::TimeMs>(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);
@@ -14,14 +14,14 @@
#include <AzNetworking/Utilities/Endian_Platform.h>
#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<uint32_t>(value >> 32));
const uint32_t loValue = htonl(static_cast<uint32_t>(value & 0x00000000FFFFFFFF));
return static_cast<uint64_t>(hiValue) << 32 | static_cast<uint64_t>(loValue);
}
static const uint64_t ntohll(uint64_t value)
const uint64_t ntohll(uint64_t value)
{
return htonll(value);
}
-1
View File
@@ -121,7 +121,6 @@ namespace AZ
char** SplitCommandLine(int& size, char* const cmdLine)
{
std::vector<char*> tokens;
char* next_token = nullptr;
char* tok = azstrtok(cmdLine, 0, " ", &next_token);
while (tok != NULL)
{
+2 -2
View File
@@ -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<AZ::IO::FixedMaxPathString> defaultAppRootPath = AZ::Utils::GetDefaultAppRootPath();
@@ -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;
@@ -271,8 +271,6 @@ namespace AZ
void BloomBlurPass::BuildKernelData()
{
RHI::Size sourceImageSize;
m_weightData.clear();
m_offsetData.clear();
m_kernelRadiusData.clear();
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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<DrawPacket>::value);
@@ -177,7 +177,7 @@ namespace AZ
*/
AZStd::vector<const PipelineLibrary*> threadLibraries;
m_threadLibrarySet.ForEach([this, handle, &threadLibraries](const ThreadLibrarySet& threadLibrarySet)
m_threadLibrarySet.ForEach([handle, &threadLibraries](const ThreadLibrarySet& threadLibrarySet)
{
const ThreadLibraryEntry& threadLibraryEntry = threadLibrarySet[handle.GetIndex()];
@@ -63,7 +63,6 @@ namespace AZ
const uint8_t* sourceData = reinterpret_cast<const uint8_t*>(request.m_sourceData);
const size_t byteCount = request.m_byteCount;
const size_t byteOffset = request.m_byteOffset;
auto* buffer = static_cast<Buffer*>(request.m_buffer);
RHI::BufferPool* bufferPool = static_cast<RHI::BufferPool*>(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<const Image&>(*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<uint32_t>(request.m_mipSlices.size());
@@ -94,7 +94,6 @@ namespace AZ
void BufferPoolResolver::Resolve(CommandList& commandList)
{
auto& device = static_cast<Device&>(commandList.GetDevice());
VkBufferCopy bufCopy{};
for (const BufferUploadPacket& packet : m_uploadPackets)
{
Buffer* stagingBuffer = packet.m_stagingBuffer.get();
@@ -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);
@@ -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*>(queue);
vulkanQueue->SubmitCommandBuffers(
@@ -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;
@@ -73,7 +73,6 @@ namespace AZ
Device& device = static_cast<Device&>(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<uint32_t>(ImageTypes::Count));
@@ -153,7 +153,6 @@ namespace AZ
}
const VkMemoryRequirements memoryRequirements = GetMemoryRequirements(image.GetDescriptor(), targetMipLevel);
const uint16_t residentMipLevelBefore = static_cast<uint16_t>(image.GetResidentMipLevel());
RHI::HeapMemoryUsage& memoryUsage = m_memoryUsage.GetHeapMemoryUsage(RHI::HeapMemoryLevel::Device);
const size_t imageSizeBefore = image.GetResidentSizeInBytes();
@@ -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)