diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/PolygonLightFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/PolygonLightFeatureProcessor.cpp index b1456f82fe..089adf4621 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/PolygonLightFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/PolygonLightFeatureProcessor.cpp @@ -145,7 +145,7 @@ namespace AZ::Render // individual point as its own element instead of each array being its own element. Since all // the arrays are stored in a contiguous vector, we can treat it as one giant array. const LightPosition* firstPosition = m_polygonLightData.GetDataVector<1>().at(0).data(); - m_lightPolygonPointBufferHandler.UpdateBuffer(firstPosition, m_polygonLightData.GetDataCount() * MaxPolygonPoints); + m_lightPolygonPointBufferHandler.UpdateBuffer(firstPosition, static_cast(m_polygonLightData.GetDataCount() * MaxPolygonPoints)); } m_deviceBufferNeedsUpdate = false; } diff --git a/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp index 96041dc89d..4b1a6ec7f6 100644 --- a/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp @@ -65,7 +65,7 @@ namespace AZ AZ::JobCompletion jobCompletion; const int numThreads = 8; - const int numPixelsPerThread = buffer->size() / numChannels / numThreads; + const int numPixelsPerThread = static_cast(buffer->size() / numChannels / numThreads); for (int i = 0; i < numThreads; ++i) { int startPixel = i * numPixelsPerThread; diff --git a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp index 71f17b3361..0f8a30d8aa 100644 --- a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp @@ -162,7 +162,7 @@ namespace AZ m_rootConstantData.SetConstant(colorOffsetIndex, m_morphInstanceMetaData.m_accumulatedColorDeltaOffsetInBytes / 4); } - m_dispatchItem.m_rootConstantSize = m_rootConstantData.GetConstantData().size(); + m_dispatchItem.m_rootConstantSize = static_cast(m_rootConstantData.GetConstantData().size()); m_dispatchItem.m_rootConstants = m_rootConstantData.GetConstantData().data(); } diff --git a/Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.cpp index 03ee176fd0..5a25951163 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.cpp @@ -497,7 +497,7 @@ namespace AZ::Render const ShadowmapAtlas& atlas = m_projectedShadowmapsPasses.front()->GetShadowmapAtlas(); const Data::Instance indexTableBuffer = atlas.CreateShadowmapIndexTableBuffer(indexTableBufferName); - m_filterParamBufferHandler.UpdateBuffer(m_shadowData.GetRawData(), m_shadowData.GetSize()); + m_filterParamBufferHandler.UpdateBuffer(m_shadowData.GetRawData(), static_cast(m_shadowData.GetSize())); // Set index table buffer and ESM parameter buffer to ESM pass. for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) @@ -564,7 +564,7 @@ namespace AZ::Render if (m_deviceBufferNeedsUpdate) { - m_shadowBufferHandler.UpdateBuffer(m_shadowData.GetRawData(), m_shadowData.GetSize()); + m_shadowBufferHandler.UpdateBuffer(m_shadowData.GetRawData(), static_cast(m_shadowData.GetSize())); m_deviceBufferNeedsUpdate = false; } } diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp index 155b751272..f0b1658885 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp @@ -446,7 +446,7 @@ namespace AZ // Positions start at the beginning of the allocation instanceMetaData.m_accumulatedPositionDeltaOffsetInBytes = allocation->GetVirtualAddress().m_ptr; - uint32_t deltaStreamSizeInBytes = vertexCount * MorphTargetConstants::s_unpackedMorphTargetDeltaSizeInBytes; + uint32_t deltaStreamSizeInBytes = static_cast(vertexCount * MorphTargetConstants::s_unpackedMorphTargetDeltaSizeInBytes); // Followed by normals, tangents, and bitangents instanceMetaData.m_accumulatedNormalDeltaOffsetInBytes = instanceMetaData.m_accumulatedPositionDeltaOffsetInBytes + deltaStreamSizeInBytes; diff --git a/Gems/Atom/Feature/Common/Code/Tests/SparseVectorTests.cpp b/Gems/Atom/Feature/Common/Code/Tests/SparseVectorTests.cpp index 0a31fe4c9e..e3f3ea906b 100644 --- a/Gems/Atom/Feature/Common/Code/Tests/SparseVectorTests.cpp +++ b/Gems/Atom/Feature/Common/Code/Tests/SparseVectorTests.cpp @@ -81,7 +81,7 @@ namespace UnitTest EXPECT_EQ(data.c, TestData::DefaultValueC); // Assign new unique values - data.a = TestData::DefaultValueA * i; + data.a = TestData::DefaultValueA * static_cast(i); data.b = TestData::DefaultValueB * float(i); data.c = i % 2 == 0; } @@ -190,12 +190,12 @@ namespace UnitTest EXPECT_EQ(data.b, TestData::DefaultValueB); EXPECT_EQ(data.c, TestData::DefaultValueC); - data.a = TestData::DefaultValueA * i; + data.a = TestData::DefaultValueA * static_cast(i); data.b = TestData::DefaultValueB * float(i); data.c = i % 2 == 0; // Assign some values to the uninitialized primitive types - container.GetElement<1>(indices[i]) = i * 10; + container.GetElement<1>(indices[i]) = static_cast(i * 10); container.GetElement<2>(indices[i]) = i * 20.0f; } @@ -254,7 +254,7 @@ namespace UnitTest { indices[i] = container.Reserve(); - container.GetElement<1>(i) = i * 10; + container.GetElement<1>(i) = static_cast(i * 10); container.GetElement<2>(i) = i * 20.0f; } diff --git a/Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupData.cpp b/Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupData.cpp index 7461a7c3e8..a9e08249c4 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupData.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupData.cpp @@ -139,7 +139,7 @@ namespace AZ bool isValidAll = true; for (size_t i = 0; i < imageViews.size(); ++i) { - const bool isValid = ValidateImageViewAccess(inputIndex, imageViews[i], i); + const bool isValid = ValidateImageViewAccess(inputIndex, imageViews[i], static_cast(i)); if (isValid) { m_imageViewsUnboundedArray.push_back(imageViews[i]); @@ -185,7 +185,7 @@ namespace AZ bool isValidAll = true; for (size_t i = 0; i < bufferViews.size(); ++i) { - const bool isValid = ValidateBufferViewAccess(inputIndex, bufferViews[i], i); + const bool isValid = ValidateBufferViewAccess(inputIndex, bufferViews[i], static_cast(i)); if (isValid) { m_bufferViewsUnboundedArray.push_back(bufferViews[i]); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp index 7437c3b339..d51fdd3495 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp @@ -356,7 +356,7 @@ namespace AZ if (!bufferViews.empty()) { - group.m_unboundedDescriptorTables[tableIndex] = m_descriptorContext->CreateDescriptorTable(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, bufferViews.size()); + group.m_unboundedDescriptorTables[tableIndex] = m_descriptorContext->CreateDescriptorTable(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, static_cast(bufferViews.size())); AZ_Assert(group.m_unboundedDescriptorTables[tableIndex].IsValid(), "Descriptor context failed to allocate unbounded array descriptor table, most likely out of memory."); ShaderResourceGroupCompiledData& compiledData = group.m_compiledData[group.m_compiledDataIndex]; @@ -415,7 +415,7 @@ namespace AZ if (!imageViews.empty()) { - group.m_unboundedDescriptorTables[tableIndex] = m_descriptorContext->CreateDescriptorTable(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, imageViews.size()); + group.m_unboundedDescriptorTables[tableIndex] = m_descriptorContext->CreateDescriptorTable(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, static_cast(imageViews.size())); AZ_Assert(group.m_unboundedDescriptorTables[tableIndex].IsValid(), "Descriptor context failed to allocate unbounded array descriptor table, most likely out of memory."); ShaderResourceGroupCompiledData& compiledData = group.m_compiledData[group.m_compiledDataIndex]; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingPipelineState.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingPipelineState.cpp index b4c153a38c..33623f93e4 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingPipelineState.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingPipelineState.cpp @@ -163,9 +163,9 @@ namespace AZ createInfo.sType = VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR; createInfo.pNext = nullptr; createInfo.flags = 0; - createInfo.stageCount = stages.size(); + createInfo.stageCount = static_cast(stages.size()); createInfo.pStages = stages.data(); - createInfo.groupCount = groups.size(); + createInfo.groupCount = static_cast(groups.size()); createInfo.pGroups = groups.data(); createInfo.maxPipelineRayRecursionDepth = descriptor->GetConfiguration().m_maxRecursionDepth; createInfo.layout = m_pipelineLayout; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp index aa2ad37647..d61d5340b0 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp @@ -883,7 +883,7 @@ namespace AZ processedMorphTargets = true; } - totalVertexCount += vertexCount; + totalVertexCount += static_cast(vertexCount); productMeshList.emplace_back(productMesh); } } @@ -961,7 +961,7 @@ namespace AZ for (const auto& skinData : sourceMesh.m_skinData) { const size_t numJoints = skinData->GetBoneCount(); - const AZ::u32 controlPointIndex = sourceMeshData->GetControlPointIndex(vertexIndex); + const AZ::u32 controlPointIndex = sourceMeshData->GetControlPointIndex(static_cast(vertexIndex)); const size_t numSkinInfluences = skinData->GetLinkCount(controlPointIndex); size_t numInfluencesExcess = 0; @@ -1196,15 +1196,15 @@ namespace AZ mesh.m_skinWeights.size(), m_numSkinJointInfluencesPerVertex, m_numSkinJointInfluencesPerVertex); const size_t numSkinInfluences = mesh.m_skinWeights.size(); - uint32_t jointIndicesSizeInBytes = numSkinInfluences * sizeof(uint16_t); + uint32_t jointIndicesSizeInBytes = static_cast(numSkinInfluences * sizeof(uint16_t)); meshView.m_skinJointIndicesView = RHI::BufferViewDescriptor::CreateRaw(0, jointIndicesSizeInBytes); - meshView.m_skinWeightsView = RHI::BufferViewDescriptor::CreateTyped(0, numSkinInfluences, SkinWeightFormat); + meshView.m_skinWeightsView = RHI::BufferViewDescriptor::CreateTyped(0, static_cast(numSkinInfluences), SkinWeightFormat); } if (!mesh.m_morphTargetVertexData.empty()) { const size_t numTotalVertices = mesh.m_morphTargetVertexData.size(); - meshView.m_morphTargetVertexDataView = RHI::BufferViewDescriptor::CreateStructured(0, numTotalVertices, sizeof(PackedCompressedMorphTargetDelta)); + meshView.m_morphTargetVertexDataView = RHI::BufferViewDescriptor::CreateStructured(0, static_cast(numTotalVertices), sizeof(PackedCompressedMorphTargetDelta)); } if (!mesh.m_clothData.empty()) @@ -1359,8 +1359,8 @@ namespace AZ const size_t numPrevSkinInfluences = lodBufferInfo.m_skinInfluencesCount; const size_t numNewSkinInfluences = mesh.m_skinWeights.size(); - meshView.m_skinJointIndicesView = RHI::BufferViewDescriptor::CreateRaw(/*byteOffset=*/numPrevSkinInfluences * sizeof(uint16_t), numNewSkinInfluences * sizeof(uint16_t)); - meshView.m_skinWeightsView = RHI::BufferViewDescriptor::CreateTyped(/*elementOffset=*/numPrevSkinInfluences, numNewSkinInfluences, SkinWeightFormat); + meshView.m_skinJointIndicesView = RHI::BufferViewDescriptor::CreateRaw(/*byteOffset=*/ static_cast(numPrevSkinInfluences * sizeof(uint16_t)), static_cast(numNewSkinInfluences * sizeof(uint16_t))); + meshView.m_skinWeightsView = RHI::BufferViewDescriptor::CreateTyped(/*elementOffset=*/ static_cast(numPrevSkinInfluences), static_cast(numNewSkinInfluences), SkinWeightFormat); lodBufferInfo.m_skinInfluencesCount += numNewSkinInfluences; } @@ -1370,7 +1370,7 @@ namespace AZ const size_t numPrevVertexDeltas = lodBufferInfo.m_morphTargetVertexDeltaCount; const size_t numNewVertexDeltas = mesh.m_morphTargetVertexData.size(); - meshView.m_morphTargetVertexDataView = RHI::BufferViewDescriptor::CreateStructured(/*elementOffset=*/numPrevVertexDeltas, numNewVertexDeltas, sizeof(PackedCompressedMorphTargetDelta)); + meshView.m_morphTargetVertexDataView = RHI::BufferViewDescriptor::CreateStructured(/*elementOffset=*/ static_cast(numPrevVertexDeltas), static_cast(numNewVertexDeltas), sizeof(PackedCompressedMorphTargetDelta)); lodBufferInfo.m_morphTargetVertexDeltaCount += numNewVertexDeltas; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp index fefe835ee9..0a1fb49ab5 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp @@ -110,8 +110,8 @@ namespace AZ::RPI { AZ::Aabb meshAabb = AZ::Aabb::CreateNull(); - const size_t numVertices = mesh.m_meshData->GetVertexCount(); - for (size_t i = 0; i < numVertices; ++i) + const unsigned int numVertices = static_cast(mesh.m_meshData->GetVertexCount()); + for (unsigned int i = 0; i < numVertices; ++i) { meshAabb.AddPoint(mesh.m_meshData->GetPosition(i)); } @@ -164,7 +164,7 @@ namespace AZ::RPI blendShapeName.c_str(), numVertices, sourceMesh.m_meshData->GetVertexCount()); // The start index is after any previously added deltas - metaData.m_startIndex = aznumeric_caster(packedCompressedMorphTargetVertexData.size()); + metaData.m_startIndex = aznumeric_cast(packedCompressedMorphTargetVertexData.size()); // Multiply normal by inverse transpose to avoid incorrect values produced by non-uniformly scaled transforms. diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp index bc700dd24f..6b16ca6498 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp @@ -780,7 +780,7 @@ namespace AZ pipelineStateList.push_back(); pipelineStateList[size].m_multisampleState = rasterPass->GetMultisampleState(); pipelineStateList[size].m_renderAttachmentConfiguration = rasterPass->GetRenderAttachmentConfiguration(); - rasterPass->SetPipelineStateDataIndex(size); + rasterPass->SetPipelineStateDataIndex(static_cast(size)); } } } diff --git a/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp b/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp index cdf0d0166d..ce774709f3 100644 --- a/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp @@ -1025,23 +1025,23 @@ namespace UnitTest ); { - AZ::Data::Asset indexBuffer = BuildTestBuffer(indicesCount, sizeof(uint32_t)); + AZ::Data::Asset indexBuffer = BuildTestBuffer(static_cast(indicesCount), sizeof(uint32_t)); AZStd::copy(indices, indices + indicesCount, reinterpret_cast(const_cast(indexBuffer->GetBuffer().data()))); lodCreator.SetMeshIndexBuffer({ indexBuffer, - AZ::RHI::BufferViewDescriptor::CreateStructured(0, indicesCount, sizeof(uint32_t)) + AZ::RHI::BufferViewDescriptor::CreateStructured(0, static_cast(indicesCount), sizeof(uint32_t)) }); } { - AZ::Data::Asset positionBuffer = BuildTestBuffer(positionCount / 3, sizeof(float) * 3); + AZ::Data::Asset positionBuffer = BuildTestBuffer(static_cast(positionCount / 3), sizeof(float) * 3); AZStd::copy(positions, positions + positionCount, reinterpret_cast(const_cast(positionBuffer->GetBuffer().data()))); lodCreator.AddMeshStreamBuffer( AZ::RHI::ShaderSemantic(AZ::Name("POSITION")), AZ::Name(), { positionBuffer, - AZ::RHI::BufferViewDescriptor::CreateStructured(0, positionCount / 3, sizeof(float) * 3) + AZ::RHI::BufferViewDescriptor::CreateStructured(0, static_cast(positionCount / 3), sizeof(float) * 3) } ); } diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp index abb0102de6..47f2127405 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp @@ -144,7 +144,7 @@ namespace MaterialEditor if (!windowSettings->m_mainWindowState.empty()) { - QByteArray windowState(windowSettings->m_mainWindowState.data(), windowSettings->m_mainWindowState.size()); + QByteArray windowState(windowSettings->m_mainWindowState.data(), static_cast(windowSettings->m_mainWindowState.size())); m_advancedDockManager->restoreState(windowState); }