Parcourir la source

Atom

Signed-off-by: Esteban Papp <[email protected]>
pappeste il y a 4 ans
Parent
commit
97f9ac870d

+ 1 - 1
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
                 // 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.
                 // 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();
                 const LightPosition* firstPosition = m_polygonLightData.GetDataVector<1>().at(0).data();
-                m_lightPolygonPointBufferHandler.UpdateBuffer(firstPosition, m_polygonLightData.GetDataCount() * MaxPolygonPoints);
+                m_lightPolygonPointBufferHandler.UpdateBuffer(firstPosition, static_cast<uint32_t>(m_polygonLightData.GetDataCount() * MaxPolygonPoints));
             }
             }
             m_deviceBufferNeedsUpdate = false;
             m_deviceBufferNeedsUpdate = false;
         }
         }

+ 1 - 1
Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp

@@ -65,7 +65,7 @@ namespace AZ
 
 
                 AZ::JobCompletion jobCompletion;
                 AZ::JobCompletion jobCompletion;
                 const int numThreads = 8;
                 const int numThreads = 8;
-                const int numPixelsPerThread = buffer->size() / numChannels / numThreads;
+                const int numPixelsPerThread = static_cast<int>(buffer->size() / numChannels / numThreads);
                 for (int i = 0; i < numThreads; ++i)
                 for (int i = 0; i < numThreads; ++i)
                 {
                 {
                     int startPixel = i * numPixelsPerThread;
                     int startPixel = i * numPixelsPerThread;

+ 1 - 1
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_rootConstantData.SetConstant(colorOffsetIndex, m_morphInstanceMetaData.m_accumulatedColorDeltaOffsetInBytes / 4);
             }
             }
 
 
-            m_dispatchItem.m_rootConstantSize = m_rootConstantData.GetConstantData().size();
+            m_dispatchItem.m_rootConstantSize = static_cast<uint8_t>(m_rootConstantData.GetConstantData().size());
             m_dispatchItem.m_rootConstants = m_rootConstantData.GetConstantData().data();
             m_dispatchItem.m_rootConstants = m_rootConstantData.GetConstantData().data();
         }
         }
 
 

+ 2 - 2
Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.cpp

@@ -497,7 +497,7 @@ namespace AZ::Render
         const ShadowmapAtlas& atlas = m_projectedShadowmapsPasses.front()->GetShadowmapAtlas();
         const ShadowmapAtlas& atlas = m_projectedShadowmapsPasses.front()->GetShadowmapAtlas();
         const Data::Instance<RPI::Buffer> indexTableBuffer = atlas.CreateShadowmapIndexTableBuffer(indexTableBufferName);
         const Data::Instance<RPI::Buffer> indexTableBuffer = atlas.CreateShadowmapIndexTableBuffer(indexTableBufferName);
 
 
-        m_filterParamBufferHandler.UpdateBuffer(m_shadowData.GetRawData<FilterParamIndex>(), m_shadowData.GetSize());
+        m_filterParamBufferHandler.UpdateBuffer(m_shadowData.GetRawData<FilterParamIndex>(), static_cast<uint32_t>(m_shadowData.GetSize()));
 
 
         // Set index table buffer and ESM parameter buffer to ESM pass.
         // Set index table buffer and ESM parameter buffer to ESM pass.
         for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses)
         for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses)
@@ -564,7 +564,7 @@ namespace AZ::Render
 
 
         if (m_deviceBufferNeedsUpdate)
         if (m_deviceBufferNeedsUpdate)
         {
         {
-            m_shadowBufferHandler.UpdateBuffer(m_shadowData.GetRawData<ShadowDataIndex>(), m_shadowData.GetSize());
+            m_shadowBufferHandler.UpdateBuffer(m_shadowData.GetRawData<ShadowDataIndex>(), static_cast<uint32_t>(m_shadowData.GetSize()));
             m_deviceBufferNeedsUpdate = false;
             m_deviceBufferNeedsUpdate = false;
         }
         }
     }
     }

+ 1 - 1
Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp

@@ -446,7 +446,7 @@ namespace AZ
 
 
                     // Positions start at the beginning of the allocation
                     // Positions start at the beginning of the allocation
                     instanceMetaData.m_accumulatedPositionDeltaOffsetInBytes = allocation->GetVirtualAddress().m_ptr;
                     instanceMetaData.m_accumulatedPositionDeltaOffsetInBytes = allocation->GetVirtualAddress().m_ptr;
-                    uint32_t deltaStreamSizeInBytes = vertexCount * MorphTargetConstants::s_unpackedMorphTargetDeltaSizeInBytes;
+                    uint32_t deltaStreamSizeInBytes = static_cast<uint32_t>(vertexCount * MorphTargetConstants::s_unpackedMorphTargetDeltaSizeInBytes);
 
 
                     // Followed by normals, tangents, and bitangents
                     // Followed by normals, tangents, and bitangents
                     instanceMetaData.m_accumulatedNormalDeltaOffsetInBytes = instanceMetaData.m_accumulatedPositionDeltaOffsetInBytes + deltaStreamSizeInBytes;
                     instanceMetaData.m_accumulatedNormalDeltaOffsetInBytes = instanceMetaData.m_accumulatedPositionDeltaOffsetInBytes + deltaStreamSizeInBytes;

+ 4 - 4
Gems/Atom/Feature/Common/Code/Tests/SparseVectorTests.cpp

@@ -81,7 +81,7 @@ namespace UnitTest
             EXPECT_EQ(data.c, TestData::DefaultValueC);
             EXPECT_EQ(data.c, TestData::DefaultValueC);
 
 
             // Assign new unique values
             // Assign new unique values
-            data.a = TestData::DefaultValueA * i;
+            data.a = TestData::DefaultValueA * static_cast<int>(i);
             data.b = TestData::DefaultValueB * float(i);
             data.b = TestData::DefaultValueB * float(i);
             data.c = i % 2 == 0;
             data.c = i % 2 == 0;
         }
         }
@@ -190,12 +190,12 @@ namespace UnitTest
             EXPECT_EQ(data.b, TestData::DefaultValueB);
             EXPECT_EQ(data.b, TestData::DefaultValueB);
             EXPECT_EQ(data.c, TestData::DefaultValueC);
             EXPECT_EQ(data.c, TestData::DefaultValueC);
             
             
-            data.a = TestData::DefaultValueA * i;
+            data.a = TestData::DefaultValueA * static_cast<int>(i);
             data.b = TestData::DefaultValueB * float(i);
             data.b = TestData::DefaultValueB * float(i);
             data.c = i % 2 == 0;
             data.c = i % 2 == 0;
 
 
             // Assign some values to the uninitialized primitive types
             // Assign some values to the uninitialized primitive types
-            container.GetElement<1>(indices[i]) = i * 10;
+            container.GetElement<1>(indices[i]) = static_cast<int>(i * 10);
             container.GetElement<2>(indices[i]) = i * 20.0f;
             container.GetElement<2>(indices[i]) = i * 20.0f;
         }
         }
 
 
@@ -254,7 +254,7 @@ namespace UnitTest
         {
         {
             indices[i] = container.Reserve();
             indices[i] = container.Reserve();
 
 
-            container.GetElement<1>(i) = i * 10;
+            container.GetElement<1>(i) = static_cast<int>(i * 10);
             container.GetElement<2>(i) = i * 20.0f;
             container.GetElement<2>(i) = i * 20.0f;
         }
         }
 
 

+ 2 - 2
Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupData.cpp

@@ -139,7 +139,7 @@ namespace AZ
                 bool isValidAll = true;
                 bool isValidAll = true;
                 for (size_t i = 0; i < imageViews.size(); ++i)
                 for (size_t i = 0; i < imageViews.size(); ++i)
                 {
                 {
-                    const bool isValid = ValidateImageViewAccess<ShaderInputImageUnboundedArrayIndex, ShaderInputImageUnboundedArrayDescriptor>(inputIndex, imageViews[i], i);
+                    const bool isValid = ValidateImageViewAccess<ShaderInputImageUnboundedArrayIndex, ShaderInputImageUnboundedArrayDescriptor>(inputIndex, imageViews[i], static_cast<uint32_t>(i));
                     if (isValid)
                     if (isValid)
                     {
                     {
                         m_imageViewsUnboundedArray.push_back(imageViews[i]);
                         m_imageViewsUnboundedArray.push_back(imageViews[i]);
@@ -185,7 +185,7 @@ namespace AZ
                 bool isValidAll = true;
                 bool isValidAll = true;
                 for (size_t i = 0; i < bufferViews.size(); ++i)
                 for (size_t i = 0; i < bufferViews.size(); ++i)
                 {
                 {
-                    const bool isValid = ValidateBufferViewAccess<ShaderInputBufferUnboundedArrayIndex, ShaderInputBufferUnboundedArrayDescriptor>(inputIndex, bufferViews[i], i);
+                    const bool isValid = ValidateBufferViewAccess<ShaderInputBufferUnboundedArrayIndex, ShaderInputBufferUnboundedArrayDescriptor>(inputIndex, bufferViews[i], static_cast<uint32_t>(i));
                     if (isValid)
                     if (isValid)
                     {
                     {
                         m_bufferViewsUnboundedArray.push_back(bufferViews[i]);
                         m_bufferViewsUnboundedArray.push_back(bufferViews[i]);

+ 2 - 2
Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp

@@ -356,7 +356,7 @@ namespace AZ
 
 
                     if (!bufferViews.empty())
                     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<uint32_t>(bufferViews.size()));
                         AZ_Assert(group.m_unboundedDescriptorTables[tableIndex].IsValid(), "Descriptor context failed to allocate unbounded array descriptor table, most likely out of memory.");
                         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];
                         ShaderResourceGroupCompiledData& compiledData = group.m_compiledData[group.m_compiledDataIndex];
@@ -415,7 +415,7 @@ namespace AZ
 
 
                     if (!imageViews.empty())
                     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<uint32_t>(imageViews.size()));
                         AZ_Assert(group.m_unboundedDescriptorTables[tableIndex].IsValid(), "Descriptor context failed to allocate unbounded array descriptor table, most likely out of memory.");
                         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];
                         ShaderResourceGroupCompiledData& compiledData = group.m_compiledData[group.m_compiledDataIndex];

+ 2 - 2
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.sType = VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR;
             createInfo.pNext = nullptr;
             createInfo.pNext = nullptr;
             createInfo.flags = 0;
             createInfo.flags = 0;
-            createInfo.stageCount = stages.size();
+            createInfo.stageCount = static_cast<uint32_t>(stages.size());
             createInfo.pStages = stages.data();
             createInfo.pStages = stages.data();
-            createInfo.groupCount = groups.size();
+            createInfo.groupCount = static_cast<uint32_t>(groups.size());
             createInfo.pGroups = groups.data();
             createInfo.pGroups = groups.data();
             createInfo.maxPipelineRayRecursionDepth = descriptor->GetConfiguration().m_maxRecursionDepth;
             createInfo.maxPipelineRayRecursionDepth = descriptor->GetConfiguration().m_maxRecursionDepth;
             createInfo.layout = m_pipelineLayout;
             createInfo.layout = m_pipelineLayout;

+ 8 - 8
Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp

@@ -883,7 +883,7 @@ namespace AZ
                         processedMorphTargets = true;
                         processedMorphTargets = true;
                     }
                     }
 
 
-                    totalVertexCount += vertexCount;
+                    totalVertexCount += static_cast<uint32_t>(vertexCount);
                     productMeshList.emplace_back(productMesh);
                     productMeshList.emplace_back(productMesh);
                 }
                 }
             }
             }
@@ -961,7 +961,7 @@ namespace AZ
             for (const auto& skinData : sourceMesh.m_skinData)
             for (const auto& skinData : sourceMesh.m_skinData)
             {
             {
                 const size_t numJoints = skinData->GetBoneCount();
                 const size_t numJoints = skinData->GetBoneCount();
-                const AZ::u32 controlPointIndex = sourceMeshData->GetControlPointIndex(vertexIndex);
+                const AZ::u32 controlPointIndex = sourceMeshData->GetControlPointIndex(static_cast<int>(vertexIndex));
                 const size_t numSkinInfluences = skinData->GetLinkCount(controlPointIndex);
                 const size_t numSkinInfluences = skinData->GetLinkCount(controlPointIndex);
 
 
                 size_t numInfluencesExcess = 0;
                 size_t numInfluencesExcess = 0;
@@ -1196,15 +1196,15 @@ namespace AZ
                     mesh.m_skinWeights.size(), m_numSkinJointInfluencesPerVertex, m_numSkinJointInfluencesPerVertex);
                     mesh.m_skinWeights.size(), m_numSkinJointInfluencesPerVertex, m_numSkinJointInfluencesPerVertex);
                 const size_t numSkinInfluences = mesh.m_skinWeights.size();
                 const size_t numSkinInfluences = mesh.m_skinWeights.size();
 
 
-                uint32_t jointIndicesSizeInBytes = numSkinInfluences * sizeof(uint16_t);
+                uint32_t jointIndicesSizeInBytes = static_cast<uint32_t>(numSkinInfluences * sizeof(uint16_t));
                 meshView.m_skinJointIndicesView = RHI::BufferViewDescriptor::CreateRaw(0, jointIndicesSizeInBytes);
                 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<uint32_t>(numSkinInfluences), SkinWeightFormat);
             }
             }
 
 
             if (!mesh.m_morphTargetVertexData.empty())
             if (!mesh.m_morphTargetVertexData.empty())
             {
             {
                 const size_t numTotalVertices = mesh.m_morphTargetVertexData.size();
                 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<uint32_t>(numTotalVertices), sizeof(PackedCompressedMorphTargetDelta));
             }
             }
 
 
             if (!mesh.m_clothData.empty())
             if (!mesh.m_clothData.empty())
@@ -1359,8 +1359,8 @@ namespace AZ
                     const size_t numPrevSkinInfluences = lodBufferInfo.m_skinInfluencesCount;
                     const size_t numPrevSkinInfluences = lodBufferInfo.m_skinInfluencesCount;
                     const size_t numNewSkinInfluences = mesh.m_skinWeights.size();
                     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<uint32_t>(numPrevSkinInfluences * sizeof(uint16_t)), static_cast<uint32_t>(numNewSkinInfluences  * sizeof(uint16_t)));
+                    meshView.m_skinWeightsView = RHI::BufferViewDescriptor::CreateTyped(/*elementOffset=*/ static_cast<uint32_t>(numPrevSkinInfluences), static_cast<uint32_t>(numNewSkinInfluences), SkinWeightFormat);
 
 
                     lodBufferInfo.m_skinInfluencesCount += numNewSkinInfluences;
                     lodBufferInfo.m_skinInfluencesCount += numNewSkinInfluences;
                 }
                 }
@@ -1370,7 +1370,7 @@ namespace AZ
                     const size_t numPrevVertexDeltas = lodBufferInfo.m_morphTargetVertexDeltaCount;
                     const size_t numPrevVertexDeltas = lodBufferInfo.m_morphTargetVertexDeltaCount;
                     const size_t numNewVertexDeltas = mesh.m_morphTargetVertexData.size();
                     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<uint32_t>(numPrevVertexDeltas), static_cast<uint32_t>(numNewVertexDeltas), sizeof(PackedCompressedMorphTargetDelta));
 
 
                     lodBufferInfo.m_morphTargetVertexDeltaCount += numNewVertexDeltas;
                     lodBufferInfo.m_morphTargetVertexDeltaCount += numNewVertexDeltas;
                 }
                 }

+ 3 - 3
Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp

@@ -110,8 +110,8 @@ namespace AZ::RPI
     {
     {
         AZ::Aabb meshAabb = AZ::Aabb::CreateNull();
         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<unsigned int>(mesh.m_meshData->GetVertexCount());
+        for (unsigned int i = 0; i < numVertices; ++i)
         {
         {
             meshAabb.AddPoint(mesh.m_meshData->GetPosition(i));
             meshAabb.AddPoint(mesh.m_meshData->GetPosition(i));
         }
         }
@@ -164,7 +164,7 @@ namespace AZ::RPI
             blendShapeName.c_str(), numVertices, sourceMesh.m_meshData->GetVertexCount());
             blendShapeName.c_str(), numVertices, sourceMesh.m_meshData->GetVertexCount());
 
 
         // The start index is after any previously added deltas
         // The start index is after any previously added deltas
-        metaData.m_startIndex = aznumeric_caster<uint32_t>(packedCompressedMorphTargetVertexData.size());
+        metaData.m_startIndex = aznumeric_cast<uint32_t>(packedCompressedMorphTargetVertexData.size());
 
 
 
 
         // Multiply normal by inverse transpose to avoid incorrect values produced by non-uniformly scaled transforms.
         // Multiply normal by inverse transpose to avoid incorrect values produced by non-uniformly scaled transforms.

+ 1 - 1
Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp

@@ -780,7 +780,7 @@ namespace AZ
                                     pipelineStateList.push_back();
                                     pipelineStateList.push_back();
                                     pipelineStateList[size].m_multisampleState = rasterPass->GetMultisampleState();
                                     pipelineStateList[size].m_multisampleState = rasterPass->GetMultisampleState();
                                     pipelineStateList[size].m_renderAttachmentConfiguration = rasterPass->GetRenderAttachmentConfiguration();
                                     pipelineStateList[size].m_renderAttachmentConfiguration = rasterPass->GetRenderAttachmentConfiguration();
-                                    rasterPass->SetPipelineStateDataIndex(size);
+                                    rasterPass->SetPipelineStateDataIndex(static_cast<AZ::u32>(size));
                                 }
                                 }
                             }
                             }
                         }
                         }

+ 4 - 4
Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp

@@ -1025,23 +1025,23 @@ namespace UnitTest
             );
             );
 
 
             {
             {
-                AZ::Data::Asset<AZ::RPI::BufferAsset> indexBuffer = BuildTestBuffer(indicesCount, sizeof(uint32_t));
+                AZ::Data::Asset<AZ::RPI::BufferAsset> indexBuffer = BuildTestBuffer(static_cast<uint32_t>(indicesCount), sizeof(uint32_t));
                 AZStd::copy(indices, indices + indicesCount, reinterpret_cast<uint32_t*>(const_cast<uint8_t*>(indexBuffer->GetBuffer().data())));
                 AZStd::copy(indices, indices + indicesCount, reinterpret_cast<uint32_t*>(const_cast<uint8_t*>(indexBuffer->GetBuffer().data())));
                 lodCreator.SetMeshIndexBuffer({
                 lodCreator.SetMeshIndexBuffer({
                     indexBuffer,
                     indexBuffer,
-                    AZ::RHI::BufferViewDescriptor::CreateStructured(0, indicesCount, sizeof(uint32_t))
+                    AZ::RHI::BufferViewDescriptor::CreateStructured(0, static_cast<uint32_t>(indicesCount), sizeof(uint32_t))
                 });
                 });
             }
             }
 
 
             {
             {
-                AZ::Data::Asset<AZ::RPI::BufferAsset> positionBuffer = BuildTestBuffer(positionCount / 3, sizeof(float) * 3);
+                AZ::Data::Asset<AZ::RPI::BufferAsset> positionBuffer = BuildTestBuffer(static_cast<uint32_t>(positionCount / 3), sizeof(float) * 3);
                 AZStd::copy(positions, positions + positionCount, reinterpret_cast<float*>(const_cast<uint8_t*>(positionBuffer->GetBuffer().data())));
                 AZStd::copy(positions, positions + positionCount, reinterpret_cast<float*>(const_cast<uint8_t*>(positionBuffer->GetBuffer().data())));
                 lodCreator.AddMeshStreamBuffer(
                 lodCreator.AddMeshStreamBuffer(
                     AZ::RHI::ShaderSemantic(AZ::Name("POSITION")),
                     AZ::RHI::ShaderSemantic(AZ::Name("POSITION")),
                     AZ::Name(),
                     AZ::Name(),
                     {
                     {
                         positionBuffer,
                         positionBuffer,
-                        AZ::RHI::BufferViewDescriptor::CreateStructured(0, positionCount / 3, sizeof(float) * 3)
+                        AZ::RHI::BufferViewDescriptor::CreateStructured(0, static_cast<uint32_t>(positionCount / 3), sizeof(float) * 3)
                     }
                     }
                 );
                 );
             }
             }

+ 1 - 1
Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp

@@ -144,7 +144,7 @@ namespace MaterialEditor
 
 
         if (!windowSettings->m_mainWindowState.empty())
         if (!windowSettings->m_mainWindowState.empty())
         {
         {
-            QByteArray windowState(windowSettings->m_mainWindowState.data(), windowSettings->m_mainWindowState.size());
+            QByteArray windowState(windowSettings->m_mainWindowState.data(), static_cast<int>(windowSettings->m_mainWindowState.size()));
             m_advancedDockManager->restoreState(windowState);
             m_advancedDockManager->restoreState(windowState);
         }
         }