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 82ba53dee3
commit 97f9ac870d

@ -145,7 +145,7 @@ namespace AZ::Render
// individual point as its own element instead of each array being its own element. Since all
// the arrays are stored in a contiguous vector, we can treat it as one giant array.
const LightPosition* firstPosition = m_polygonLightData.GetDataVector<1>().at(0).data();
m_lightPolygonPointBufferHandler.UpdateBuffer(firstPosition, m_polygonLightData.GetDataCount() * MaxPolygonPoints);
m_lightPolygonPointBufferHandler.UpdateBuffer(firstPosition, static_cast<uint32_t>(m_polygonLightData.GetDataCount() * MaxPolygonPoints));
}
m_deviceBufferNeedsUpdate = false;
}

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

@ -162,7 +162,7 @@ namespace AZ
m_rootConstantData.SetConstant(colorOffsetIndex, m_morphInstanceMetaData.m_accumulatedColorDeltaOffsetInBytes / 4);
}
m_dispatchItem.m_rootConstantSize = m_rootConstantData.GetConstantData().size();
m_dispatchItem.m_rootConstantSize = static_cast<uint8_t>(m_rootConstantData.GetConstantData().size());
m_dispatchItem.m_rootConstants = m_rootConstantData.GetConstantData().data();
}

@ -497,7 +497,7 @@ namespace AZ::Render
const ShadowmapAtlas& atlas = m_projectedShadowmapsPasses.front()->GetShadowmapAtlas();
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.
for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses)
@ -564,7 +564,7 @@ namespace AZ::Render
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;
}
}

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

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

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

@ -356,7 +356,7 @@ namespace AZ
if (!bufferViews.empty())
{
group.m_unboundedDescriptorTables[tableIndex] = m_descriptorContext->CreateDescriptorTable(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, bufferViews.size());
group.m_unboundedDescriptorTables[tableIndex] = m_descriptorContext->CreateDescriptorTable(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, static_cast<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.");
ShaderResourceGroupCompiledData& compiledData = group.m_compiledData[group.m_compiledDataIndex];
@ -415,7 +415,7 @@ namespace AZ
if (!imageViews.empty())
{
group.m_unboundedDescriptorTables[tableIndex] = m_descriptorContext->CreateDescriptorTable(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, imageViews.size());
group.m_unboundedDescriptorTables[tableIndex] = m_descriptorContext->CreateDescriptorTable(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, static_cast<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.");
ShaderResourceGroupCompiledData& compiledData = group.m_compiledData[group.m_compiledDataIndex];

@ -163,9 +163,9 @@ namespace AZ
createInfo.sType = VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR;
createInfo.pNext = nullptr;
createInfo.flags = 0;
createInfo.stageCount = stages.size();
createInfo.stageCount = static_cast<uint32_t>(stages.size());
createInfo.pStages = stages.data();
createInfo.groupCount = groups.size();
createInfo.groupCount = static_cast<uint32_t>(groups.size());
createInfo.pGroups = groups.data();
createInfo.maxPipelineRayRecursionDepth = descriptor->GetConfiguration().m_maxRecursionDepth;
createInfo.layout = m_pipelineLayout;

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

@ -110,8 +110,8 @@ namespace AZ::RPI
{
AZ::Aabb meshAabb = AZ::Aabb::CreateNull();
const size_t numVertices = mesh.m_meshData->GetVertexCount();
for (size_t i = 0; i < numVertices; ++i)
const unsigned int numVertices = static_cast<unsigned int>(mesh.m_meshData->GetVertexCount());
for (unsigned int i = 0; i < numVertices; ++i)
{
meshAabb.AddPoint(mesh.m_meshData->GetPosition(i));
}
@ -164,7 +164,7 @@ namespace AZ::RPI
blendShapeName.c_str(), numVertices, sourceMesh.m_meshData->GetVertexCount());
// The start index is after any previously added deltas
metaData.m_startIndex = aznumeric_caster<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.

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

@ -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())));
lodCreator.SetMeshIndexBuffer({
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())));
lodCreator.AddMeshStreamBuffer(
AZ::RHI::ShaderSemantic(AZ::Name("POSITION")),
AZ::Name(),
{
positionBuffer,
AZ::RHI::BufferViewDescriptor::CreateStructured(0, positionCount / 3, sizeof(float) * 3)
AZ::RHI::BufferViewDescriptor::CreateStructured(0, static_cast<uint32_t>(positionCount / 3), sizeof(float) * 3)
}
);
}

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

Loading…
Cancel
Save