Merging from development

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-12-07 12:35:41 -08:00
parent b1eeebb6b6
commit cd5306febf
334 changed files with 9946 additions and 3757 deletions
@@ -1288,6 +1288,7 @@ namespace AZ
void Pass::FrameBegin(FramePrepareParams params)
{
AZ_PROFILE_SCOPE(RPI, "Pass::FrameBegin() - %s", m_path.GetCStr());
AZ_RPI_BREAK_ON_TARGET_PASS;
if (!IsEnabled())
@@ -1310,7 +1311,10 @@ namespace AZ
// FrameBeginInternal needs to be the last function be called in FrameBegin because its implementation expects
// all the attachments are imported to database (for example, ImageAttachmentPreview)
FrameBeginInternal(params);
{
AZ_PROFILE_SCOPE(RPI, "Pass::FrameBeginInternal()");
FrameBeginInternal(params);
}
// readback attachment with output state
UpdateReadbackAttachment(params, false);
@@ -146,6 +146,7 @@ namespace AZ
void RasterPass::UpdateDrawList()
{
AZ_PROFILE_SCOPE(RPI, "RasterPass::UpdateDrawList");
// DrawLists from dynamic draw
AZStd::vector<RHI::DrawListView> drawLists = DynamicDrawInterface::Get()->GetDrawListsForPass(this);
+14 -1
View File
@@ -19,6 +19,8 @@
#include <AzCore/Component/ComponentApplicationBus.h>
#include <AzCore/Math/MatrixUtils.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Jobs/JobCompletion.h>
#include <AzCore/Jobs/JobFunction.h>
#include <Atom_RPI_Traits_Platform.h>
#if AZ_TRAIT_MASKED_OCCLUSION_CULLING_SUPPORTED
@@ -260,15 +262,25 @@ namespace AZ
void View::SortFinalizedDrawLists()
{
AZ_PROFILE_SCOPE(RPI, "View: SortFinalizedDrawLists");
RHI::DrawListsByTag& drawListsByTag = m_drawListContext.GetMergedDrawListsByTag();
AZ::JobCompletion jobCompletion;
for (size_t idx = 0; idx < drawListsByTag.size(); ++idx)
{
if (drawListsByTag[idx].size() > 1)
{
SortDrawList(drawListsByTag[idx], RHI::DrawListTag(idx));
auto jobLambda = [this, &drawListsByTag, idx]()
{
AZ_PROFILE_SCOPE(RPI, "View: SortDrawList Job");
SortDrawList(drawListsByTag[idx], RHI::DrawListTag(idx));
};
Job* jobSortDrawList = aznew JobFunction<decltype(jobLambda)>(jobLambda, true, nullptr); // Auto-deletes
jobSortDrawList->SetDependent(&jobCompletion);
jobSortDrawList->Start();
}
}
jobCompletion.StartAndWaitForCompletion();
}
void View::SortDrawList(RHI::DrawList& drawList, RHI::DrawListTag tag)
@@ -433,6 +445,7 @@ namespace AZ
void View::BeginCulling()
{
#if AZ_TRAIT_MASKED_OCCLUSION_CULLING_SUPPORTED
AZ_PROFILE_SCOPE(RPI, "View: ClearMaskedOcclusionBuffer");
m_maskedOcclusionCulling->ClearBuffer();
#endif
}