Explorar o código

fixing warnings that will be enabled by PR #3033 (#195)

* fixing warnings that will be enabled by PR #/3033

Signed-off-by: Esteban Papp <[email protected]>

* PR comments

Signed-off-by: Esteban Papp <[email protected]>

* another PR comment

Signed-off-by: Esteban Papp <[email protected]>
Esteban Papp %!s(int64=4) %!d(string=hai) anos
pai
achega
f5cad962bc
Modificáronse 36 ficheiros con 101 adicións e 101 borrados
  1. 3 3
      Gem/Code/Source/AreaLightExampleComponent.cpp
  2. 1 1
      Gem/Code/Source/BakedShaderVariantExampleComponent.cpp
  3. 2 2
      Gem/Code/Source/CommonSampleComponentBase.cpp
  4. 6 6
      Gem/Code/Source/CullingAndLodExampleComponent.cpp
  5. 1 1
      Gem/Code/Source/MSAA_RPI_ExampleComponent.cpp
  6. 1 1
      Gem/Code/Source/MeshExampleComponent.cpp
  7. 1 1
      Gem/Code/Source/ProceduralSkinnedMesh.cpp
  8. 2 2
      Gem/Code/Source/RHI/AlphaToCoverageExampleComponent.cpp
  9. 12 12
      Gem/Code/Source/RHI/AsyncComputeExampleComponent.cpp
  10. 1 1
      Gem/Code/Source/RHI/BasicRHIComponent.cpp
  11. 2 2
      Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp
  12. 2 2
      Gem/Code/Source/RHI/ComputeExampleComponent.cpp
  13. 2 2
      Gem/Code/Source/RHI/CopyQueueComponent.cpp
  14. 2 2
      Gem/Code/Source/RHI/DualSourceBlendingComponent.cpp
  15. 2 2
      Gem/Code/Source/RHI/IndirectRenderingExampleComponent.cpp
  16. 1 1
      Gem/Code/Source/RHI/InputAssemblyExampleComponent.cpp
  17. 4 4
      Gem/Code/Source/RHI/MRTExampleComponent.cpp
  18. 6 6
      Gem/Code/Source/RHI/MSAAExampleComponent.cpp
  19. 2 2
      Gem/Code/Source/RHI/MultiThreadComponent.cpp
  20. 4 4
      Gem/Code/Source/RHI/MultipleViewsComponent.cpp
  21. 1 1
      Gem/Code/Source/RHI/QueryExampleComponent.cpp
  22. 2 2
      Gem/Code/Source/RHI/RayTracingExampleComponent.cpp
  23. 2 2
      Gem/Code/Source/RHI/SphericalHarmonicsExampleComponent.cpp
  24. 1 1
      Gem/Code/Source/RHI/StencilExampleComponent.cpp
  25. 3 3
      Gem/Code/Source/RHI/SubpassExampleComponent.cpp
  26. 1 1
      Gem/Code/Source/RHI/Texture3dExampleComponent.cpp
  27. 2 2
      Gem/Code/Source/RHI/TextureArrayExampleComponent.cpp
  28. 2 2
      Gem/Code/Source/RHI/TextureExampleComponent.cpp
  29. 5 5
      Gem/Code/Source/RHI/TextureMapExampleComponent.cpp
  30. 2 2
      Gem/Code/Source/RHI/TriangleExampleComponent.cpp
  31. 2 2
      Gem/Code/Source/RHI/TrianglesConstantBufferExampleComponent.cpp
  32. 1 1
      Gem/Code/Source/SampleComponentManager.cpp
  33. 10 10
      Gem/Code/Source/ShadowExampleComponent.cpp
  34. 8 8
      Gem/Code/Source/ShadowedSponzaExampleComponent.cpp
  35. 1 1
      Gem/Code/Source/TonemappingExampleComponent.cpp
  36. 1 1
      Gem/Code/Source/Utils/Utils.cpp

+ 3 - 3
Gem/Code/Source/AreaLightExampleComponent.cpp

@@ -437,7 +437,7 @@ namespace AtomSampleViewer
         for (uint32_t i = 0; i < vertexCount; ++i)
         {
             // Get a point on the circle and scale it by the min or max radius for every other point.
-            AZ::Vector3 point = GetCirclePoint(i, vertexCount) * minMaxRadius[i % 2];
+            AZ::Vector3 point = GetCirclePoint(static_cast<float>(i), static_cast<float>(vertexCount)) * minMaxRadius[i % 2];
             points.push_back(point);
         }
         return points;
@@ -453,8 +453,8 @@ namespace AtomSampleViewer
         {
             uint32_t nextI = (i + 1) % vertexCount;
 
-            AZ::Vector3 p0 = GetCirclePoint(i, vertexCount) * minMaxRadius[i % 2];
-            AZ::Vector3 p1 = GetCirclePoint(nextI, vertexCount) * minMaxRadius[nextI % 2];
+            AZ::Vector3 p0 = GetCirclePoint(static_cast<float>(i), static_cast<float>(vertexCount)) * minMaxRadius[i % 2];
+            AZ::Vector3 p1 = GetCirclePoint(static_cast<float>(nextI), static_cast<float>(vertexCount)) * minMaxRadius[nextI % 2];
 
             tris.push_back(p0);
             tris.push_back(p1);

+ 1 - 1
Gem/Code/Source/BakedShaderVariantExampleComponent.cpp

@@ -124,7 +124,7 @@ namespace AtomSampleViewer
         m_imGuiFrameTimer.PushValue(deltaTime);
 
         AZ::RPI::TimestampResult forwardTimestampResult = m_forwardPass->GetLatestTimestampResult();
-        double gpuForwardFrameTimeMs = aznumeric_cast<double>(forwardTimestampResult.GetDurationInNanoseconds()) / 1000000;
+        float gpuForwardFrameTimeMs = aznumeric_cast<float>(forwardTimestampResult.GetDurationInNanoseconds()) / 1000000;
         m_imGuiForwardPassTimer.PushValue(gpuForwardFrameTimeMs);
 
 

+ 2 - 2
Gem/Code/Source/CommonSampleComponentBase.cpp

@@ -184,8 +184,8 @@ namespace AtomSampleViewer
 
                 // Each LightingPreset can have an alternate skybox (usually a blurred version of the primary skybox), so we expose both here as separate items in the UI.
 
-                bool useThisPresetWithNormalSkybox = (i == m_currentLightingPresetIndex) && !m_useAlternateSkybox;
-                bool useThisPresetWithAlternateSkybox = (i == m_currentLightingPresetIndex) && m_useAlternateSkybox;
+                bool useThisPresetWithNormalSkybox = (static_cast<int32_t>(i) == m_currentLightingPresetIndex) && !m_useAlternateSkybox;
+                bool useThisPresetWithAlternateSkybox = (static_cast<int32_t>(i) == m_currentLightingPresetIndex) && m_useAlternateSkybox;
 
                 useThisPresetWithNormalSkybox = ScriptableImGui::Selectable(name.c_str(), useThisPresetWithNormalSkybox);
                 useThisPresetWithAlternateSkybox = ScriptableImGui::Selectable(nameForAlternateSkybox.c_str(), useThisPresetWithAlternateSkybox);

+ 6 - 6
Gem/Code/Source/CullingAndLodExampleComponent.cpp

@@ -233,8 +233,8 @@ namespace AtomSampleViewer
             dirLightFP->SetViewFrustumCorrectionEnabled(handle, m_isCascadeCorrectionEnabled);
             dirLightFP->SetShadowFilterMethod(handle, s_shadowFilterMethods[m_shadowFilterMethodIndex]);
             dirLightFP->SetShadowBoundaryWidth(handle, m_boundaryWidth);
-            dirLightFP->SetPredictionSampleCount(handle, m_predictionSampleCount);
-            dirLightFP->SetFilteringSampleCount(handle, m_filteringSampleCount);
+            dirLightFP->SetPredictionSampleCount(handle, static_cast<uint16_t>(m_predictionSampleCount));
+            dirLightFP->SetFilteringSampleCount(handle, static_cast<uint16_t>(m_filteringSampleCount));
             dirLightFP->SetGroundHeight(handle, 0.f);
 
             m_directionalLightHandle = handle;
@@ -363,7 +363,7 @@ namespace AtomSampleViewer
                 ImGui::RadioButton("4", &m_cascadeCount, 4);
             if (cascadesChanged)
             {
-                m_directionalLightFeatureProcessor->SetCascadeCount(m_directionalLightHandle, m_cascadeCount);
+                m_directionalLightFeatureProcessor->SetCascadeCount(m_directionalLightHandle, static_cast<uint16_t>(m_cascadeCount));
             }
 
             ImGui::Spacing();
@@ -407,11 +407,11 @@ namespace AtomSampleViewer
             ImGui::Text("Filtering (PCF specific)");
             if (ImGui::SliderInt("Prediction #", &m_predictionSampleCount, 4, 16))
             {
-                m_directionalLightFeatureProcessor->SetPredictionSampleCount(m_directionalLightHandle, m_predictionSampleCount);
+                m_directionalLightFeatureProcessor->SetPredictionSampleCount(m_directionalLightHandle, static_cast<uint16_t>(m_predictionSampleCount));
             }
             if (ImGui::SliderInt("Filtering #", &m_filteringSampleCount, 4, 64))
             {
-                m_directionalLightFeatureProcessor->SetFilteringSampleCount(m_directionalLightHandle, m_filteringSampleCount);
+                m_directionalLightFeatureProcessor->SetFilteringSampleCount(m_directionalLightHandle, static_cast<uint16_t>(m_filteringSampleCount));
             }
         }
         ImGui::Unindent();
@@ -424,7 +424,7 @@ namespace AtomSampleViewer
             int diskLightCount = m_diskLightCount;
             if (ImGui::SliderInt("Number", &diskLightCount, 0, DiskLightCountMax))
             {
-                UpdateDiskLightCount(diskLightCount);
+                UpdateDiskLightCount(static_cast<uint16_t>(diskLightCount));
             }
 
             if (ImGui::SliderFloat("Intensity##disk", &m_diskLightIntensity, 0.f, 100000.f, "%.1f", ImGuiSliderFlags_Logarithmic))

+ 1 - 1
Gem/Code/Source/MSAA_RPI_ExampleComponent.cpp

@@ -125,7 +125,7 @@ namespace AtomSampleViewer
         pipelineDesc.m_mainViewTagName = "MainCamera";
         pipelineDesc.m_name = "MSAA";
         pipelineDesc.m_rootPassTemplate = "MainPipeline";
-        pipelineDesc.m_renderSettings.m_multisampleState.m_samples = m_numSamples;
+        pipelineDesc.m_renderSettings.m_multisampleState.m_samples = static_cast<uint16_t>(m_numSamples);
         m_samplePipeline = AZ::RPI::RenderPipeline::CreateRenderPipelineForWindow(pipelineDesc, *m_windowContext);
 
         // add the sample pipeline to the scene

+ 1 - 1
Gem/Code/Source/MeshExampleComponent.cpp

@@ -273,7 +273,7 @@ namespace AtomSampleViewer
                         AZStd::string name = AZStd::string::format(LodFormatString, i);
                         if (ScriptableImGui::Selectable(name.c_str(), m_lodOverride == i))
                         {
-                            m_lodOverride = i;
+                            m_lodOverride = static_cast<AZ::RPI::Cullable::LodOverride>(i);
                             GetMeshFeatureProcessor()->SetLodOverride(m_meshHandle, m_lodOverride);
                         }
                     }

+ 1 - 1
Gem/Code/Source/ProceduralSkinnedMesh.cpp

@@ -213,7 +213,7 @@ namespace AtomSampleViewer
             // If there are no more in one direction, we'll just keep taking them from the other direction
             enum class BoneSelectionMethod { TakeClosest, TakeFarthest, TakeOnly };
             // If there is only one valid direction to start with, use TakeOnly. Otherwise, use TakeClosest
-            BoneSelectionMethod currentBoneSelectionMethod = boneIndexBelow < 0 || boneIndexAbove == m_boneCount ? BoneSelectionMethod::TakeOnly : BoneSelectionMethod::TakeClosest;
+            BoneSelectionMethod currentBoneSelectionMethod = boneIndexBelow < 0 || boneIndexAbove == static_cast<int>(m_boneCount) ? BoneSelectionMethod::TakeOnly : BoneSelectionMethod::TakeClosest;
 
             // Assume that we won't get into a state where there are no bones above and no bones below before we've finished
             AZ_Assert(m_influencesPerVertex <= m_boneCount && m_influencesPerVertex <= maxInfluencesPerVertex, "SkinnedMeshExampleComponent - m_influencesPerVertex was incorrectly clamped.");

+ 2 - 2
Gem/Code/Source/RHI/AlphaToCoverageExampleComponent.cpp

@@ -393,7 +393,7 @@ namespace AtomSampleViewer
                 RHI::DrawItem drawItem;
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_pipelineStates[typeIndex].get();
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
 
                 const RHI::IndexBufferView indexBufferView =
@@ -406,7 +406,7 @@ namespace AtomSampleViewer
                 drawItem.m_indexBufferView = &indexBufferView;
 
                 AZStd::array<AZ::RHI::StreamBufferView, 2>& streamBufferViews = m_rectangleStreamBufferViews;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(streamBufferViews.size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(streamBufferViews.size());
                 drawItem.m_streamBufferViews = streamBufferViews.data();
 
                 // Submit the rectangle draw item.

+ 12 - 12
Gem/Code/Source/RHI/AsyncComputeExampleComponent.cpp

@@ -814,9 +814,9 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_copyTexturePipelineState.get();
                 drawItem.m_indexBufferView = &m_quadIndexBufferView;
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_quadStreamBufferViews[CopyTextureScope].size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_quadStreamBufferViews[CopyTextureScope].size());
                 drawItem.m_streamBufferViews = m_quadStreamBufferViews[CopyTextureScope].data();
                 commandList->Submit(drawItem);
             }
@@ -879,9 +879,9 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_terrainPipelineStates[ShadowScope].get();
                 drawItem.m_indexBufferView = &m_quadIndexBufferView;
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_quadStreamBufferViews[ShadowScope].size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_quadStreamBufferViews[ShadowScope].size());
                 drawItem.m_streamBufferViews = m_quadStreamBufferViews[ShadowScope].data();
                 commandList->Submit(drawItem);
             }
@@ -896,9 +896,9 @@ namespace AtomSampleViewer
                     drawItem.m_arguments = mesh.m_drawArguments;
                     drawItem.m_pipelineState = m_modelPipelineStates[ShadowScope].get();
                     drawItem.m_indexBufferView = &mesh.m_indexBufferView;
-                    drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                    drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                     drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                    drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_modelStreamBufferViews[ShadowScope].size());
+                    drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_modelStreamBufferViews[ShadowScope].size());
                     drawItem.m_streamBufferViews = m_modelStreamBufferViews[ShadowScope].data();
 
                     commandList->Submit(drawItem);
@@ -994,9 +994,9 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_terrainPipelineStates[ForwardScope].get();
                 drawItem.m_indexBufferView = &m_quadIndexBufferView;
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_quadStreamBufferViews[ForwardScope].size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_quadStreamBufferViews[ForwardScope].size());
                 drawItem.m_streamBufferViews = m_quadStreamBufferViews[ForwardScope].data();
 
                 commandList->Submit(drawItem);
@@ -1017,9 +1017,9 @@ namespace AtomSampleViewer
                     drawItem.m_arguments = mesh.m_drawArguments;
                     drawItem.m_pipelineState = m_modelPipelineStates[ForwardScope].get();
                     drawItem.m_indexBufferView = &mesh.m_indexBufferView;
-                    drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                    drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                     drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                    drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_modelStreamBufferViews[ForwardScope].size());
+                    drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_modelStreamBufferViews[ForwardScope].size());
                     drawItem.m_streamBufferViews = m_modelStreamBufferViews[ForwardScope].data();
 
                     commandList->Submit(drawItem);
@@ -1167,9 +1167,9 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_luminancePipelineState.get();
                 drawItem.m_indexBufferView = &m_quadIndexBufferView;
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_quadStreamBufferViews[LuminanceMapScope].size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_quadStreamBufferViews[LuminanceMapScope].size());
                 drawItem.m_streamBufferViews = m_quadStreamBufferViews[LuminanceMapScope].data();
                 commandList->Submit(drawItem);
             }

+ 1 - 1
Gem/Code/Source/RHI/BasicRHIComponent.cpp

@@ -334,7 +334,7 @@ namespace AtomSampleViewer
     {
         for (int i = 0; i < bufferSize; ++i)
         {
-            indexBuffer[i] = i;
+            indexBuffer[i] = static_cast<uint16_t>(i);
         }
     }
 

+ 2 - 2
Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp

@@ -578,9 +578,9 @@ namespace AtomSampleViewer
                     drawItem.m_arguments = subMesh.m_mesh->m_drawArguments;
                     drawItem.m_pipelineState = m_pipelineState.get();
                     drawItem.m_indexBufferView = &subMesh.m_mesh->m_indexBufferView;
-                    drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                    drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                     drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                    drawItem.m_streamBufferViewCount = static_cast<uint32_t>(subMesh.bufferStreamViewArray.size());
+                    drawItem.m_streamBufferViewCount = static_cast<uint8_t>(subMesh.bufferStreamViewArray.size());
                     drawItem.m_streamBufferViews = subMesh.bufferStreamViewArray.data();
 
                     // Submit the triangle draw item.

+ 2 - 2
Gem/Code/Source/RHI/ComputeExampleComponent.cpp

@@ -404,9 +404,9 @@ namespace AtomSampleViewer
             drawItem.m_arguments = drawIndexed;
             drawItem.m_pipelineState = m_drawPipelineState.get();
             drawItem.m_indexBufferView = &m_indexBufferView;
-            drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+            drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
             drawItem.m_streamBufferViews = m_streamBufferViews.data();
-            drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+            drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
             drawItem.m_shaderResourceGroups = shaderResourceGroups;
 
             // Submit the triangle draw item.

+ 2 - 2
Gem/Code/Source/RHI/CopyQueueComponent.cpp

@@ -246,9 +246,9 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_pipelineState.get();
                 drawItem.m_indexBufferView = &indexBufferView;
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
                 drawItem.m_streamBufferViews = m_streamBufferViews.data();
 
                 commandList->Submit(drawItem);

+ 2 - 2
Gem/Code/Source/RHI/DualSourceBlendingComponent.cpp

@@ -210,9 +210,9 @@ namespace AtomSampleViewer
             drawItem.m_arguments = drawIndexed;
             drawItem.m_pipelineState = m_pipelineState.get();
             drawItem.m_indexBufferView = &m_indexBufferView;
-            drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+            drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
             drawItem.m_streamBufferViews = m_streamBufferViews.data();
-            drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+            drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
             drawItem.m_shaderResourceGroups = shaderResourceGroups;
 
             // Submit the triangle draw item.

+ 2 - 2
Gem/Code/Source/RHI/IndirectRenderingExampleComponent.cpp

@@ -740,7 +740,7 @@ namespace AtomSampleViewer
 
             dispatchItem.m_arguments = dispatchArgs;
             dispatchItem.m_pipelineState = m_cullPipelineState.get();
-            dispatchItem.m_shaderResourceGroupCount = numSrgs;
+            dispatchItem.m_shaderResourceGroupCount = static_cast<uint8_t>(numSrgs);
 
             commandList->Submit(dispatchItem);
         };
@@ -845,7 +845,7 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = m_drawIndirect;
                 drawItem.m_pipelineState = m_drawPipelineState.get();
                 drawItem.m_indexBufferView = &m_indexBufferViews[0];
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
                 drawItem.m_streamBufferViewCount = 2;
                 drawItem.m_streamBufferViews = m_streamBufferViews.data();

+ 1 - 1
Gem/Code/Source/RHI/InputAssemblyExampleComponent.cpp

@@ -69,7 +69,7 @@ namespace AtomSampleViewer
                 frameGraphBuilder.GetAttachmentDatabase().ImportBuffer(AZ::Name{ InputAssembly::ImportedInputAssemblyBufferAttachmentId }, m_inputAssemblyBuffer);
             }
 
-            float aspectRatio = m_outputWidth / m_outputHeight;
+            float aspectRatio = static_cast<float>(m_outputWidth / m_outputHeight);
             AZ::Vector2 scale(AZStd::min(1.0f / aspectRatio, 1.0f), AZStd::min(aspectRatio, 1.0f));
             {
                 AZ::Matrix4x4 scaleTranslate =

+ 4 - 4
Gem/Code/Source/RHI/MRTExampleComponent.cpp

@@ -298,9 +298,9 @@ namespace AtomSampleViewer
             drawItem.m_arguments = drawIndexed;
             drawItem.m_pipelineState = m_pipelineStates[0].get();
             drawItem.m_indexBufferView = &m_indexBufferView;
-            drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+            drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
             drawItem.m_shaderResourceGroups = shaderResourceGroups;
-            drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+            drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
             drawItem.m_streamBufferViews = m_streamBufferViews.data();
 
             commandList->Submit(drawItem);
@@ -374,9 +374,9 @@ namespace AtomSampleViewer
             drawItem.m_arguments = drawIndexed;
             drawItem.m_pipelineState = m_pipelineStates[1].get();
             drawItem.m_indexBufferView = &m_indexBufferView;
-            drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+            drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
             drawItem.m_shaderResourceGroups = shaderResourceGroups;
-            drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+            drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
             drawItem.m_streamBufferViews = m_streamBufferViews.data();
 
             commandList->Submit(drawItem);

+ 6 - 6
Gem/Code/Source/RHI/MSAAExampleComponent.cpp

@@ -263,7 +263,7 @@ namespace AtomSampleViewer
         [[maybe_unused]] RHI::ResultCode result = attachmentsBuilder.End(pipelineStateDescriptor.m_renderAttachmentConfiguration.m_renderAttachmentLayout);
         AZ_Assert(result == RHI::ResultCode::Success, "Failed to create render attachment layout");
 
-        pipelineStateDescriptor.m_renderStates.m_multisampleState.m_samples = properties.m_samplesCount;
+        pipelineStateDescriptor.m_renderStates.m_multisampleState.m_samples = static_cast<uint16_t>(properties.m_samplesCount);
         auto& customPositionList = pipelineStateDescriptor.m_renderStates.m_multisampleState.m_customPositions;
         AZStd::copy(properties.m_customPositions.begin(), properties.m_customPositions.end(), customPositionList.begin());
         pipelineStateDescriptor.m_renderStates.m_multisampleState.m_customPositionsCount = static_cast<uint32_t>(properties.m_customPositions.size());
@@ -300,7 +300,7 @@ namespace AtomSampleViewer
                         m_outputWidth,
                         m_outputHeight,
                         m_outputFormat);
-                    imageDesc.m_multisampleState = RHI::MultisampleState(m_sampleProperties[msaaTypeIndex].m_samplesCount, 0);
+                    imageDesc.m_multisampleState = RHI::MultisampleState(static_cast<uint16_t>(m_sampleProperties[msaaTypeIndex].m_samplesCount), 0);
                     if(m_sampleProperties[msaaTypeIndex].m_customPositions.size()>0)
                     {
                         imageDesc.m_multisampleState.m_customPositionsCount = static_cast<uint32_t>(m_sampleProperties[msaaTypeIndex].m_customPositions.size());
@@ -357,9 +357,9 @@ namespace AtomSampleViewer
             drawItem.m_arguments = drawIndexed;
             drawItem.m_pipelineState = m_pipelineStates[msaaTypeIndex].get();
             drawItem.m_indexBufferView = &indexBufferView;
-            drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+            drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
             drawItem.m_shaderResourceGroups = shaderResourceGroups;
-            drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_triangleStreamBufferViews.size());
+            drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_triangleStreamBufferViews.size());
             drawItem.m_streamBufferViews = m_triangleStreamBufferViews.data();
 
             // Submit the triangle draw item.
@@ -470,9 +470,9 @@ namespace AtomSampleViewer
             drawItem.m_arguments = drawIndexed;
             drawItem.m_pipelineState = m_customResolveMSAAPipelineState.get();
             drawItem.m_indexBufferView = &indexBufferView;
-            drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+            drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
             drawItem.m_shaderResourceGroups = shaderResourceGroups;
-            drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_quadStreamBufferViews.size());
+            drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_quadStreamBufferViews.size());
             drawItem.m_streamBufferViews = m_quadStreamBufferViews.data();
 
             // Submit the triangle draw item.

+ 2 - 2
Gem/Code/Source/RHI/MultiThreadComponent.cpp

@@ -340,9 +340,9 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_pipelineState.get();
                 drawItem.m_indexBufferView = &m_indexBufferView;
-                drawItem.m_shaderResourceGroupCount = AZ::RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(AZ::RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
                 drawItem.m_streamBufferViews = m_streamBufferViews.data();
 
                 commandList->Submit(drawItem);

+ 4 - 4
Gem/Code/Source/RHI/MultipleViewsComponent.cpp

@@ -426,9 +426,9 @@ namespace AtomSampleViewer
             drawItem.m_arguments = drawIndexed;
             drawItem.m_pipelineState = m_pipelineStates[0].get();
             drawItem.m_indexBufferView = &m_indexBufferView;
-            drawItem.m_shaderResourceGroupCount = AZ::RHI::ArraySize(shaderResourceGroups);
+            drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(AZ::RHI::ArraySize(shaderResourceGroups));
             drawItem.m_shaderResourceGroups = shaderResourceGroups;
-            drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+            drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
             drawItem.m_streamBufferViews = m_streamBufferViews.data();
 
             commandList->Submit(drawItem);
@@ -515,9 +515,9 @@ namespace AtomSampleViewer
             drawItem.m_arguments = drawIndexed;
             drawItem.m_pipelineState = m_pipelineStates[1].get();
             drawItem.m_indexBufferView = &m_indexBufferView;
-            drawItem.m_shaderResourceGroupCount = AZ::RHI::ArraySize(shaderResourceGroups);
+            drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(AZ::RHI::ArraySize(shaderResourceGroups));
             drawItem.m_shaderResourceGroups = shaderResourceGroups;
-            drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+            drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
             drawItem.m_streamBufferViews = m_streamBufferViews.data();
 
             commandList->Submit(drawItem);

+ 1 - 1
Gem/Code/Source/RHI/QueryExampleComponent.cpp

@@ -448,7 +448,7 @@ namespace AtomSampleViewer
                 drawItem.m_indexBufferView = &quadIndexBufferView;
                 drawItem.m_streamBufferViewCount = 1;
                 drawItem.m_streamBufferViews = &m_quadStreamBufferView;
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
 
                 // Draw possibly occluded quad

+ 2 - 2
Gem/Code/Source/RHI/RayTracingExampleComponent.cpp

@@ -678,9 +678,9 @@ namespace AtomSampleViewer
             drawItem.m_arguments = drawIndexed;
             drawItem.m_pipelineState = m_drawPipelineState.get();
             drawItem.m_indexBufferView = &m_fullScreenIndexBufferView;
-            drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_fullScreenStreamBufferViews.size());
+            drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_fullScreenStreamBufferViews.size());
             drawItem.m_streamBufferViews = m_fullScreenStreamBufferViews.data();
-            drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+            drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
             drawItem.m_shaderResourceGroups = shaderResourceGroups;
 
             // submit the triangle draw item.

+ 2 - 2
Gem/Code/Source/RHI/SphericalHarmonicsExampleComponent.cpp

@@ -332,9 +332,9 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_mode ? m_demoPipelineState.get() : m_renderPipelineState.get();
                 drawItem.m_indexBufferView = &indexBufferView;
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
                 drawItem.m_streamBufferViews = m_streamBufferViews.data();
 
                 commandList->Submit(drawItem);

+ 1 - 1
Gem/Code/Source/RHI/StencilExampleComponent.cpp

@@ -220,7 +220,7 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_pipelineStateBasePass.get();
                 drawItem.m_indexBufferView = &indexBufferView;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
                 drawItem.m_streamBufferViews = m_streamBufferViews.data();
                 commandList->Submit(drawItem);
 

+ 3 - 3
Gem/Code/Source/RHI/SubpassExampleComponent.cpp

@@ -412,9 +412,9 @@ namespace AtomSampleViewer
                     drawItem.m_arguments = mesh.m_drawArguments;
                     drawItem.m_pipelineState = modelData.m_pipelineState.get();
                     drawItem.m_indexBufferView = &mesh.m_indexBufferView;
-                    drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                    drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                     drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                    drawItem.m_streamBufferViewCount = static_cast<uint32_t>(modelData.m_streamBufferList.size());
+                    drawItem.m_streamBufferViewCount = static_cast<uint8_t>(modelData.m_streamBufferList.size());
                     drawItem.m_streamBufferViews = modelData.m_streamBufferList.data();
 
                     commandList->Submit(drawItem);
@@ -526,7 +526,7 @@ namespace AtomSampleViewer
             drawItem.m_arguments = RHI::DrawArguments(drawArguments);
             drawItem.m_pipelineState = m_compositionPipeline.get();
             drawItem.m_indexBufferView = nullptr;
-            drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+            drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
             drawItem.m_shaderResourceGroups = shaderResourceGroups;
             drawItem.m_streamBufferViewCount = 0;
             drawItem.m_streamBufferViews = nullptr;

+ 1 - 1
Gem/Code/Source/RHI/Texture3dExampleComponent.cpp

@@ -227,7 +227,7 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_pipelineState.get();
                 drawItem.m_indexBufferView = nullptr;
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
                 drawItem.m_streamBufferViewCount = 0;
                 drawItem.m_streamBufferViews = nullptr;

+ 2 - 2
Gem/Code/Source/RHI/TextureArrayExampleComponent.cpp

@@ -224,9 +224,9 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_pipelineState.get();
                 drawItem.m_indexBufferView = &indexBufferView;
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_rectangleStreamBufferViews.size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_rectangleStreamBufferViews.size());
                 drawItem.m_streamBufferViews = m_rectangleStreamBufferViews.data();
 
                 // Submit the triangle draw item.

+ 2 - 2
Gem/Code/Source/RHI/TextureExampleComponent.cpp

@@ -244,9 +244,9 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_pipelineState.get();
                 drawItem.m_indexBufferView = &indexBufferView;
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
                 drawItem.m_streamBufferViews = m_streamBufferViews.data();
 
                 commandList->Submit(drawItem);

+ 5 - 5
Gem/Code/Source/RHI/TextureMapExampleComponent.cpp

@@ -521,9 +521,9 @@ namespace AtomSampleViewer
             drawItem.m_arguments = drawIndexed;
             drawItem.m_pipelineState = m_targetPipelineStates[target].get();
             drawItem.m_indexBufferView = &m_bufferViews[RenderTargetIndex::BufferViewIndex].m_indexBufferView;
-            drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_bufferViews[RenderTargetIndex::BufferViewIndex].m_streamBufferViews.size());
+            drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_bufferViews[RenderTargetIndex::BufferViewIndex].m_streamBufferViews.size());
             drawItem.m_streamBufferViews = m_bufferViews[RenderTargetIndex::BufferViewIndex].m_streamBufferViews.data();
-            drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+            drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
             drawItem.m_shaderResourceGroups = shaderResourceGroups;
 
             // Submit the triangle draw item.
@@ -598,9 +598,9 @@ namespace AtomSampleViewer
             drawItem.m_arguments = drawIndexed;
             drawItem.m_pipelineState = m_screenPipelineStates[target].get();
             drawItem.m_indexBufferView = &m_bufferViews[target].m_indexBufferView;
-            drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_bufferViews[target].m_streamBufferViews.size());
+            drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_bufferViews[target].m_streamBufferViews.size());
             drawItem.m_streamBufferViews = m_bufferViews[target].m_streamBufferViews.data();
-            drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+            drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
             drawItem.m_shaderResourceGroups = shaderResourceGroups;
 
             // Submit the triangle draw item.
@@ -633,7 +633,7 @@ namespace AtomSampleViewer
 
     void TextureMapExampleComponent::SetVertexIndexRectsCounterClock(uint16_t* indexBuffer, size_t arraySize)
     {
-        int vertices = 0;
+        uint16_t vertices = 0;
         for (int i = 0; i < arraySize; i += 6)
         {
             indexBuffer[i + 0] = vertices + 0;

+ 2 - 2
Gem/Code/Source/RHI/TriangleExampleComponent.cpp

@@ -214,9 +214,9 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_pipelineState.get();
                 drawItem.m_indexBufferView = &indexBufferView;
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
                 drawItem.m_streamBufferViews = m_streamBufferViews.data();
 
                 // Submit the triangle draw item.

+ 2 - 2
Gem/Code/Source/RHI/TrianglesConstantBufferExampleComponent.cpp

@@ -372,9 +372,9 @@ namespace AtomSampleViewer
                 drawItem.m_arguments = drawIndexed;
                 drawItem.m_pipelineState = m_pipelineState.get();
                 drawItem.m_indexBufferView = &m_indexBufferView;
-                drawItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups);
+                drawItem.m_shaderResourceGroupCount = static_cast<uint8_t>(RHI::ArraySize(shaderResourceGroups));
                 drawItem.m_shaderResourceGroups = shaderResourceGroups;
-                drawItem.m_streamBufferViewCount = static_cast<uint32_t>(m_streamBufferViews.size());
+                drawItem.m_streamBufferViewCount = static_cast<uint8_t>(m_streamBufferViews.size());
                 drawItem.m_streamBufferViews = m_streamBufferViews.data();
 
                 // Submit the triangle draw item.

+ 1 - 1
Gem/Code/Source/SampleComponentManager.cpp

@@ -1511,7 +1511,7 @@ namespace AtomSampleViewer
 
         // set pipeline MSAA samples
         AZ_Assert(IsValidNumMSAASamples(m_numMSAASamples), "Invalid MSAA sample setting");
-        pipelineDesc.m_renderSettings.m_multisampleState.m_samples = m_numMSAASamples;
+        pipelineDesc.m_renderSettings.m_multisampleState.m_samples = static_cast<uint16_t>(m_numMSAASamples);
         bool isNonMsaaPipeline = (pipelineDesc.m_renderSettings.m_multisampleState.m_samples == 1);
         const char* supervariantName = isNonMsaaPipeline ? AZ::RPI::NoMsaaSupervariantName : "";
         AZ::RPI::ShaderSystemInterface::Get()->SetSupervariantName(AZ::Name(supervariantName));

+ 10 - 10
Gem/Code/Source/ShadowExampleComponent.cpp

@@ -411,13 +411,13 @@ namespace AtomSampleViewer
         featureProcessor->SetRgbIntensity(handle, lightColor);
         featureProcessor->SetShadowmapSize(handle, s_shadowmapImageSizes[m_directionalLightImageSizeIndex]);
         featureProcessor->SetShadowFarClipDistance(handle, FarClipDistance);
-        featureProcessor->SetCascadeCount(handle, m_cascadeCount);
+        featureProcessor->SetCascadeCount(handle, static_cast<uint16_t>(m_cascadeCount));
         featureProcessor->SetShadowmapFrustumSplitSchemeRatio(handle, m_ratioLogarithmUniform);
         featureProcessor->SetViewFrustumCorrectionEnabled(handle, m_isCascadeCorrectionEnabled);
         featureProcessor->SetShadowFilterMethod(handle, s_shadowFilterMethods[m_shadowFilterMethodIndexDirectional]);
         featureProcessor->SetShadowBoundaryWidth(handle, m_boundaryWidthDirectional);
-        featureProcessor->SetPredictionSampleCount(handle, m_predictionSampleCountDirectional);
-        featureProcessor->SetFilteringSampleCount(handle, m_filteringSampleCountDirectional);
+        featureProcessor->SetPredictionSampleCount(handle, static_cast<uint16_t>(m_predictionSampleCountDirectional));
+        featureProcessor->SetFilteringSampleCount(handle, static_cast<uint16_t>(m_filteringSampleCountDirectional));
         featureProcessor->SetGroundHeight(handle, 0.f);
 
         m_directionalLightHandle = handle;
@@ -528,7 +528,7 @@ namespace AtomSampleViewer
             cascadesChanged = cascadesChanged || ScriptableImGui::RadioButton("4", &m_cascadeCount, 4);
             if (cascadesChanged)
             {
-                m_directionalLightFeatureProcessor->SetCascadeCount(m_directionalLightHandle, m_cascadeCount);
+                m_directionalLightFeatureProcessor->SetCascadeCount(m_directionalLightHandle, static_cast<uint16_t>(m_cascadeCount));
             }
 
             ImGui::Spacing();
@@ -590,12 +590,12 @@ namespace AtomSampleViewer
                 if (ScriptableImGui::SliderInt("Prediction # ##Directional", &m_predictionSampleCountDirectional, 4, 16))
                 {
                     m_directionalLightFeatureProcessor->SetPredictionSampleCount(
-                        m_directionalLightHandle, m_predictionSampleCountDirectional);
+                        m_directionalLightHandle, static_cast<uint16_t>(m_predictionSampleCountDirectional));
                 }
                 if (ScriptableImGui::SliderInt("Filtering # ##Directional", &m_filteringSampleCountDirectional, 4, 64))
                 {
                     m_directionalLightFeatureProcessor->SetFilteringSampleCount(
-                        m_directionalLightHandle, m_filteringSampleCountDirectional);
+                        m_directionalLightHandle, static_cast<uint16_t>(m_filteringSampleCountDirectional));
                 }
             }
 
@@ -820,8 +820,8 @@ namespace AtomSampleViewer
                         lightHandle, s_shadowFilterMethods[m_shadowFilterMethodIndicesPositional[index]]);
 
                     m_diskLightFeatureProcessor->SetSofteningBoundaryWidthAngle(lightHandle, AZ::DegToRad(m_boundaryWidthsPositional[index]));
-                    m_diskLightFeatureProcessor->SetFilteringSampleCount(lightHandle, m_filteringSampleCountsPositional[index]);
-                    m_diskLightFeatureProcessor->SetPredictionSampleCount(lightHandle, m_predictionSampleCountsPositional[index]);
+                    m_diskLightFeatureProcessor->SetFilteringSampleCount(lightHandle, static_cast<uint16_t>(m_filteringSampleCountsPositional[index]));
+                    m_diskLightFeatureProcessor->SetPredictionSampleCount(lightHandle, static_cast<uint16_t>(m_predictionSampleCountsPositional[index]));
                     m_diskLightFeatureProcessor->SetPcfMethod(lightHandle, m_pcfMethod[index]);
                 }
             }
@@ -852,8 +852,8 @@ namespace AtomSampleViewer
                         lightHandle, s_shadowFilterMethods[m_shadowFilterMethodIndicesPositional[index]]);
 
                     m_pointLightFeatureProcessor->SetPcfMethod(lightHandle, m_pcfMethod[index]);
-                    m_pointLightFeatureProcessor->SetFilteringSampleCount(lightHandle, m_filteringSampleCountsPositional[index]);
-                    m_pointLightFeatureProcessor->SetPredictionSampleCount(lightHandle, m_predictionSampleCountsPositional[index]);
+                    m_pointLightFeatureProcessor->SetFilteringSampleCount(lightHandle, static_cast<uint16_t>(m_filteringSampleCountsPositional[index]));
+                    m_pointLightFeatureProcessor->SetPredictionSampleCount(lightHandle, static_cast<uint16_t>(m_predictionSampleCountsPositional[index]));
                     m_pointLightFeatureProcessor->SetSofteningBoundaryWidthAngle(lightHandle, AZ::DegToRad(m_boundaryWidthsPositional[index]));
                 }
             }

+ 8 - 8
Gem/Code/Source/ShadowedSponzaExampleComponent.cpp

@@ -249,8 +249,8 @@ namespace AtomSampleViewer
             featureProcessor->SetViewFrustumCorrectionEnabled(handle, m_isCascadeCorrectionEnabled);
             featureProcessor->SetShadowFilterMethod(handle, s_shadowFilterMethods[m_shadowFilterMethodIndexDirectional]);
             featureProcessor->SetShadowBoundaryWidth(handle, m_boundaryWidthDirectional);
-            featureProcessor->SetPredictionSampleCount(handle, m_predictionSampleCountDirectional);
-            featureProcessor->SetFilteringSampleCount(handle, m_filteringSampleCountDirectional);
+            featureProcessor->SetPredictionSampleCount(handle, static_cast<uint16_t>(m_predictionSampleCountDirectional));
+            featureProcessor->SetFilteringSampleCount(handle, static_cast<uint16_t>(m_filteringSampleCountDirectional));
             featureProcessor->SetGroundHeight(handle, 0.f);
 
             m_directionalLightHandle = handle;
@@ -435,7 +435,7 @@ namespace AtomSampleViewer
             {
                 m_directionalLightFeatureProcessor->SetCascadeCount(
                     m_directionalLightHandle,
-                    m_cascadeCount);
+                    static_cast<uint16_t>(m_cascadeCount));
             }
 
             ImGui::Spacing();
@@ -516,13 +516,13 @@ namespace AtomSampleViewer
                 {
                     m_directionalLightFeatureProcessor->SetPredictionSampleCount(
                         m_directionalLightHandle,
-                        m_predictionSampleCountDirectional);
+                        static_cast<uint16_t>(m_predictionSampleCountDirectional));
                 }
                 if (ScriptableImGui::SliderInt("Filtering # ##Directional", &m_filteringSampleCountDirectional, 4, 64))
                 {
                     m_directionalLightFeatureProcessor->SetFilteringSampleCount(
                         m_directionalLightHandle,
-                        m_filteringSampleCountDirectional);
+                        static_cast<uint16_t>(m_filteringSampleCountDirectional));
                 }
             }
         }
@@ -536,7 +536,7 @@ namespace AtomSampleViewer
             int diskLightCount = m_diskLightCount;
             if (ScriptableImGui::SliderInt("Number", &diskLightCount, 0, DiskLightCountMax))
             {
-                UpdateDiskLightCount(diskLightCount);
+                UpdateDiskLightCount(static_cast<uint16_t>(diskLightCount));
             }
 
             if (ScriptableImGui::SliderFloat("Intensity##spot", &m_diskLightIntensity, 0.f, 100000.f, "%.1f", ImGuiSliderFlags_Logarithmic))
@@ -615,14 +615,14 @@ namespace AtomSampleViewer
                 {
                     for (int index = 0; index < m_diskLightCount; ++index)
                     {
-                        m_diskLightFeatureProcessor->SetPredictionSampleCount(m_diskLights[index].m_handle, m_predictionSampleCountDisk);
+                        m_diskLightFeatureProcessor->SetPredictionSampleCount(m_diskLights[index].m_handle, static_cast<uint16_t>(m_predictionSampleCountDisk));
                     }
                 }
                 if (ScriptableImGui::SliderInt("Filtering # ##Spot", &m_filteringSampleCountDisk, 4, 64))
                 {
                     for (int index = 0; index < m_diskLightCount; ++index)
                     {
-                        m_diskLightFeatureProcessor->SetFilteringSampleCount(m_diskLights[index].m_handle, m_filteringSampleCountDisk);
+                        m_diskLightFeatureProcessor->SetFilteringSampleCount(m_diskLights[index].m_handle, static_cast<uint16_t>(m_filteringSampleCountDisk));
                     }
                 }
             }

+ 1 - 1
Gem/Code/Source/TonemappingExampleComponent.cpp

@@ -166,7 +166,7 @@ namespace AtomSampleViewer
             s_colorSpaceLabels,
             AZ_ARRAY_SIZE(s_colorSpaceLabels)))
         {
-            m_inputColorSpace = GetColorSpaceIdForIndex(m_inputColorSpaceIndex);
+            m_inputColorSpace = GetColorSpaceIdForIndex(static_cast<uint8_t>(m_inputColorSpaceIndex));
             m_drawImage.m_srg->SetConstant<int>(m_colorSpaceIndex, static_cast<int>(m_inputColorSpace));
             m_drawImage.m_srg->Compile();
         }

+ 1 - 1
Gem/Code/Source/Utils/Utils.cpp

@@ -196,7 +196,7 @@ namespace AtomSampleViewer
             AZ::RHI::Format format = AZ::RHI::Format::R8G8B8A8_UNORM_SRGB;
             AZ::RHI::ImageBindFlags bindFlag = AZ::RHI::ImageBindFlags::ShaderRead;
 
-            AZ::RHI::ImageDescriptor imageDesc = AZ::RHI::ImageDescriptor::Create2DArray(bindFlag, width, height, arraySize, format);
+            AZ::RHI::ImageDescriptor imageDesc = AZ::RHI::ImageDescriptor::Create2DArray(bindFlag, width, height, static_cast<uint16_t>(arraySize), format);
             imageDesc.m_mipLevels = 1;
             imageDesc.m_isCubemap = true;