diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslCompiler.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslCompiler.cpp index cc42fac422..f5fb73182a 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslCompiler.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslCompiler.cpp @@ -211,11 +211,11 @@ namespace AZ case rapidjson::kNumberType: if (name == "cols") { - inputStructParams.m_variable.m_cols = itr2->value.GetInt(); + inputStructParams.m_variable.m_cols = static_cast(itr2->value.GetInt()); } else if (name == "rows") { - inputStructParams.m_variable.m_rows = itr2->value.GetInt(); + inputStructParams.m_variable.m_rows = static_cast(itr2->value.GetInt()); } else if (name == "semanticIndex") { @@ -304,7 +304,7 @@ namespace AZ case rapidjson::kNumberType: if (name == "cols") { - outputStructParams.m_variable.m_cols = itr2->value.GetInt(); + outputStructParams.m_variable.m_cols = static_cast(itr2->value.GetInt()); } else if (name == "semanticIndex") { diff --git a/Gems/Atom/Feature/Common/Code/Source/AuxGeom/FixedShapeProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/AuxGeom/FixedShapeProcessor.cpp index f2b3a93a53..8a274beb2f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/AuxGeom/FixedShapeProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/AuxGeom/FixedShapeProcessor.cpp @@ -405,15 +405,15 @@ namespace AZ for (uint16_t ring = 0; ring < numRings - 2; ++ring) { - uint16_t firstVertOfThisRing = 1 + ring * numSections; - uint16_t firstVertOfNextRing = 1 + (ring + 1) * numSections; + uint16_t firstVertOfThisRing = static_cast(1 + ring * numSections); + uint16_t firstVertOfNextRing = static_cast(1 + (ring + 1) * numSections); for (uint16_t section = 0; section < numSections; ++section) { uint32_t nextSection = (section + 1) % numSections; // line around ring indices.push_back(firstVertOfThisRing + section); - indices.push_back(firstVertOfThisRing + nextSection); + indices.push_back(static_cast(firstVertOfThisRing + nextSection)); // line around section indices.push_back(firstVertOfThisRing + section); @@ -423,15 +423,15 @@ namespace AZ // build faces for end caps (to connect "inner" vertices with poles) uint16_t firstPoleVert = 0; - uint16_t firstVertOfFirstRing = 1 + (0) * numSections; + uint16_t firstVertOfFirstRing = static_cast(1 + (0) * numSections); for (uint16_t section = 0; section < numSections; ++section) { indices.push_back(firstPoleVert); indices.push_back(firstVertOfFirstRing + section); } - uint16_t lastPoleVert = (numRings - 1) * numSections + 1; - uint16_t firstVertOfLastRing = 1 + (numRings - 2) * numSections; + uint16_t lastPoleVert = static_cast((numRings - 1) * numSections + 1); + uint16_t firstVertOfLastRing = static_cast(1 + (numRings - 2) * numSections); for (uint16_t section = 0; section < numSections; ++section) { indices.push_back(firstVertOfLastRing + section); @@ -457,13 +457,13 @@ namespace AZ for (uint32_t section = 0; section < numSections; ++section) { uint32_t nextSection = (section + 1) % numSections; - indices.push_back((uint16_t)firstVertOfThisRing + nextSection); - indices.push_back((uint16_t)firstVertOfThisRing + section); - indices.push_back((uint16_t)firstVertOfNextRing + nextSection); + indices.push_back(static_cast(firstVertOfThisRing + nextSection)); + indices.push_back(static_cast(firstVertOfThisRing + section)); + indices.push_back(static_cast(firstVertOfNextRing + nextSection)); - indices.push_back((uint16_t)firstVertOfNextRing + section); - indices.push_back((uint16_t)firstVertOfNextRing + nextSection); - indices.push_back((uint16_t)firstVertOfThisRing + section); + indices.push_back(static_cast(firstVertOfNextRing + section)); + indices.push_back(static_cast(firstVertOfNextRing + nextSection)); + indices.push_back(static_cast(firstVertOfThisRing + section)); } } @@ -473,9 +473,9 @@ namespace AZ for (uint32_t section = 0; section < numSections; ++section) { uint32_t nextSection = (section + 1) % numSections; - indices.push_back((uint16_t)firstVertOfFirstRing + section); - indices.push_back((uint16_t)firstVertOfFirstRing + nextSection); - indices.push_back((uint16_t)firstPoleVert); + indices.push_back(static_cast(firstVertOfFirstRing + section)); + indices.push_back(static_cast(firstVertOfFirstRing + nextSection)); + indices.push_back(static_cast(firstPoleVert)); } uint32_t lastPoleVert = (numRings - 1) * numSections + 1; @@ -483,9 +483,9 @@ namespace AZ for (uint32_t section = 0; section < numSections; ++section) { uint32_t nextSection = (section + 1) % numSections; - indices.push_back((uint16_t)firstVertOfLastRing + nextSection); - indices.push_back((uint16_t)firstVertOfLastRing + section); - indices.push_back((uint16_t)lastPoleVert); + indices.push_back(static_cast(firstVertOfLastRing + nextSection)); + indices.push_back(static_cast(firstVertOfLastRing + section)); + indices.push_back(static_cast(lastPoleVert)); } } } @@ -637,12 +637,12 @@ namespace AZ { // Line from center of disk to outer edge meshData.m_lineIndices.push_back(centerIndex); - meshData.m_lineIndices.push_back(firstSection + section); + meshData.m_lineIndices.push_back(static_cast(firstSection + section)); // Line from outer edge to next edge - meshData.m_lineIndices.push_back(firstSection + section); + meshData.m_lineIndices.push_back(static_cast(firstSection + section)); uint32_t nextSection = (section + 1) % numSections; - meshData.m_lineIndices.push_back(firstSection + nextSection); + meshData.m_lineIndices.push_back(static_cast(firstSection + nextSection)); } // Create triangle indices @@ -652,13 +652,13 @@ namespace AZ meshData.m_triangleIndices.push_back(centerIndex); if (isUp) { - meshData.m_triangleIndices.push_back(firstSection + nextSection); - meshData.m_triangleIndices.push_back(firstSection + section); + meshData.m_triangleIndices.push_back(static_cast(firstSection + nextSection)); + meshData.m_triangleIndices.push_back(static_cast(firstSection + section)); } else { - meshData.m_triangleIndices.push_back(firstSection + section); - meshData.m_triangleIndices.push_back(firstSection + nextSection); + meshData.m_triangleIndices.push_back(static_cast(firstSection + section)); + meshData.m_triangleIndices.push_back(static_cast(firstSection + nextSection)); } } } @@ -776,7 +776,7 @@ namespace AZ normals.push_back(AuxGeomNormal(0.0f, 1.0f, 0.0f)); // vertex indexes for start of the cone sides and for the cone point - uint16_t indexOfSidesStart = numSections + 1; + uint16_t indexOfSidesStart = static_cast(numSections + 1); uint32_t indexOfConePoint = indexOfSidesStart + numRings * numSections; // indices for points @@ -795,8 +795,8 @@ namespace AZ // build lines between already completed cap for each section for (uint16_t section = 0; section < numSections; ++section) { - indices.push_back(indexOfSidesStart + numRings * section); - indices.push_back(indexOfConePoint); + indices.push_back(static_cast(indexOfSidesStart + numRings * section)); + indices.push_back(static_cast(indexOfConePoint)); } } @@ -812,19 +812,19 @@ namespace AZ // faces from end cap to close to point for (uint32_t ring = 0; ring < numRings - 1; ++ring) { - indices.push_back(indexOfSidesStart + numRings * nextSection + ring + 1); - indices.push_back(indexOfSidesStart + numRings * nextSection + ring); - indices.push_back(indexOfSidesStart + numRings * section + ring); + indices.push_back(static_cast(indexOfSidesStart + numRings * nextSection + ring + 1)); + indices.push_back(static_cast(indexOfSidesStart + numRings * nextSection + ring)); + indices.push_back(static_cast(indexOfSidesStart + numRings * section + ring)); - indices.push_back(indexOfSidesStart + numRings * section + ring); - indices.push_back(indexOfSidesStart + numRings * section + ring + 1); - indices.push_back(indexOfSidesStart + numRings * nextSection + ring + 1); + indices.push_back(static_cast(indexOfSidesStart + numRings * section + ring)); + indices.push_back(static_cast(indexOfSidesStart + numRings * section + ring + 1)); + indices.push_back(static_cast(indexOfSidesStart + numRings * nextSection + ring + 1)); } // faces for point (from last ring of verts to point) - indices.push_back(indexOfConePoint); - indices.push_back(indexOfSidesStart + numRings * nextSection + numRings - 1); - indices.push_back(indexOfSidesStart + numRings * section + numRings - 1); + indices.push_back(static_cast(indexOfConePoint)); + indices.push_back(static_cast(indexOfSidesStart + numRings * nextSection + numRings - 1)); + indices.push_back(static_cast(indexOfSidesStart + numRings * section + numRings - 1)); } } } @@ -912,7 +912,7 @@ namespace AZ //uint16_t indexOfBottomStart = 1; //uint16_t indexOfTopCenter = numSections + 1; //uint16_t indexOfTopStart = numSections + 2; - uint16_t indexOfSidesStart = 2 * numSections + 2; + uint16_t indexOfSidesStart = static_cast(2 * numSections + 2); // build point indices { diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/CascadedShadowmapsPass.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/CascadedShadowmapsPass.cpp index 33123d67a1..5529a2916b 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/CascadedShadowmapsPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/CascadedShadowmapsPass.cpp @@ -126,7 +126,7 @@ namespace AZ return; } - SetCascadesCount(m_arraySize); + SetCascadesCount(static_cast(m_arraySize)); const RHI::Size imageSize { aznumeric_cast(m_shadowmapSize), diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp index 4aa749f7d7..1fff70ce59 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp @@ -225,7 +225,7 @@ namespace AZ } if (segmentsNeedUpdate) { - UpdateViewsOfCascadeSegments(m_shadowingLightHandle, cascadeCount); + UpdateViewsOfCascadeSegments(m_shadowingLightHandle, static_cast(cascadeCount)); SetShadowmapImageSizeArraySize(m_shadowingLightHandle); } @@ -1216,7 +1216,7 @@ namespace AZ else { // If ESM is not used, set filter offsets and filter counts zero in ESM data. - for (uint32_t index = 0; index < GetCascadeCount(handle); ++index) + for (uint16_t index = 0; index < GetCascadeCount(handle); ++index) { EsmShadowmapsPass::FilterParameter& filterParameter = m_esmParameterData.at(cameraView).GetData(index); filterParameter.m_isEnabled = false; diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.cpp b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.cpp index 6531a04e22..ebdc884ecf 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.cpp @@ -147,7 +147,7 @@ namespace AZ RPI::ImageMipChainAssetCreator assetCreator; const uint32_t mipLevels = GetNumMipLevels(); - assetCreator.Begin(Data::AssetId(AZ::Uuid::CreateRandom()), mipLevels, aznumeric_cast(numTexturesToCreate)); + assetCreator.Begin(Data::AssetId(AZ::Uuid::CreateRandom()), static_cast(mipLevels), aznumeric_cast(numTexturesToCreate)); for (uint32_t mipLevel = 0; mipLevel < mipLevels; ++mipLevel) { diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp index a3927b802d..69a4ecdee5 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp @@ -72,9 +72,9 @@ namespace AZ return; } - m_dispatchArgs.m_threadsPerGroupX = AZStd::any_cast(args[0]); - m_dispatchArgs.m_threadsPerGroupY = AZStd::any_cast(args[1]); - m_dispatchArgs.m_threadsPerGroupZ = AZStd::any_cast(args[2]); + m_dispatchArgs.m_threadsPerGroupX = static_cast(AZStd::any_cast(args[0])); + m_dispatchArgs.m_threadsPerGroupY = static_cast(AZStd::any_cast(args[1])); + m_dispatchArgs.m_threadsPerGroupZ = static_cast(AZStd::any_cast(args[2])); } } diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp index 6ff8bdd867..83ef312bf4 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp @@ -72,9 +72,9 @@ namespace AZ return; } - m_dispatchArgs.m_threadsPerGroupX = AZStd::any_cast(args[0]); - m_dispatchArgs.m_threadsPerGroupY = AZStd::any_cast(args[1]); - m_dispatchArgs.m_threadsPerGroupZ = AZStd::any_cast(args[2]); + m_dispatchArgs.m_threadsPerGroupX = static_cast(AZStd::any_cast(args[0])); + m_dispatchArgs.m_threadsPerGroupY = static_cast(AZStd::any_cast(args[1])); + m_dispatchArgs.m_threadsPerGroupZ = static_cast(AZStd::any_cast(args[2])); } } diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp index ddfe0f11b1..b251526cb4 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp @@ -85,9 +85,9 @@ namespace AZ return; } - dispatchArgs.m_threadsPerGroupX = AZStd::any_cast(args[0]); - dispatchArgs.m_threadsPerGroupY = AZStd::any_cast(args[1]); - dispatchArgs.m_threadsPerGroupZ = AZStd::any_cast(args[2]); + dispatchArgs.m_threadsPerGroupX = static_cast(AZStd::any_cast(args[0])); + dispatchArgs.m_threadsPerGroupY = static_cast(AZStd::any_cast(args[1])); + dispatchArgs.m_threadsPerGroupZ = static_cast(AZStd::any_cast(args[2])); } } diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp index 4c6b07d780..2690f90a7d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp @@ -76,9 +76,9 @@ namespace AZ return; } - m_dispatchArgs.m_threadsPerGroupX = AZStd::any_cast(args[0]); - m_dispatchArgs.m_threadsPerGroupY = AZStd::any_cast(args[1]); - m_dispatchArgs.m_threadsPerGroupZ = AZStd::any_cast(args[2]); + m_dispatchArgs.m_threadsPerGroupX = static_cast(AZStd::any_cast(args[0])); + m_dispatchArgs.m_threadsPerGroupY = static_cast(AZStd::any_cast(args[1])); + m_dispatchArgs.m_threadsPerGroupZ = static_cast(AZStd::any_cast(args[2])); } } diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp index 54cf9783cd..67fb95a833 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp @@ -76,9 +76,9 @@ namespace AZ return; } - m_dispatchArgs.m_threadsPerGroupX = AZStd::any_cast(args[0]); - m_dispatchArgs.m_threadsPerGroupY = AZStd::any_cast(args[1]); - m_dispatchArgs.m_threadsPerGroupZ = AZStd::any_cast(args[2]); + m_dispatchArgs.m_threadsPerGroupX = static_cast(AZStd::any_cast(args[0])); + m_dispatchArgs.m_threadsPerGroupY = static_cast(AZStd::any_cast(args[1])); + m_dispatchArgs.m_threadsPerGroupZ = static_cast(AZStd::any_cast(args[2])); } } diff --git a/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp b/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp index cd781390a3..9f2a7303a5 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp @@ -396,12 +396,12 @@ namespace AZ { auto imguiContextScope = ImguiContextScope(m_imguiContext); - m_viewportWidth = params.m_viewportState.m_maxX - params.m_viewportState.m_minX; - m_viewportHeight = params.m_viewportState.m_maxY - params.m_viewportState.m_minY; + m_viewportWidth = static_cast(params.m_viewportState.m_maxX - params.m_viewportState.m_minX); + m_viewportHeight = static_cast(params.m_viewportState.m_maxY - params.m_viewportState.m_minY); auto& io = ImGui::GetIO(); - io.DisplaySize.x = AZStd::max(1.0f, m_viewportWidth); - io.DisplaySize.y = AZStd::max(1.0f, m_viewportHeight); + io.DisplaySize.x = AZStd::max(1.0f, static_cast(m_viewportWidth)); + io.DisplaySize.y = AZStd::max(1.0f, static_cast(m_viewportHeight)); Matrix4x4 projectionMatrix = Matrix4x4::CreateFromRows( @@ -547,8 +547,8 @@ namespace AZ for (const ImDrawCmd& drawCmd : drawList->CmdBuffer) { AZ_Assert(drawCmd.UserCallback == nullptr, "ImGui UserCallbacks are not supported by the ImGui Pass"); - uint32_t scissorMaxX = drawCmd.ClipRect.z; - uint32_t scissorMaxY = drawCmd.ClipRect.w; + uint32_t scissorMaxX = static_cast(drawCmd.ClipRect.z); + uint32_t scissorMaxY = static_cast(drawCmd.ClipRect.w); //scissorMaxX/scissorMaxY can be a frame stale from imgui (ImGui::NewFrame runs after this) hence we clamp it to viewport bounds //otherwise it is possible to have a frame where scissor bounds can be bigger than window's bounds if we resize the window @@ -559,8 +559,8 @@ namespace AZ { RHI::DrawIndexed(1, 0, vertexOffset, drawCmd.ElemCount, indexOffset), RHI::Scissor( - (drawCmd.ClipRect.x), - (drawCmd.ClipRect.y), + static_cast(drawCmd.ClipRect.x), + static_cast(drawCmd.ClipRect.y), scissorMaxX, scissorMaxY ) diff --git a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp index 8e2c6f2e9b..54ef40ce6c 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp @@ -800,19 +800,19 @@ namespace AZ // note that the element count is the size of the entire buffer, even though this mesh may only // occupy a portion of the vertex buffer. This is necessary since we are accessing it using // a ByteAddressBuffer in the raytracing shaders and passing the byte offset to the shader in a constant buffer. - uint32_t positionBufferByteCount = const_cast(streamBufferViews[0].GetBuffer())->GetDescriptor().m_byteCount; + uint32_t positionBufferByteCount = static_cast(const_cast(streamBufferViews[0].GetBuffer())->GetDescriptor().m_byteCount); RHI::BufferViewDescriptor positionBufferDescriptor = RHI::BufferViewDescriptor::CreateRaw(0, positionBufferByteCount); - uint32_t normalBufferByteCount = const_cast(streamBufferViews[1].GetBuffer())->GetDescriptor().m_byteCount; + uint32_t normalBufferByteCount = static_cast(const_cast(streamBufferViews[1].GetBuffer())->GetDescriptor().m_byteCount); RHI::BufferViewDescriptor normalBufferDescriptor = RHI::BufferViewDescriptor::CreateRaw(0, normalBufferByteCount); - uint32_t tangentBufferByteCount = const_cast(streamBufferViews[2].GetBuffer())->GetDescriptor().m_byteCount; + uint32_t tangentBufferByteCount = static_cast(const_cast(streamBufferViews[2].GetBuffer())->GetDescriptor().m_byteCount); RHI::BufferViewDescriptor tangentBufferDescriptor = RHI::BufferViewDescriptor::CreateRaw(0, tangentBufferByteCount); - uint32_t bitangentBufferByteCount = const_cast(streamBufferViews[3].GetBuffer())->GetDescriptor().m_byteCount; + uint32_t bitangentBufferByteCount = static_cast(const_cast(streamBufferViews[3].GetBuffer())->GetDescriptor().m_byteCount); RHI::BufferViewDescriptor bitangentBufferDescriptor = RHI::BufferViewDescriptor::CreateRaw(0, bitangentBufferByteCount); - uint32_t uvBufferByteCount = const_cast(streamBufferViews[4].GetBuffer())->GetDescriptor().m_byteCount; + uint32_t uvBufferByteCount = static_cast(const_cast(streamBufferViews[4].GetBuffer())->GetDescriptor().m_byteCount); RHI::BufferViewDescriptor uvBufferDescriptor = RHI::BufferViewDescriptor::CreateRaw(0, uvBufferByteCount); const RHI::IndexBufferView& indexBufferView = mesh.m_indexBufferView; diff --git a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp index 0f8a30d8aa..19f379b17d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp @@ -85,9 +85,9 @@ namespace AZ { const auto& args = *numThreads; // Check that the arguments are valid integers, and fall back to 1,1,1 if there is an error - arguments.m_threadsPerGroupX = args[0].type() == azrtti_typeid() ? AZStd::any_cast(args[0]) : 1; - arguments.m_threadsPerGroupY = args[1].type() == azrtti_typeid() ? AZStd::any_cast(args[1]) : 1; - arguments.m_threadsPerGroupZ = args[2].type() == azrtti_typeid() ? AZStd::any_cast(args[2]) : 1; + arguments.m_threadsPerGroupX = static_cast(args[0].type() == azrtti_typeid() ? AZStd::any_cast(args[0]) : 1); + arguments.m_threadsPerGroupY = static_cast(args[1].type() == azrtti_typeid() ? AZStd::any_cast(args[1]) : 1); + arguments.m_threadsPerGroupZ = static_cast(args[2].type() == azrtti_typeid() ? AZStd::any_cast(args[2]) : 1); } arguments.m_totalNumberOfThreadsX = m_morphTargetMetaData.m_vertexCount; diff --git a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomBlurPass.cpp b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomBlurPass.cpp index b93e847fd2..3fcff54eaa 100644 --- a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomBlurPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomBlurPass.cpp @@ -153,8 +153,8 @@ namespace AZ inBinding.m_connectedBinding = isHorizontalPass ? &parentInOutBinding : &parentInBinding; RHI::ImageViewDescriptor viewDesc; - viewDesc.m_mipSliceMin = mipLevel; - viewDesc.m_mipSliceMax = mipLevel; + viewDesc.m_mipSliceMin = static_cast(mipLevel); + viewDesc.m_mipSliceMax = static_cast(mipLevel); inBinding.m_unifiedScopeDesc.SetAsImage(viewDesc); pass->AddAttachmentBinding(inBinding); diff --git a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomCompositePass.cpp b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomCompositePass.cpp index 11e53e8805..e9b428c877 100644 --- a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomCompositePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomCompositePass.cpp @@ -133,8 +133,8 @@ namespace AZ inBinding.m_connectedBinding = &parentInBinding; RHI::ImageViewDescriptor inViewDesc; - inViewDesc.m_mipSliceMin = mipLevel; - inViewDesc.m_mipSliceMax = mipLevel; + inViewDesc.m_mipSliceMin = static_cast(mipLevel); + inViewDesc.m_mipSliceMax = static_cast(mipLevel); inBinding.m_unifiedScopeDesc.SetAsImage(inViewDesc); pass->AddAttachmentBinding(inBinding); @@ -151,8 +151,8 @@ namespace AZ if (mipLevel != 0) { RHI::ImageViewDescriptor outViewDesc; - outViewDesc.m_mipSliceMin = mipLevel - 1; - outViewDesc.m_mipSliceMax = mipLevel - 1; + outViewDesc.m_mipSliceMin = static_cast(mipLevel - 1); + outViewDesc.m_mipSliceMax = static_cast(mipLevel - 1); outBinding.m_unifiedScopeDesc.SetAsImage(outViewDesc); } diff --git a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomDownsamplePass.cpp b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomDownsamplePass.cpp index 1481a7999e..8b824a424d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomDownsamplePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomDownsamplePass.cpp @@ -47,7 +47,7 @@ namespace AZ { RPI::Ptr outAttachment = m_ownedAttachments[0]; - for (uint32_t i = 0; i < Render::Bloom::MaxStageCount; ++i) + for (uint16_t i = 0; i < Render::Bloom::MaxStageCount; ++i) { // Create bindings diff --git a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/TaaPass.cpp b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/TaaPass.cpp index d1f42069fb..779f02cba0 100644 --- a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/TaaPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/TaaPass.cpp @@ -76,7 +76,7 @@ namespace AZ::Render void TaaPass::FrameBeginInternal(FramePrepareParams params) { RHI::Size inputSize = m_inputColorBinding->m_attachment->m_descriptor.m_image.m_size; - Vector2 rcpInputSize = Vector2(1.0 / inputSize.m_width, 1.0 / inputSize.m_height); + Vector2 rcpInputSize = Vector2(1.0f / inputSize.m_width, 1.0f / inputSize.m_height); RPI::ViewPtr view = GetRenderPipeline()->GetDefaultView(); m_offsetIndex = (m_offsetIndex + 1) % m_subPixelOffsets.size(); diff --git a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp index a6e41a3ce1..276ea7683f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp @@ -361,7 +361,7 @@ namespace AZ drawRequest.m_listTag = drawListTag; drawRequest.m_pipelineState = pipelineState->GetRHIPipelineState(); drawRequest.m_streamBufferViews = m_reflectionRenderData->m_boxPositionBufferView; - drawRequest.m_stencilRef = stencilRef; + drawRequest.m_stencilRef = static_cast(stencilRef); drawRequest.m_sortKey = m_sortKey; drawPacketBuilder.AddDrawItem(drawRequest); diff --git a/Gems/Atom/Feature/Common/Code/Source/ReflectionScreenSpace/ReflectionScreenSpaceBlurChildPass.cpp b/Gems/Atom/Feature/Common/Code/Source/ReflectionScreenSpace/ReflectionScreenSpaceBlurChildPass.cpp index c3125e0bbe..fce32cf448 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ReflectionScreenSpace/ReflectionScreenSpaceBlurChildPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ReflectionScreenSpace/ReflectionScreenSpaceBlurChildPass.cpp @@ -38,7 +38,7 @@ namespace AZ if (m_imageSize != size) { m_imageSize = size; - m_outputScale = (m_passType == PassType::Vertical) ? pow(2.0f, m_mipLevel) : 1.0f; + m_outputScale = (m_passType == PassType::Vertical) ? static_cast(pow(2.0f, m_mipLevel)) : 1.0f; m_updateSrg = true; } diff --git a/Gems/Atom/Feature/Common/Code/Source/ReflectionScreenSpace/ReflectionScreenSpaceBlurPass.cpp b/Gems/Atom/Feature/Common/Code/Source/ReflectionScreenSpace/ReflectionScreenSpaceBlurPass.cpp index 4f5caca108..394a6fd406 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ReflectionScreenSpace/ReflectionScreenSpaceBlurPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ReflectionScreenSpace/ReflectionScreenSpaceBlurPass.cpp @@ -190,8 +190,8 @@ namespace AZ RPI::PassAttachmentBinding& outputAttachmentBinding = horizontalBlurChildPass->GetInputOutputBinding(1); uint32_t mipLevel = attachmentIndex + 1; RHI::ImageViewDescriptor outputViewDesc; - outputViewDesc.m_mipSliceMin = mipLevel; - outputViewDesc.m_mipSliceMax = mipLevel; + outputViewDesc.m_mipSliceMin = static_cast(mipLevel); + outputViewDesc.m_mipSliceMax = static_cast(mipLevel); outputAttachmentBinding.m_unifiedScopeDesc.SetAsImage(outputViewDesc); outputAttachmentBinding.SetAttachment(reflectionImageAttachment); diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp index cd181f7011..bfc533763e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp @@ -205,9 +205,9 @@ namespace AZ if (numThreads) { const auto& args = *numThreads; - arguments.m_threadsPerGroupX = args[0].type() == azrtti_typeid() ? AZStd::any_cast(args[0]) : 1; - arguments.m_threadsPerGroupY = args[1].type() == azrtti_typeid() ? AZStd::any_cast(args[1]) : 1; - arguments.m_threadsPerGroupZ = args[2].type() == azrtti_typeid() ? AZStd::any_cast(args[2]) : 1; + arguments.m_threadsPerGroupX = static_cast(args[0].type() == azrtti_typeid() ? AZStd::any_cast(args[0]) : 1); + arguments.m_threadsPerGroupY = static_cast(args[1].type() == azrtti_typeid() ? AZStd::any_cast(args[1]) : 1); + arguments.m_threadsPerGroupZ = static_cast(args[2].type() == azrtti_typeid() ? AZStd::any_cast(args[2]) : 1); } arguments.m_totalNumberOfThreadsX = xThreads; diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp index af427eb554..2f40ea82d8 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp @@ -445,7 +445,7 @@ namespace AZ MorphTargetInstanceMetaData instanceMetaData; // Positions start at the beginning of the allocation - instanceMetaData.m_accumulatedPositionDeltaOffsetInBytes = allocation->GetVirtualAddress().m_ptr; + instanceMetaData.m_accumulatedPositionDeltaOffsetInBytes = static_cast(allocation->GetVirtualAddress().m_ptr); uint32_t deltaStreamSizeInBytes = static_cast(vertexCount * MorphTargetConstants::s_unpackedMorphTargetDeltaSizeInBytes); // Followed by normals, tangents, and bitangents diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/ImageProperty.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/ImageProperty.h index 00f329059c..23027083a4 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/ImageProperty.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/ImageProperty.h @@ -183,7 +183,7 @@ namespace AZ else { // Insert intervals by mip level. - for (uint32_t mipLevel = subResourceRange.m_mipSliceMin; mipLevel <= subResourceRange.m_mipSliceMax; ++mipLevel) + for (uint16_t mipLevel = subResourceRange.m_mipSliceMin; mipLevel <= subResourceRange.m_mipSliceMax; ++mipLevel) { m_intervalMap.assign( ConvertSubresourceToIndex(aspect, mipLevel, subResourceRange.m_arraySliceMin), @@ -273,7 +273,7 @@ namespace AZ else { // Traverse one mip level at a time. - for (uint32_t mipLevel = subResourceRange.m_mipSliceMin; mipLevel <= subResourceRange.m_mipSliceMax; ++mipLevel) + for (uint16_t mipLevel = subResourceRange.m_mipSliceMin; mipLevel <= subResourceRange.m_mipSliceMax; ++mipLevel) { getIntervals( ConvertSubresourceToIndex(aspect, mipLevel, subResourceRange.m_arraySliceMin), @@ -332,8 +332,8 @@ namespace AZ { const uint32_t subresourcesPerAspect = m_imageDescriptor.m_mipLevels * m_imageDescriptor.m_arraySize; return ImageSubresource( - (index % subresourcesPerAspect) / m_imageDescriptor.m_arraySize, - (index % subresourcesPerAspect) % m_imageDescriptor.m_arraySize, + static_cast((index % subresourcesPerAspect) / m_imageDescriptor.m_arraySize), + static_cast((index % subresourcesPerAspect) % m_imageDescriptor.m_arraySize), static_cast(index/ subresourcesPerAspect)); } diff --git a/Gems/Atom/RHI/Code/Source/RHI/CpuProfilerImpl.cpp b/Gems/Atom/RHI/Code/Source/RHI/CpuProfilerImpl.cpp index d41b5d656e..8d6be17ad3 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/CpuProfilerImpl.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/CpuProfilerImpl.cpp @@ -320,7 +320,7 @@ namespace AZ m_cachedTimeRegions.clear(); } - timeRegion.m_stackDepth = m_stackLevel; + timeRegion.m_stackDepth = static_cast(m_stackLevel); AZ_Assert(m_timeRegionStack.size() < TimeRegionStackSize, "Adding too many time regions to the stack. Increase the size of TimeRegionStackSize."); m_timeRegionStack.push_back(&timeRegion); diff --git a/Gems/Atom/RHI/Code/Source/RHI/FrameGraph.cpp b/Gems/Atom/RHI/Code/Source/RHI/FrameGraph.cpp index d2298cda3f..ff6ecb4df5 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/FrameGraph.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/FrameGraph.cpp @@ -497,7 +497,7 @@ namespace AZ for (const uint32_t edgeIndex : graphEdges[producerIndex]) { const GraphEdge& graphEdge = m_graphEdges[edgeIndex]; - const uint16_t consumerIndex = graphEdge.m_consumerIndex; + const uint16_t consumerIndex = static_cast(graphEdge.m_consumerIndex); if (--m_graphNodes[consumerIndex].m_unsortedProducerCount == 0) { NodeId newNode; diff --git a/Gems/Atom/RHI/Code/Source/RHI/Image.cpp b/Gems/Atom/RHI/Code/Source/RHI/Image.cpp index acefcca9e7..e864849a30 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/Image.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/Image.cpp @@ -61,7 +61,7 @@ namespace AZ imageStats->m_bindFlags = descriptor.m_bindFlags; ImageSubresourceRange subresourceRange; - subresourceRange.m_mipSliceMin = GetResidentMipLevel(); + subresourceRange.m_mipSliceMin = static_cast(GetResidentMipLevel()); GetSubresourceLayouts(subresourceRange, nullptr, &imageStats->m_sizeInBytes); } diff --git a/Gems/Atom/RHI/Code/Tests/ImagePropertyTests.cpp b/Gems/Atom/RHI/Code/Tests/ImagePropertyTests.cpp index 60d6bfdf96..d53a9d31e6 100644 --- a/Gems/Atom/RHI/Code/Tests/ImagePropertyTests.cpp +++ b/Gems/Atom/RHI/Code/Tests/ImagePropertyTests.cpp @@ -106,7 +106,7 @@ namespace UnitTest range.m_arraySliceMax -= 1; auto overlapInterval = m_property.Get(range); EXPECT_EQ(overlapInterval.size(), m_imageDescriptor.m_mipLevels); - for (uint32_t i = 0; i < overlapInterval.size(); ++i) + for (uint16_t i = 0; i < overlapInterval.size(); ++i) { RHI::ImageSubresourceRange mipRange = range; mipRange.m_mipSliceMin = i; diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI.Reflect/BufferPoolDescriptor.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI.Reflect/BufferPoolDescriptor.cpp index 0cc8fd0202..5007b21976 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI.Reflect/BufferPoolDescriptor.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI.Reflect/BufferPoolDescriptor.cpp @@ -26,7 +26,7 @@ namespace AZ BufferPoolDescriptor::BufferPoolDescriptor() { - m_bufferPoolPageSizeInBytes = RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_bufferPoolPageSizeInBytes; + m_bufferPoolPageSizeInBytes = static_cast(RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_bufferPoolPageSizeInBytes); } } } diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/BufferPool.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/BufferPool.cpp index 680669776c..c7b78a3945 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/BufferPool.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/BufferPool.cpp @@ -203,7 +203,7 @@ namespace AZ RHI::HeapMemoryUsage& heapMemoryUsage = m_memoryUsage.GetHeapMemoryUsage(descriptorBase.m_heapMemoryLevel); - uint32_t bufferPageSize = RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_bufferPoolPageSizeInBytes; + uint32_t bufferPageSize = static_cast(RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_bufferPoolPageSizeInBytes); // The DX12 descriptor provides an explicit buffer page size override. if (const DX12::BufferPoolDescriptor* descriptor = azrtti_cast(&descriptorBase)) diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/Conversions.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/Conversions.cpp index 98dc2965fb..6018e180ef 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/Conversions.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/Conversions.cpp @@ -1264,7 +1264,7 @@ namespace AZ dst.BlendOpAlpha = ConvertBlendOp(src.m_blendAlphaOp); dst.DestBlend = ConvertBlendFactor(src.m_blendDest); dst.DestBlendAlpha = ConvertBlendFactor(src.m_blendAlphaDest); - dst.RenderTargetWriteMask = ConvertColorWriteMask(src.m_writeMask); + dst.RenderTargetWriteMask = ConvertColorWriteMask(static_cast(src.m_writeMask)); dst.SrcBlend = ConvertBlendFactor(src.m_blendSource); dst.SrcBlendAlpha = ConvertBlendFactor(src.m_blendAlphaSource); dst.LogicOp = D3D12_LOGIC_OP_CLEAR; @@ -1399,8 +1399,8 @@ namespace AZ desc.DepthFunc = ConvertComparisonFunc(depthStencil.m_depth.m_func); desc.DepthWriteMask = ConvertDepthWriteMask(depthStencil.m_depth.m_writeMask); desc.StencilEnable = depthStencil.m_stencil.m_enable; - desc.StencilReadMask = depthStencil.m_stencil.m_readMask; - desc.StencilWriteMask = depthStencil.m_stencil.m_writeMask; + desc.StencilReadMask = static_cast(depthStencil.m_stencil.m_readMask); + desc.StencilWriteMask = static_cast(depthStencil.m_stencil.m_writeMask); return desc; } } diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/Device.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/Device.cpp index 9d23dfa43d..722952bc6d 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/Device.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/Device.cpp @@ -80,8 +80,8 @@ namespace AZ StagingMemoryAllocator::Descriptor allocatorDesc; allocatorDesc.m_device = this; - allocatorDesc.m_mediumPageSizeInBytes = RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_mediumStagingBufferPageSizeInBytes; - allocatorDesc.m_largePageSizeInBytes = RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_largestStagingBufferPageSizeInBytes; + allocatorDesc.m_mediumPageSizeInBytes = static_cast(RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_mediumStagingBufferPageSizeInBytes); + allocatorDesc.m_largePageSizeInBytes = static_cast(RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_largestStagingBufferPageSizeInBytes); allocatorDesc.m_collectLatency = descriptor.m_frameCountMax; m_stagingMemoryAllocator.Init(allocatorDesc); } diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLayout.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLayout.cpp index 1336642d8b..3fdeec1c51 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLayout.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLayout.cpp @@ -139,8 +139,8 @@ namespace AZ const RHI::ShaderResourceGroupLayout& groupLayout = *descriptor.GetShaderResourceGroupLayout(groupLayoutIndex); const uint32_t srgLayoutSlot = groupLayout.GetBindingSlot(); - m_slotToIndexTable[srgLayoutSlot] = groupLayoutIndex; - m_indexToSlotTable[groupLayoutIndex] = srgLayoutSlot; + m_slotToIndexTable[srgLayoutSlot] = static_cast(groupLayoutIndex); + m_indexToSlotTable[groupLayoutIndex] = static_cast(srgLayoutSlot); } // Construct a list of indexes sorted by frequency. diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/StreamingImagePool.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/StreamingImagePool.cpp index 6f35bb32ae..b6c4c029cf 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/StreamingImagePool.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/StreamingImagePool.cpp @@ -129,7 +129,7 @@ namespace AZ residentImageDescriptor.m_size = imageDescriptor.m_size.GetReducedMip(residentMipLevel); residentImageDescriptor.m_size.m_width = RHI::AlignUp(residentImageDescriptor.m_size.m_width, alignment); residentImageDescriptor.m_size.m_height = RHI::AlignUp(residentImageDescriptor.m_size.m_height, alignment); - residentImageDescriptor.m_mipLevels = imageDescriptor.m_mipLevels - residentMipLevel; + residentImageDescriptor.m_mipLevels = static_cast(imageDescriptor.m_mipLevels - residentMipLevel); D3D12_RESOURCE_ALLOCATION_INFO allocationInfo; GetDevice().GetImageAllocationInfo(residentImageDescriptor, allocationInfo); diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI.Reflect/BufferPoolDescriptor.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI.Reflect/BufferPoolDescriptor.cpp index 160dce12d5..c80b04bc73 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI.Reflect/BufferPoolDescriptor.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI.Reflect/BufferPoolDescriptor.cpp @@ -26,7 +26,7 @@ namespace AZ BufferPoolDescriptor::BufferPoolDescriptor() { - m_bufferPoolPageSizeInBytes = RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_bufferPoolPageSizeInBytes; + m_bufferPoolPageSizeInBytes = static_cast(RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_bufferPoolPageSizeInBytes); } } } diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/AsyncUploadQueue.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/AsyncUploadQueue.cpp index 18b5d83ed3..0d947085ba 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/AsyncUploadQueue.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/AsyncUploadQueue.cpp @@ -173,7 +173,7 @@ namespace AZ auto* image = static_cast(request.m_image); auto& device = static_cast(GetDevice()); - const uint16_t startMip = residentMip - 1; + const uint16_t startMip = static_cast(residentMip - 1); const uint16_t endMip = static_cast(residentMip - request.m_mipSlices.size()); RHI::Ptr uploadFence = Fence::Create(); @@ -277,7 +277,7 @@ namespace AZ copyDescriptor.m_sourceSize.m_depth = 1; copyDescriptor.m_destinationImage = image; copyDescriptor.m_destinationSubresource.m_mipSlice = curMip; - copyDescriptor.m_destinationSubresource.m_arraySlice = arraySlice; + copyDescriptor.m_destinationSubresource.m_arraySlice = static_cast(arraySlice); copyDescriptor.m_destinationOrigin.m_left = 0; copyDescriptor.m_destinationOrigin.m_top = 0; copyDescriptor.m_destinationOrigin.m_front = depth; @@ -309,7 +309,7 @@ namespace AZ copyDescriptor.m_sourceSize.m_depth = 1; copyDescriptor.m_destinationImage = image; copyDescriptor.m_destinationSubresource.m_mipSlice = curMip; - copyDescriptor.m_destinationSubresource.m_arraySlice = arraySlice; + copyDescriptor.m_destinationSubresource.m_arraySlice = static_cast(arraySlice); copyDescriptor.m_destinationOrigin.m_left = 0; copyDescriptor.m_destinationOrigin.m_top = 0; copyDescriptor.m_destinationOrigin.m_front = depth; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Conversion.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Conversion.cpp index 18ddc0f4df..d5671cff05 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Conversion.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Conversion.cpp @@ -257,7 +257,7 @@ namespace AZ state.srcAlphaBlendFactor = ConvertBlendFactor(targetBlendState.m_blendAlphaSource); state.dstAlphaBlendFactor = ConvertBlendFactor(targetBlendState.m_blendAlphaDest); state.alphaBlendOp = ConvertBlendOp(targetBlendState.m_blendAlphaOp); - state.colorWriteMask = ConvertComponentFlags(targetBlendState.m_writeMask); + state.colorWriteMask = ConvertComponentFlags(static_cast(targetBlendState.m_writeMask)); } VkBlendFactor ConvertBlendFactor(const RHI::BlendFactor& blendFactor) diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/ImageView.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/ImageView.cpp index d4697cbd32..44c36f5c70 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/ImageView.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/ImageView.cpp @@ -117,8 +117,8 @@ namespace AZ const auto& device = static_cast(GetDevice()); const auto& physicalDevice = static_cast(GetDevice().GetPhysicalDevice()); - const uint16_t width = imgDesc.m_size.m_width; - const uint16_t height = imgDesc.m_size.m_height; + const uint16_t width = static_cast(imgDesc.m_size.m_width); + const uint16_t height = static_cast(imgDesc.m_size.m_height); const uint16_t depth = AZStd::min(static_cast(imgViewDesc.m_depthSliceMax - imgViewDesc.m_depthSliceMin), static_cast(imgDesc.m_size.m_depth - 1)) + 1; const uint16_t samples = imgDesc.m_multisampleState.m_samples; const uint16_t arrayLayers = AZStd::min(static_cast(imgViewDesc.m_arraySliceMax - imgViewDesc.m_arraySliceMin), static_cast(imgDesc.m_arraySize - 1)) + 1; @@ -233,7 +233,7 @@ namespace AZ // https://www.khronos.org/registry/vulkan/specs/1.1/html/chap11.html#VkImageSubresourceRange { range.m_arraySliceMin = descriptor.m_depthSliceMin; - range.m_arraySliceMax = AZStd::GetMin(descriptor.m_depthSliceMax, imageDesc.m_size.m_depth - 1); + range.m_arraySliceMax = AZStd::GetMin(descriptor.m_depthSliceMax, static_cast(imageDesc.m_size.m_depth - 1)); break; } case VK_IMAGE_VIEW_TYPE_3D: diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.cpp index 5c7a78fd89..f627ddf2cc 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.cpp @@ -134,7 +134,7 @@ namespace AZ uint32_t bindingSlot = srgLayout->GetBindingSlot(); m_indexToSlot[bindingInfo.m_spaceId].set(bindingSlot); - m_slotToIndex[bindingSlot] = bindingInfo.m_spaceId; + m_slotToIndex[bindingSlot] = static_cast(bindingInfo.m_spaceId); } m_descriptorSetLayouts.reserve(srgCount); diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/StreamingImagePool.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/StreamingImagePool.cpp index 9189c2e177..586470da0a 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/StreamingImagePool.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/StreamingImagePool.cpp @@ -108,7 +108,7 @@ namespace AZ WaitFinishUploading(image); - const uint16_t residentMipLevelBefore = image.GetResidentMipLevel(); + const uint16_t residentMipLevelBefore = static_cast(image.GetResidentMipLevel()); const uint16_t residentMipLevelAfter = residentMipLevelBefore - static_cast(request.m_mipSlices.size()); const VkMemoryRequirements memoryRequirements = GetMemoryRequirements(image.GetDescriptor(), residentMipLevelAfter); @@ -149,11 +149,11 @@ namespace AZ // Set streamed mip level to target mip level. if (image.GetStreamedMipLevel() < targetMipLevel) { - image.SetStreamedMipLevel(targetMipLevel); + image.SetStreamedMipLevel(static_cast(targetMipLevel)); } const VkMemoryRequirements memoryRequirements = GetMemoryRequirements(image.GetDescriptor(), targetMipLevel); - const uint16_t residentMipLevelBefore = image.GetResidentMipLevel(); + const uint16_t residentMipLevelBefore = static_cast(image.GetResidentMipLevel()); RHI::HeapMemoryUsage& memoryUsage = m_memoryUsage.GetHeapMemoryUsage(RHI::HeapMemoryLevel::Device); const size_t imageSizeBefore = image.GetResidentSizeInBytes(); @@ -203,7 +203,7 @@ namespace AZ residentImageDescriptor.m_size = imageDescriptor.m_size.GetReducedMip(residentMipLevel); residentImageDescriptor.m_size.m_width = RHI::AlignUp(residentImageDescriptor.m_size.m_width, alignment); residentImageDescriptor.m_size.m_height = RHI::AlignUp(residentImageDescriptor.m_size.m_height, alignment); - residentImageDescriptor.m_mipLevels = imageDescriptor.m_mipLevels - residentMipLevel; + residentImageDescriptor.m_mipLevels = imageDescriptor.m_mipLevels - static_cast(residentMipLevel); return device.GetImageMemoryRequirements(imageDescriptor); } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Image/StreamingImage.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Image/StreamingImage.cpp index 45070371d6..8629588ea2 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Image/StreamingImage.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Image/StreamingImage.cpp @@ -247,7 +247,7 @@ namespace AZ uint16_t StreamingImage::GetResidentMipLevel() { - return m_image->GetResidentMipLevel(); + return static_cast(m_image->GetResidentMipLevel()); } RHI::ResultCode StreamingImage::TrimToMipChainLevel(size_t mipChainIndex) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/FullscreenTrianglePass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/FullscreenTrianglePass.cpp index 94421e2ca4..8a4206f0d8 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/FullscreenTrianglePass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/FullscreenTrianglePass.cpp @@ -155,7 +155,7 @@ namespace AZ m_item.m_arguments = RHI::DrawArguments(draw); m_item.m_pipelineState = m_shader->AcquirePipelineState(pipelineStateDescriptor); - m_item.m_stencilRef = m_stencilRef; + m_item.m_stencilRef = static_cast(m_stencilRef); } void FullscreenTrianglePass::FrameBeginInternal(FramePrepareParams params) diff --git a/Gems/Atom/RPI/Code/Tests/Buffer/BufferTests.cpp b/Gems/Atom/RPI/Code/Tests/Buffer/BufferTests.cpp index 3b113b78f8..f648de6997 100644 --- a/Gems/Atom/RPI/Code/Tests/Buffer/BufferTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Buffer/BufferTests.cpp @@ -67,7 +67,8 @@ namespace UnitTest bufferData.resize(bufferSize); // The actual data doesn't matter - for (uint32_t i = 0; i < bufferData.size(); ++i) + const uint8_t bufferDataSize = static_cast(bufferData.size()); + for (uint8_t i = 0; i < bufferDataSize; ++i) { bufferData[i] = i; } diff --git a/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp b/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp index 21f3239698..ff998ad4d3 100644 --- a/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp @@ -38,7 +38,8 @@ namespace UnitTest bufferData.resize(bufferSize); //The actual data doesn't matter - for (uint32_t i = 0; i < bufferData.size(); ++i) + const uint8_t bufferDataSize = static_cast(bufferData.size()); + for (uint8_t i = 0; i < bufferDataSize; ++i) { bufferData[i] = i; } diff --git a/Gems/Atom/Utils/Code/Source/ImageComparison.cpp b/Gems/Atom/Utils/Code/Source/ImageComparison.cpp index e226d0b2b4..a17d07ed3f 100644 --- a/Gems/Atom/Utils/Code/Source/ImageComparison.cpp +++ b/Gems/Atom/Utils/Code/Source/ImageComparison.cpp @@ -67,9 +67,9 @@ namespace AZ { // We use the max error from a single channel instead of accumulating the error from each channel. // This normalizes differences so that for example black vs red has the same weight as black vs yellow. - const int16_t diffR = abs(aznumeric_cast(bufferA[i]) - aznumeric_cast(bufferB[i])); - const int16_t diffG = abs(aznumeric_cast(bufferA[i + 1]) - aznumeric_cast(bufferB[i + 1])); - const int16_t diffB = abs(aznumeric_cast(bufferA[i + 2]) - aznumeric_cast(bufferB[i + 2])); + const int16_t diffR = static_cast(abs(aznumeric_cast(bufferA[i]) - aznumeric_cast(bufferB[i]))); + const int16_t diffG = static_cast(abs(aznumeric_cast(bufferA[i + 1]) - aznumeric_cast(bufferB[i + 1]))); + const int16_t diffB = static_cast(abs(aznumeric_cast(bufferA[i + 2]) - aznumeric_cast(bufferB[i + 2]))); const int16_t maxDiff = AZ::GetMax(AZ::GetMax(diffR, diffG), diffB); const float finalDiffNormalized = maxDiff / 255.0f;