fixing Atom

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
monroegm-disable-blank-issue-2
pappeste 5 years ago committed by Esteban Papp
parent f6cdcddc52
commit 38fd7f0013

@ -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<uint8_t>(itr2->value.GetInt());
}
else if (name == "rows")
{
inputStructParams.m_variable.m_rows = itr2->value.GetInt();
inputStructParams.m_variable.m_rows = static_cast<uint8_t>(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<uint8_t>(itr2->value.GetInt());
}
else if (name == "semanticIndex")
{

@ -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<uint16_t>(1 + ring * numSections);
uint16_t firstVertOfNextRing = static_cast<uint16_t>(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<uint16_t>(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<uint16_t>(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<uint16_t>((numRings - 1) * numSections + 1);
uint16_t firstVertOfLastRing = static_cast<uint16_t>(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<uint16_t>(firstVertOfThisRing + nextSection));
indices.push_back(static_cast<uint16_t>(firstVertOfThisRing + section));
indices.push_back(static_cast<uint16_t>(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<uint16_t>(firstVertOfNextRing + section));
indices.push_back(static_cast<uint16_t>(firstVertOfNextRing + nextSection));
indices.push_back(static_cast<uint16_t>(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<uint16_t>(firstVertOfFirstRing + section));
indices.push_back(static_cast<uint16_t>(firstVertOfFirstRing + nextSection));
indices.push_back(static_cast<uint16_t>(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<uint16_t>(firstVertOfLastRing + nextSection));
indices.push_back(static_cast<uint16_t>(firstVertOfLastRing + section));
indices.push_back(static_cast<uint16_t>(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<uint16_t>(firstSection + section));
// Line from outer edge to next edge
meshData.m_lineIndices.push_back(firstSection + section);
meshData.m_lineIndices.push_back(static_cast<uint16_t>(firstSection + section));
uint32_t nextSection = (section + 1) % numSections;
meshData.m_lineIndices.push_back(firstSection + nextSection);
meshData.m_lineIndices.push_back(static_cast<uint16_t>(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<uint16_t>(firstSection + nextSection));
meshData.m_triangleIndices.push_back(static_cast<uint16_t>(firstSection + section));
}
else
{
meshData.m_triangleIndices.push_back(firstSection + section);
meshData.m_triangleIndices.push_back(firstSection + nextSection);
meshData.m_triangleIndices.push_back(static_cast<uint16_t>(firstSection + section));
meshData.m_triangleIndices.push_back(static_cast<uint16_t>(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<uint16_t>(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<uint16_t>(indexOfSidesStart + numRings * section));
indices.push_back(static_cast<uint16_t>(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<uint16_t>(indexOfSidesStart + numRings * nextSection + ring + 1));
indices.push_back(static_cast<uint16_t>(indexOfSidesStart + numRings * nextSection + ring));
indices.push_back(static_cast<uint16_t>(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<uint16_t>(indexOfSidesStart + numRings * section + ring));
indices.push_back(static_cast<uint16_t>(indexOfSidesStart + numRings * section + ring + 1));
indices.push_back(static_cast<uint16_t>(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<uint16_t>(indexOfConePoint));
indices.push_back(static_cast<uint16_t>(indexOfSidesStart + numRings * nextSection + numRings - 1));
indices.push_back(static_cast<uint16_t>(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<uint16_t>(2 * numSections + 2);
// build point indices
{

@ -126,7 +126,7 @@ namespace AZ
return;
}
SetCascadesCount(m_arraySize);
SetCascadesCount(static_cast<uint16_t>(m_arraySize));
const RHI::Size imageSize
{
aznumeric_cast<uint32_t>(m_shadowmapSize),

@ -225,7 +225,7 @@ namespace AZ
}
if (segmentsNeedUpdate)
{
UpdateViewsOfCascadeSegments(m_shadowingLightHandle, cascadeCount);
UpdateViewsOfCascadeSegments(m_shadowingLightHandle, static_cast<uint16_t>(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;

@ -147,7 +147,7 @@ namespace AZ
RPI::ImageMipChainAssetCreator assetCreator;
const uint32_t mipLevels = GetNumMipLevels();
assetCreator.Begin(Data::AssetId(AZ::Uuid::CreateRandom()), mipLevels, aznumeric_cast<uint16_t>(numTexturesToCreate));
assetCreator.Begin(Data::AssetId(AZ::Uuid::CreateRandom()), static_cast<uint16_t>(mipLevels), aznumeric_cast<uint16_t>(numTexturesToCreate));
for (uint32_t mipLevel = 0; mipLevel < mipLevels; ++mipLevel)
{

@ -72,9 +72,9 @@ namespace AZ
return;
}
m_dispatchArgs.m_threadsPerGroupX = AZStd::any_cast<int>(args[0]);
m_dispatchArgs.m_threadsPerGroupY = AZStd::any_cast<int>(args[1]);
m_dispatchArgs.m_threadsPerGroupZ = AZStd::any_cast<int>(args[2]);
m_dispatchArgs.m_threadsPerGroupX = static_cast<uint16_t>(AZStd::any_cast<int>(args[0]));
m_dispatchArgs.m_threadsPerGroupY = static_cast<uint16_t>(AZStd::any_cast<int>(args[1]));
m_dispatchArgs.m_threadsPerGroupZ = static_cast<uint16_t>(AZStd::any_cast<int>(args[2]));
}
}

@ -72,9 +72,9 @@ namespace AZ
return;
}
m_dispatchArgs.m_threadsPerGroupX = AZStd::any_cast<int>(args[0]);
m_dispatchArgs.m_threadsPerGroupY = AZStd::any_cast<int>(args[1]);
m_dispatchArgs.m_threadsPerGroupZ = AZStd::any_cast<int>(args[2]);
m_dispatchArgs.m_threadsPerGroupX = static_cast<uint16_t>(AZStd::any_cast<int>(args[0]));
m_dispatchArgs.m_threadsPerGroupY = static_cast<uint16_t>(AZStd::any_cast<int>(args[1]));
m_dispatchArgs.m_threadsPerGroupZ = static_cast<uint16_t>(AZStd::any_cast<int>(args[2]));
}
}

@ -85,9 +85,9 @@ namespace AZ
return;
}
dispatchArgs.m_threadsPerGroupX = AZStd::any_cast<int>(args[0]);
dispatchArgs.m_threadsPerGroupY = AZStd::any_cast<int>(args[1]);
dispatchArgs.m_threadsPerGroupZ = AZStd::any_cast<int>(args[2]);
dispatchArgs.m_threadsPerGroupX = static_cast<uint16_t>(AZStd::any_cast<int>(args[0]));
dispatchArgs.m_threadsPerGroupY = static_cast<uint16_t>(AZStd::any_cast<int>(args[1]));
dispatchArgs.m_threadsPerGroupZ = static_cast<uint16_t>(AZStd::any_cast<int>(args[2]));
}
}

@ -76,9 +76,9 @@ namespace AZ
return;
}
m_dispatchArgs.m_threadsPerGroupX = AZStd::any_cast<int>(args[0]);
m_dispatchArgs.m_threadsPerGroupY = AZStd::any_cast<int>(args[1]);
m_dispatchArgs.m_threadsPerGroupZ = AZStd::any_cast<int>(args[2]);
m_dispatchArgs.m_threadsPerGroupX = static_cast<uint16_t>(AZStd::any_cast<int>(args[0]));
m_dispatchArgs.m_threadsPerGroupY = static_cast<uint16_t>(AZStd::any_cast<int>(args[1]));
m_dispatchArgs.m_threadsPerGroupZ = static_cast<uint16_t>(AZStd::any_cast<int>(args[2]));
}
}

@ -76,9 +76,9 @@ namespace AZ
return;
}
m_dispatchArgs.m_threadsPerGroupX = AZStd::any_cast<int>(args[0]);
m_dispatchArgs.m_threadsPerGroupY = AZStd::any_cast<int>(args[1]);
m_dispatchArgs.m_threadsPerGroupZ = AZStd::any_cast<int>(args[2]);
m_dispatchArgs.m_threadsPerGroupX = static_cast<uint16_t>(AZStd::any_cast<int>(args[0]));
m_dispatchArgs.m_threadsPerGroupY = static_cast<uint16_t>(AZStd::any_cast<int>(args[1]));
m_dispatchArgs.m_threadsPerGroupZ = static_cast<uint16_t>(AZStd::any_cast<int>(args[2]));
}
}

@ -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<uint32_t>(params.m_viewportState.m_maxX - params.m_viewportState.m_minX);
m_viewportHeight = static_cast<uint32_t>(params.m_viewportState.m_maxY - params.m_viewportState.m_minY);
auto& io = ImGui::GetIO();
io.DisplaySize.x = AZStd::max<float>(1.0f, m_viewportWidth);
io.DisplaySize.y = AZStd::max<float>(1.0f, m_viewportHeight);
io.DisplaySize.x = AZStd::max<float>(1.0f, static_cast<float>(m_viewportWidth));
io.DisplaySize.y = AZStd::max<float>(1.0f, static_cast<float>(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<uint32_t>(drawCmd.ClipRect.z);
uint32_t scissorMaxY = static_cast<uint32_t>(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<int32_t>(drawCmd.ClipRect.x),
static_cast<int32_t>(drawCmd.ClipRect.y),
scissorMaxX,
scissorMaxY
)

@ -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<RHI::Buffer*>(streamBufferViews[0].GetBuffer())->GetDescriptor().m_byteCount;
uint32_t positionBufferByteCount = static_cast<uint32_t>(const_cast<RHI::Buffer*>(streamBufferViews[0].GetBuffer())->GetDescriptor().m_byteCount);
RHI::BufferViewDescriptor positionBufferDescriptor = RHI::BufferViewDescriptor::CreateRaw(0, positionBufferByteCount);
uint32_t normalBufferByteCount = const_cast<RHI::Buffer*>(streamBufferViews[1].GetBuffer())->GetDescriptor().m_byteCount;
uint32_t normalBufferByteCount = static_cast<uint32_t>(const_cast<RHI::Buffer*>(streamBufferViews[1].GetBuffer())->GetDescriptor().m_byteCount);
RHI::BufferViewDescriptor normalBufferDescriptor = RHI::BufferViewDescriptor::CreateRaw(0, normalBufferByteCount);
uint32_t tangentBufferByteCount = const_cast<RHI::Buffer*>(streamBufferViews[2].GetBuffer())->GetDescriptor().m_byteCount;
uint32_t tangentBufferByteCount = static_cast<uint32_t>(const_cast<RHI::Buffer*>(streamBufferViews[2].GetBuffer())->GetDescriptor().m_byteCount);
RHI::BufferViewDescriptor tangentBufferDescriptor = RHI::BufferViewDescriptor::CreateRaw(0, tangentBufferByteCount);
uint32_t bitangentBufferByteCount = const_cast<RHI::Buffer*>(streamBufferViews[3].GetBuffer())->GetDescriptor().m_byteCount;
uint32_t bitangentBufferByteCount = static_cast<uint32_t>(const_cast<RHI::Buffer*>(streamBufferViews[3].GetBuffer())->GetDescriptor().m_byteCount);
RHI::BufferViewDescriptor bitangentBufferDescriptor = RHI::BufferViewDescriptor::CreateRaw(0, bitangentBufferByteCount);
uint32_t uvBufferByteCount = const_cast<RHI::Buffer*>(streamBufferViews[4].GetBuffer())->GetDescriptor().m_byteCount;
uint32_t uvBufferByteCount = static_cast<uint32_t>(const_cast<RHI::Buffer*>(streamBufferViews[4].GetBuffer())->GetDescriptor().m_byteCount);
RHI::BufferViewDescriptor uvBufferDescriptor = RHI::BufferViewDescriptor::CreateRaw(0, uvBufferByteCount);
const RHI::IndexBufferView& indexBufferView = mesh.m_indexBufferView;

@ -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<int>() ? AZStd::any_cast<int>(args[0]) : 1;
arguments.m_threadsPerGroupY = args[1].type() == azrtti_typeid<int>() ? AZStd::any_cast<int>(args[1]) : 1;
arguments.m_threadsPerGroupZ = args[2].type() == azrtti_typeid<int>() ? AZStd::any_cast<int>(args[2]) : 1;
arguments.m_threadsPerGroupX = static_cast<uint16_t>(args[0].type() == azrtti_typeid<int>() ? AZStd::any_cast<int>(args[0]) : 1);
arguments.m_threadsPerGroupY = static_cast<uint16_t>(args[1].type() == azrtti_typeid<int>() ? AZStd::any_cast<int>(args[1]) : 1);
arguments.m_threadsPerGroupZ = static_cast<uint16_t>(args[2].type() == azrtti_typeid<int>() ? AZStd::any_cast<int>(args[2]) : 1);
}
arguments.m_totalNumberOfThreadsX = m_morphTargetMetaData.m_vertexCount;

@ -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<uint16_t>(mipLevel);
viewDesc.m_mipSliceMax = static_cast<uint16_t>(mipLevel);
inBinding.m_unifiedScopeDesc.SetAsImage(viewDesc);
pass->AddAttachmentBinding(inBinding);

@ -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<uint16_t>(mipLevel);
inViewDesc.m_mipSliceMax = static_cast<uint16_t>(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<uint16_t>(mipLevel - 1);
outViewDesc.m_mipSliceMax = static_cast<uint16_t>(mipLevel - 1);
outBinding.m_unifiedScopeDesc.SetAsImage(outViewDesc);
}

@ -47,7 +47,7 @@ namespace AZ
{
RPI::Ptr<RPI::PassAttachment> 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

@ -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();

@ -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<uint8_t>(stencilRef);
drawRequest.m_sortKey = m_sortKey;
drawPacketBuilder.AddDrawItem(drawRequest);

@ -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<float>(pow(2.0f, m_mipLevel)) : 1.0f;
m_updateSrg = true;
}

@ -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<int16_t>(mipLevel);
outputViewDesc.m_mipSliceMax = static_cast<int16_t>(mipLevel);
outputAttachmentBinding.m_unifiedScopeDesc.SetAsImage(outputViewDesc);
outputAttachmentBinding.SetAttachment(reflectionImageAttachment);

@ -205,9 +205,9 @@ namespace AZ
if (numThreads)
{
const auto& args = *numThreads;
arguments.m_threadsPerGroupX = args[0].type() == azrtti_typeid<int>() ? AZStd::any_cast<int>(args[0]) : 1;
arguments.m_threadsPerGroupY = args[1].type() == azrtti_typeid<int>() ? AZStd::any_cast<int>(args[1]) : 1;
arguments.m_threadsPerGroupZ = args[2].type() == azrtti_typeid<int>() ? AZStd::any_cast<int>(args[2]) : 1;
arguments.m_threadsPerGroupX = static_cast<uint16_t>(args[0].type() == azrtti_typeid<int>() ? AZStd::any_cast<int>(args[0]) : 1);
arguments.m_threadsPerGroupY = static_cast<uint16_t>(args[1].type() == azrtti_typeid<int>() ? AZStd::any_cast<int>(args[1]) : 1);
arguments.m_threadsPerGroupZ = static_cast<uint16_t>(args[2].type() == azrtti_typeid<int>() ? AZStd::any_cast<int>(args[2]) : 1);
}
arguments.m_totalNumberOfThreadsX = xThreads;

@ -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<int32_t>(allocation->GetVirtualAddress().m_ptr);
uint32_t deltaStreamSizeInBytes = static_cast<uint32_t>(vertexCount * MorphTargetConstants::s_unpackedMorphTargetDeltaSizeInBytes);
// Followed by normals, tangents, and bitangents

@ -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<uint16_t>((index % subresourcesPerAspect) / m_imageDescriptor.m_arraySize),
static_cast<uint16_t>((index % subresourcesPerAspect) % m_imageDescriptor.m_arraySize),
static_cast<ImageAspect>(index/ subresourcesPerAspect));
}

@ -320,7 +320,7 @@ namespace AZ
m_cachedTimeRegions.clear();
}
timeRegion.m_stackDepth = m_stackLevel;
timeRegion.m_stackDepth = static_cast<uint16_t>(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);

@ -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<uint16_t>(graphEdge.m_consumerIndex);
if (--m_graphNodes[consumerIndex].m_unsortedProducerCount == 0)
{
NodeId newNode;

@ -61,7 +61,7 @@ namespace AZ
imageStats->m_bindFlags = descriptor.m_bindFlags;
ImageSubresourceRange subresourceRange;
subresourceRange.m_mipSliceMin = GetResidentMipLevel();
subresourceRange.m_mipSliceMin = static_cast<uint16_t>(GetResidentMipLevel());
GetSubresourceLayouts(subresourceRange, nullptr, &imageStats->m_sizeInBytes);
}

@ -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;

@ -26,7 +26,7 @@ namespace AZ
BufferPoolDescriptor::BufferPoolDescriptor()
{
m_bufferPoolPageSizeInBytes = RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_bufferPoolPageSizeInBytes;
m_bufferPoolPageSizeInBytes = static_cast<uint32_t>(RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_bufferPoolPageSizeInBytes);
}
}
}

@ -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<uint32_t>(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<const DX12::BufferPoolDescriptor*>(&descriptorBase))

@ -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<uint8_t>(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<UINT8>(depthStencil.m_stencil.m_readMask);
desc.StencilWriteMask = static_cast<UINT8>(depthStencil.m_stencil.m_writeMask);
return desc;
}
}

@ -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<uint32_t>(RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_mediumStagingBufferPageSizeInBytes);
allocatorDesc.m_largePageSizeInBytes = static_cast<uint32_t>(RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_largestStagingBufferPageSizeInBytes);
allocatorDesc.m_collectLatency = descriptor.m_frameCountMax;
m_stagingMemoryAllocator.Init(allocatorDesc);
}

@ -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<uint8_t>(groupLayoutIndex);
m_indexToSlotTable[groupLayoutIndex] = static_cast<uint8_t>(srgLayoutSlot);
}
// Construct a list of indexes sorted by frequency.

@ -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<uint16_t>(imageDescriptor.m_mipLevels - residentMipLevel);
D3D12_RESOURCE_ALLOCATION_INFO allocationInfo;
GetDevice().GetImageAllocationInfo(residentImageDescriptor, allocationInfo);

@ -26,7 +26,7 @@ namespace AZ
BufferPoolDescriptor::BufferPoolDescriptor()
{
m_bufferPoolPageSizeInBytes = RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_bufferPoolPageSizeInBytes;
m_bufferPoolPageSizeInBytes = static_cast<uint32_t>(RHI::RHISystemInterface::Get()->GetPlatformLimitsDescriptor()->m_platformDefaultValues.m_bufferPoolPageSizeInBytes);
}
}
}

@ -173,7 +173,7 @@ namespace AZ
auto* image = static_cast<Image*>(request.m_image);
auto& device = static_cast<Device&>(GetDevice());
const uint16_t startMip = residentMip - 1;
const uint16_t startMip = static_cast<uint16_t>(residentMip - 1);
const uint16_t endMip = static_cast<uint16_t>(residentMip - request.m_mipSlices.size());
RHI::Ptr<Fence> 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<uint16_t>(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<uint16_t>(arraySlice);
copyDescriptor.m_destinationOrigin.m_left = 0;
copyDescriptor.m_destinationOrigin.m_top = 0;
copyDescriptor.m_destinationOrigin.m_front = depth;

@ -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<uint8_t>(targetBlendState.m_writeMask));
}
VkBlendFactor ConvertBlendFactor(const RHI::BlendFactor& blendFactor)

@ -117,8 +117,8 @@ namespace AZ
const auto& device = static_cast<const Device&>(GetDevice());
const auto& physicalDevice = static_cast<const PhysicalDevice&>(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<uint16_t>(imgDesc.m_size.m_width);
const uint16_t height = static_cast<uint16_t>(imgDesc.m_size.m_height);
const uint16_t depth = AZStd::min(static_cast<uint16_t>(imgViewDesc.m_depthSliceMax - imgViewDesc.m_depthSliceMin), static_cast<uint16_t>(imgDesc.m_size.m_depth - 1)) + 1;
const uint16_t samples = imgDesc.m_multisampleState.m_samples;
const uint16_t arrayLayers = AZStd::min(static_cast<uint16_t>(imgViewDesc.m_arraySliceMax - imgViewDesc.m_arraySliceMin), static_cast<uint16_t>(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<uint32_t>(descriptor.m_depthSliceMax, imageDesc.m_size.m_depth - 1);
range.m_arraySliceMax = AZStd::GetMin<uint16_t>(descriptor.m_depthSliceMax, static_cast<uint16_t>(imageDesc.m_size.m_depth - 1));
break;
}
case VK_IMAGE_VIEW_TYPE_3D:

@ -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<uint8_t>(bindingInfo.m_spaceId);
}
m_descriptorSetLayouts.reserve(srgCount);

@ -108,7 +108,7 @@ namespace AZ
WaitFinishUploading(image);
const uint16_t residentMipLevelBefore = image.GetResidentMipLevel();
const uint16_t residentMipLevelBefore = static_cast<uint16_t>(image.GetResidentMipLevel());
const uint16_t residentMipLevelAfter = residentMipLevelBefore - static_cast<uint16_t>(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<uint16_t>(targetMipLevel));
}
const VkMemoryRequirements memoryRequirements = GetMemoryRequirements(image.GetDescriptor(), targetMipLevel);
const uint16_t residentMipLevelBefore = image.GetResidentMipLevel();
const uint16_t residentMipLevelBefore = static_cast<uint16_t>(image.GetResidentMipLevel());
RHI::HeapMemoryUsage& memoryUsage = m_memoryUsage.GetHeapMemoryUsage(RHI::HeapMemoryLevel::Device);
const size_t imageSizeBefore = image.GetResidentSizeInBytes();
@ -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<uint16_t>(residentMipLevel);
return device.GetImageMemoryRequirements(imageDescriptor);
}

@ -247,7 +247,7 @@ namespace AZ
uint16_t StreamingImage::GetResidentMipLevel()
{
return m_image->GetResidentMipLevel();
return static_cast<uint16_t>(m_image->GetResidentMipLevel());
}
RHI::ResultCode StreamingImage::TrimToMipChainLevel(size_t mipChainIndex)

@ -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<uint8_t>(m_stencilRef);
}
void FullscreenTrianglePass::FrameBeginInternal(FramePrepareParams params)

@ -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<uint8_t>(bufferData.size());
for (uint8_t i = 0; i < bufferDataSize; ++i)
{
bufferData[i] = i;
}

@ -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<uint8_t>(bufferData.size());
for (uint8_t i = 0; i < bufferDataSize; ++i)
{
bufferData[i] = i;
}

@ -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<int16_t>(bufferA[i]) - aznumeric_cast<int16_t>(bufferB[i]));
const int16_t diffG = abs(aznumeric_cast<int16_t>(bufferA[i + 1]) - aznumeric_cast<int16_t>(bufferB[i + 1]));
const int16_t diffB = abs(aznumeric_cast<int16_t>(bufferA[i + 2]) - aznumeric_cast<int16_t>(bufferB[i + 2]));
const int16_t diffR = static_cast<int16_t>(abs(aznumeric_cast<int16_t>(bufferA[i]) - aznumeric_cast<int16_t>(bufferB[i])));
const int16_t diffG = static_cast<int16_t>(abs(aznumeric_cast<int16_t>(bufferA[i + 1]) - aznumeric_cast<int16_t>(bufferB[i + 1])));
const int16_t diffB = static_cast<int16_t>(abs(aznumeric_cast<int16_t>(bufferA[i + 2]) - aznumeric_cast<int16_t>(bufferB[i + 2])));
const int16_t maxDiff = AZ::GetMax(AZ::GetMax(diffR, diffG), diffB);
const float finalDiffNormalized = maxDiff / 255.0f;

Loading…
Cancel
Save