Merge branch 'development' of https://github.com/o3de/o3de into jckand/EditorAutomationOptimization

monroegm-disable-blank-issue-2
jckand-amzn 4 years ago
commit cf706f5f4e

@ -342,7 +342,7 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) ->
# Run a full scan to ENSURE that both caches (pc and osx) are COMPLETELY POPULATED
# Needed for asset bundling
# fmt:off
assert asset_processor.batch_process(fastscan=False, timeout=timeout * len(platforms), platforms=platforms_list), \
assert asset_processor.batch_process(fastscan=True, timeout=timeout * len(platforms), platforms=platforms_list), \
"AP Batch failed to process in bundler_batch_fixture"
# fmt:on

@ -92,25 +92,12 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
AZ::AssetProcessor
)
# Issue #3017
#ly_add_pytest(
# NAME AssetPipelineTests.AssetBundler
# PATH ${CMAKE_CURRENT_LIST_DIR}/asset_bundler_batch_tests.py
# EXCLUDE_TEST_RUN_TARGET_FROM_IDE
# TEST_SERIAL
# TEST_SUITE periodic
# RUNTIME_DEPENDENCIES
# AZ::AssetProcessor
# AZ::AssetBundlerBatch
#)
ly_add_pytest(
NAME AssetPipelineTests.AssetBundler_SandBox
TEST_SUITE sandbox
NAME AssetPipelineTests.AssetBundler
PATH ${CMAKE_CURRENT_LIST_DIR}/asset_bundler_batch_tests.py
PYTEST_MARKS "SUITE_sandbox" # run only sandbox tests in this file
EXCLUDE_TEST_RUN_TARGET_FROM_IDE
TEST_SERIAL
TEST_SUITE periodic
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
AZ::AssetBundlerBatch

@ -10,6 +10,7 @@ import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import azlmbr.asset as asset
import azlmbr.editor as editor
import azlmbr.legacy.general as general
import azlmbr.bus as bus
import azlmbr.math as math
@ -107,7 +108,7 @@ class TestPhysXColliderSurfaceTagEmitter(EditorTestHelper):
# Create an entity with a PhysX Collider and our PhysX Collider Surface Tag Emitter
collider_entity = hydra.Entity("Collider Surface")
collider_entity.create_entity(
entity_center_point,
entity_center_point,
["PhysX Collider", "PhysX Collider Surface Tag Emitter"]
)
if collider_entity.id.IsValid():
@ -153,23 +154,29 @@ class TestPhysXColliderSurfaceTagEmitter(EditorTestHelper):
self.test_success = self.test_success and baseline_success
# Setup collider entity with a PhysX Mesh
test_physx_mesh_asset_path = asset.AssetCatalogRequestBus(
test_physx_mesh_asset_id = asset.AssetCatalogRequestBus(
bus.Broadcast, "GetAssetIdByPath", os.path.join("levels", "physics",
"c4044697_material_perfacematerialvalidation",
"test.pxmesh"), math.Uuid(), False)
hydra.get_set_test(collider_entity, 0, "Shape Configuration|Shape", 7)
hydra.get_set_test(collider_entity, 0, "Shape Configuration|Asset|PhysX Mesh", test_physx_mesh_asset_path)
# Remove/re-add component due to LYN-5496
collider_entity.remove_component("PhysX Collider")
collider_entity.add_component("PhysX Collider")
self.wait_for_condition(lambda: editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled',
collider_entity.components[1]), 5.0)
hydra.get_set_test(collider_entity, 1, "Shape Configuration|Shape", 7)
hydra.get_set_test(collider_entity, 1, "Shape Configuration|Asset|PhysX Mesh", test_physx_mesh_asset_id)
# Set the asset scale to match the test heights of the shapes tested
asset_scale = math.Vector3(1.0, 1.0, 9.0)
collider_entity.get_set_test(0, "Shape Configuration|Asset|Configuration|Asset Scale", asset_scale)
collider_entity.get_set_test(1, "Shape Configuration|Asset|Configuration|Asset Scale", asset_scale)
# Test: Generate a new surface on the collider.
# There should be one instance at the very top of the collider mesh, and none on the baseline surface
# (We use a small query box to only check for one placed instance point)
self.log("Starting PhysX Mesh Collider Test")
hydra.get_set_test(collider_entity, 1, "Configuration|Generated Tags", [surface_tag])
hydra.get_set_test(collider_entity, 1, "Configuration|Extended Tags", [invalid_tag])
hydra.get_set_test(collider_entity, 0, "Configuration|Generated Tags", [surface_tag])
hydra.get_set_test(collider_entity, 0, "Configuration|Extended Tags", [invalid_tag])
top_point_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(top_point, 0.25, 1), 5.0)
self.test_success = self.test_success and top_point_success
baseline_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(baseline_surface_point,
@ -180,8 +187,8 @@ class TestPhysXColliderSurfaceTagEmitter(EditorTestHelper):
# There should be no instances at the very top of the collider mesh, and none on the baseline surface within
# our query box as PhysX meshes are treated as hollow shells, not solid volumes.
# (We use a small query box to only check for one placed instance point)
hydra.get_set_test(collider_entity, 1, "Configuration|Generated Tags", [invalid_tag])
hydra.get_set_test(collider_entity, 1, "Configuration|Extended Tags", [surface_tag])
hydra.get_set_test(collider_entity, 0, "Configuration|Generated Tags", [invalid_tag])
hydra.get_set_test(collider_entity, 0, "Configuration|Extended Tags", [surface_tag])
top_point_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(top_point, 0.25, 0), 5.0)
self.test_success = self.test_success and top_point_success
baseline_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(baseline_surface_point,

@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {

@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {

@ -675,14 +675,14 @@ void AzAssetBrowserRequestHandler::OpenAssetInAssociatedEditor(const AZ::Data::A
firstValidOpener = &openerDetails;
}
// bind a callback such that when the menu item is clicked, it sets that as the opener to use.
menu.addAction(openerDetails.m_iconToUse, QObject::tr(openerDetails.m_displayText.c_str()), mainWindow, AZStd::bind(switchToOpener, &openerDetails));
menu.addAction(openerDetails.m_iconToUse, QObject::tr(openerDetails.m_displayText.c_str()), mainWindow, [switchToOpener, details = &openerDetails] { return switchToOpener(details); });
}
}
if (numValidOpeners > 1) // more than one option was added
{
menu.addSeparator();
menu.addAction(QObject::tr("Cancel"), AZStd::bind(switchToOpener, nullptr)); // just something to click on to avoid doing anything.
menu.addAction(QObject::tr("Cancel"), [switchToOpener] { return switchToOpener(nullptr); }); // just something to click on to avoid doing anything.
menu.exec(QCursor::pos());
}
else if (numValidOpeners == 1)

@ -145,7 +145,7 @@ bool UserPopupWidgetHandler::ReadValuesIntoGUI(size_t index, UserPropertyEditor*
QWidget* FloatCurveHandler::CreateGUI(QWidget *pParent)
{
CSplineCtrl *cSpline = new CSplineCtrl(pParent);
cSpline->SetUpdateCallback(AZStd::bind(&FloatCurveHandler::OnSplineChange, this, AZStd::placeholders::_1));
cSpline->SetUpdateCallback([this](CSplineCtrl* spl) { OnSplineChange(spl); });
cSpline->SetTimeRange(0, 1);
cSpline->SetValueRange(0, 1);
cSpline->SetGrid(12, 12);

@ -172,8 +172,8 @@ ReflectedPropertyItem::ReflectedPropertyItem(ReflectedPropertyControl *control,
if (parent)
parent->AddChild(this);
m_onSetCallback = AZStd::bind(&ReflectedPropertyItem::OnVariableChange, this, AZStd::placeholders::_1);
m_onSetEnumCallback = AZStd::bind(&ReflectedPropertyItem::OnVariableEnumChange, this, AZStd::placeholders::_1);
m_onSetCallback = [this](IVariable* var) { OnVariableChange(var); };
m_onSetEnumCallback = [this](IVariable* var) { OnVariableEnumChange(var); };
}
ReflectedPropertyItem::~ReflectedPropertyItem()

@ -2634,7 +2634,6 @@ void EditorViewportWidget::ShowCursor()
//////////////////////////////////////////////////////////////////////////
void EditorViewportWidget::PushDisableRendering()
{
assert(m_disableRenderingCount >= 0);
++m_disableRenderingCount;
}

@ -37,7 +37,7 @@ namespace UnitTest
m_inputChannelMapper = AZStd::make_unique<AzToolsFramework::QtEventToAzInputMapper>(m_rootWidget.get(), TestViewportId);
}
void TearDown()
void TearDown() override
{
m_inputChannelMapper.reset();

@ -24,10 +24,10 @@ namespace UnitTest
void Disconnect();
// EditorInteractionSystemViewportSelectionRequestBus overrides ...
void SetHandler(const AzToolsFramework::ViewportSelectionRequestsBuilderFn& interactionRequestsBuilder);
void SetDefaultHandler();
bool InternalHandleMouseViewportInteraction(const MouseInteractionEvent& mouseInteraction);
bool InternalHandleMouseManipulatorInteraction(const MouseInteractionEvent& mouseInteraction);
void SetHandler(const AzToolsFramework::ViewportSelectionRequestsBuilderFn& interactionRequestsBuilder) override;
void SetDefaultHandler() override;
bool InternalHandleMouseViewportInteraction(const MouseInteractionEvent& mouseInteraction) override;
bool InternalHandleMouseManipulatorInteraction(const MouseInteractionEvent& mouseInteraction) override;
AZStd::function<bool(const MouseInteractionEvent& mouseInteraction)> m_internalHandleMouseViewportInteraction;
AZStd::function<bool(const MouseInteractionEvent& mouseInteraction)> m_internalHandleMouseManipulatorInteraction;
@ -92,7 +92,7 @@ namespace UnitTest
m_inputChannelMapper = AZStd::make_unique<AzToolsFramework::QtEventToAzInputMapper>(m_rootWidget.get(), TestViewportId);
}
void TearDown()
void TearDown() override
{
m_inputChannelMapper.reset();

@ -1767,7 +1767,7 @@ void MainWindow::RegisterOpenWndCommands()
cmdUI.tooltip = (QString("Open ") + className).toUtf8().data();
cmdUI.iconFilename = className.toUtf8().data();
GetIEditor()->GetCommandManager()->RegisterUICommand("editor", openCommandName.toUtf8().data(),
"", "", AZStd::bind(&CEditorOpenViewCommand::Execute, pCmd), cmdUI);
"", "", [pCmd] { pCmd->Execute(); }, cmdUI);
GetIEditor()->GetCommandManager()->GetUIInfo("editor", openCommandName.toUtf8().data(), cmdUI);
}
}

@ -1515,8 +1515,8 @@ void CBaseObject::Serialize(CObjectArchive& ar)
SetFrozen(bFrozen);
SetHidden(bHidden);
ar.SetResolveCallback(this, parentId, AZStd::bind(&CBaseObject::ResolveParent, this, AZStd::placeholders::_1 ));
ar.SetResolveCallback(this, lookatId, AZStd::bind(&CBaseObject::SetLookAt, this, AZStd::placeholders::_1));
ar.SetResolveCallback(this, parentId, [this](CBaseObject* parent) { ResolveParent(parent); });
ar.SetResolveCallback(this, lookatId, [this](CBaseObject* target) { SetLookAt(target); });
InvalidateTM(0);
SetModified(false);
@ -2038,7 +2038,7 @@ bool CBaseObject::HitHelperAtTest(HitContext& hc, const Vec3& pos)
//////////////////////////////////////////////////////////////////////////
CBaseObject* CBaseObject::GetChild(size_t const i) const
{
assert(i >= 0 && i < m_childs.size());
assert(i < m_childs.size());
return m_childs[i];
}
@ -2729,7 +2729,7 @@ void CBaseObject::SetMinSpec(uint32 nSpec, bool bSetChildren)
// Set min spec for all childs.
if (bSetChildren)
{
for (size_t i = m_childs.size() - 1; i >= 0; --i)
for (int i = static_cast<int>(m_childs.size()) - 1; i >= 0; --i)
{
m_childs[i]->SetMinSpec(nSpec, true);
}

@ -230,25 +230,25 @@ CEntityObject::CEntityObject()
m_attachmentType = eAT_Pivot;
// cache all the variable callbacks, must match order of enum defined in header
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnAreaHeightChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnAreaLightChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnAreaLightSizeChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnAreaWidthChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxHeightChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxLengthChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxProjectionChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxSizeXChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxSizeYChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxSizeZChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxWidthChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnColorChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnInnerRadiusChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnOuterRadiusChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnProjectInAllDirsChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnProjectorFOVChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnProjectorTextureChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnPropertyChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnRadiusChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnAreaHeightChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnAreaLightChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnAreaLightSizeChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnAreaWidthChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxHeightChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxLengthChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxProjectionChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxSizeXChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxSizeYChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxSizeZChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxWidthChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnColorChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnInnerRadiusChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnOuterRadiusChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnProjectInAllDirsChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnProjectorFOVChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnProjectorTextureChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnPropertyChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnRadiusChange(var); });
}
CEntityObject::~CEntityObject()
@ -938,11 +938,14 @@ void CEntityObject::Serialize(CObjectArchive& ar)
eventTarget->getAttr("TargetId", targetId);
eventTarget->getAttr("Event", et.event);
eventTarget->getAttr("SourceEvent", et.sourceEvent);
m_eventTargets.push_back(et);
m_eventTargets.emplace_back(AZStd::move(et));
if (targetId != GUID_NULL)
{
using namespace AZStd::placeholders;
ar.SetResolveCallback(this, targetId, AZStd::bind(&CEntityObject::ResolveEventTarget, this, _1, _2), i);
ar.SetResolveCallback(
this, targetId,
[this](CBaseObject* object, unsigned int index) { ResolveEventTarget(object, index); },
i);
}
}
}
@ -1413,7 +1416,7 @@ void CEntityObject::PostClone(CBaseObject* pFromObject, CObjectCloneContext& ctx
void CEntityObject::ResolveEventTarget(CBaseObject* object, unsigned int index)
{
// Find target id.
assert(index >= 0 && index < m_eventTargets.size());
assert(index < m_eventTargets.size());
if (object)
{
object->AddEventListener(this);

@ -110,7 +110,7 @@ void CTrackViewKeyPropertiesDlg::PopulateVariables()
m_wndProps->RemoveAllItems();
m_wndProps->AddVarBlock(m_pVarBlock);
m_wndProps->SetUpdateCallback(AZStd::bind(&CTrackViewKeyPropertiesDlg::OnVarChange, this, AZStd::placeholders::_1));
m_wndProps->SetUpdateCallback([this](IVariable* var) { OnVarChange(var); });
//m_wndProps->m_props.ExpandAll();

@ -49,7 +49,7 @@ public:
}
void Undo(bool bUndo) override
{
for (size_t i = m_undoSteps.size() - 1; i >= 0; i--)
for (int i = static_cast<int>(m_undoSteps.size()) - 1; i >= 0; i--)
{
m_undoSteps[i]->Undo(bUndo);
}

@ -58,36 +58,26 @@ bool C3DConnexionDriver::InitDevice()
//Doc says RIM_TYPEHID: Data comes from an HID that is not a keyboard or a mouse.
if (m_pRawInputDeviceList[i].dwType == RIM_TYPEHID)
{
UINT nchars = 300;
TCHAR deviceName[300];
if (GetRawInputDeviceInfo(m_pRawInputDeviceList[i].hDevice,
RIDI_DEVICENAME, deviceName, &nchars) >= 0)
{
//_RPT3(_CRT_WARN, "Device[%d]: handle=0x%x name = %S\n", i, g_pRawInputDeviceList[i].hDevice, deviceName);
}
RID_DEVICE_INFO dinfo;
UINT sizeofdinfo = sizeof(dinfo);
dinfo.cbSize = sizeofdinfo;
if (GetRawInputDeviceInfo(m_pRawInputDeviceList[i].hDevice,
RIDI_DEVICEINFO, &dinfo, &sizeofdinfo) >= 0)
GetRawInputDeviceInfo(m_pRawInputDeviceList[i].hDevice,
RIDI_DEVICEINFO, &dinfo, &sizeofdinfo);
if (dinfo.dwType == RIM_TYPEHID)
{
if (dinfo.dwType == RIM_TYPEHID)
RID_DEVICE_INFO_HID* phidInfo = &dinfo.hid;
// Add this one to the list of interesting devices?
// Actually only have to do this once to get input from all usage 1, usagePage 8 devices
// This just keeps out the other usages.
// You might want to put up a list for users to select amongst the different devices.
// In particular, to assign separate functionality to the different devices.
if (phidInfo->usUsagePage == 1 && phidInfo->usUsage == 8)
{
RID_DEVICE_INFO_HID* phidInfo = &dinfo.hid;
// Add this one to the list of interesting devices?
// Actually only have to do this once to get input from all usage 1, usagePage 8 devices
// This just keeps out the other usages.
// You might want to put up a list for users to select amongst the different devices.
// In particular, to assign separate functionality to the different devices.
if (phidInfo->usUsagePage == 1 && phidInfo->usUsage == 8)
{
m_pRawInputDevices[m_nUsagePage1Usage8Devices].usUsagePage = phidInfo->usUsagePage;
m_pRawInputDevices[m_nUsagePage1Usage8Devices].usUsage = phidInfo->usUsage;
m_pRawInputDevices[m_nUsagePage1Usage8Devices].dwFlags = 0;
m_pRawInputDevices[m_nUsagePage1Usage8Devices].hwndTarget = nullptr;
m_nUsagePage1Usage8Devices++;
}
m_pRawInputDevices[m_nUsagePage1Usage8Devices].usUsagePage = phidInfo->usUsagePage;
m_pRawInputDevices[m_nUsagePage1Usage8Devices].usUsage = phidInfo->usUsage;
m_pRawInputDevices[m_nUsagePage1Usage8Devices].dwFlags = 0;
m_pRawInputDevices[m_nUsagePage1Usage8Devices].hwndTarget = nullptr;
m_nUsagePage1Usage8Devices++;
}
}
}

@ -467,7 +467,7 @@ bool CKDTree::FindNearestVertexRecursively(KDTreeNode* pNode, const Vec3& raySrc
uint32 nVertexIndex = pNode->GetVertexIndex(i);
uint32 nObjIndex = pNode->GetObjIndex(i);
assert(nObjIndex < m_StatObjectList.size() && nObjIndex >= 0);
assert(nObjIndex < m_StatObjectList.size());
const SStatObj* pStatObjInfo = &(m_StatObjectList[nObjIndex]);

@ -769,7 +769,9 @@ namespace
void PySetViewPaneLayout(unsigned int layoutId)
{
AZ_PUSH_DISABLE_WARNING(4296, "-Wunknown-warning-option")
if ((layoutId >= ET_Layout0) && (layoutId <= ET_Layout8))
AZ_POP_DISABLE_WARNING
{
CLayoutWnd* layout = GetIEditor()->GetViewManager()->GetLayout();
if (layout)

@ -1850,7 +1850,7 @@ namespace AZ
* {
* // do any conversion of caching of the "data" here and forward this to behavior (often the reason for this is that you can't pass everything to behavior
* // plus behavior can't really handle all constructs pointer to pointer, rvalues, etc. as they don't make sense for most script environments
* int result = 0; // set the default value for your result if the behavior if there is no implmentation
* int result = 0; // set the default value for your result if the behavior if there is no implementation
* // The AZ_EBUS_BEHAVIOR_BINDER defines FN_EventName for each index. You can also cache it yourself (but it's slower), static int cacheIndex = GetFunctionIndex("OnEvent1"); and use that .
* CallResult(result, FN_OnEvent1, data); // forward to the binding (there can be none, this is why we need to always have properly set result, when there is one)
* return result; // return the result like you will in any normal EBus even with result

@ -49,7 +49,7 @@ namespace AZ::Platform
AZ_Assert(m_events[0], "There is no synchronization event created for the main streamer thread to use to suspend.");
DWORD result = ::WaitForMultipleObjects(m_handleCount, m_events, false, INFINITE);
if (result >= WAIT_OBJECT_0 && result < WAIT_OBJECT_0 + m_handleCount)
if (result < WAIT_OBJECT_0 + m_handleCount)
{
DWORD index = result - WAIT_OBJECT_0;
::ResetEvent(m_events[index]);

@ -36,12 +36,23 @@ using namespace UnitTestInternal;
/**
* Validate a vector for certain number of elements.
*/
#define AZ_TEST_VALIDATE_VECTOR(_Vector, _NumElements) \
EXPECT_TRUE(_Vector.validate()); \
EXPECT_EQ(_NumElements, _Vector.size()); \
EXPECT_TRUE((_NumElements > 0) ? !_Vector.empty() : _Vector.empty()); \
EXPECT_TRUE((_NumElements > 0) ? _Vector.capacity() >= _NumElements : true); \
EXPECT_TRUE((_NumElements > 0) ? _Vector.begin() != _Vector.end() : _Vector.begin() == _Vector.end()); \
#define AZ_TEST_VALIDATE_VECTOR(_Vector, _NumElements) \
EXPECT_NE(_NumElements, 0); \
EXPECT_TRUE(_Vector.validate()); \
EXPECT_EQ(_NumElements, _Vector.size()); \
EXPECT_TRUE(!_Vector.empty()); \
EXPECT_TRUE(_Vector.capacity() >= _NumElements); \
EXPECT_TRUE(_Vector.begin() != _Vector.end()); \
EXPECT_NE(nullptr, _Vector.data())
/**
* Validate a vector for 0 number of elements. The above macro creates expressions that are always true for size == 0
*/
#define AZ_TEST_VALIDATE_VECTOR_0(_Vector) \
EXPECT_TRUE(_Vector.validate()); \
EXPECT_EQ(0, _Vector.size()); \
EXPECT_TRUE(_Vector.empty()); \
EXPECT_TRUE(_Vector.begin() == _Vector.end()); \
EXPECT_NE(nullptr, _Vector.data())
namespace UnitTest
@ -312,7 +323,7 @@ namespace UnitTest
// erase
int_vector1.erase(int_vector1.begin(), int_vector1.end());
AZ_TEST_VALIDATE_VECTOR(int_vector1, 0); // Zero elements but valid capacity.
AZ_TEST_VALIDATE_VECTOR_0(int_vector1); // Zero elements but valid capacity.
int_vector1.push_back(10);
int_vector1.push_back(20);
@ -324,11 +335,11 @@ namespace UnitTest
// clear
int_vector1.clear();
AZ_TEST_VALIDATE_VECTOR(int_vector1, 0); // Zero elements but valid capacity.
AZ_TEST_VALIDATE_VECTOR_0(int_vector1); // Zero elements but valid capacity.
// swap
int_vector1.swap(int_vector);
AZ_TEST_VALIDATE_VECTOR(int_vector, 0);
AZ_TEST_VALIDATE_VECTOR_0(int_vector);
AZ_TEST_VALIDATE_VECTOR(int_vector1, 33);
AZ_TEST_ASSERT(int_vector1.front() == 55);
@ -524,11 +535,11 @@ namespace UnitTest
// Default vector (integral type).
fixed_vector<int, 50> int_vector_default;
AZ_TEST_VALIDATE_VECTOR(int_vector_default, 0);
AZ_TEST_VALIDATE_VECTOR_0(int_vector_default);
// Default vector (non-integral type).
fixed_vector<MyClass, 10> myclass_vector_default;
AZ_TEST_VALIDATE_VECTOR(myclass_vector_default, 0);
AZ_TEST_VALIDATE_VECTOR_0(myclass_vector_default);
// Create a vector (using fill ctor, with memset optimization to set the values)
typedef fixed_vector<char, 10> char_10_type;
@ -633,7 +644,7 @@ namespace UnitTest
// erase
int_vector1.erase(int_vector1.begin(), int_vector1.end());
AZ_TEST_VALIDATE_VECTOR(int_vector1, 0);
AZ_TEST_VALIDATE_VECTOR_0(int_vector1);
int_vector1.push_back(10);
int_vector1.push_back(20);
@ -645,11 +656,11 @@ namespace UnitTest
// clear
int_vector1.clear();
AZ_TEST_VALIDATE_VECTOR(int_vector1, 0);
AZ_TEST_VALIDATE_VECTOR_0(int_vector1);
// swap
int_vector1.swap(int_vector);
AZ_TEST_VALIDATE_VECTOR(int_vector, 0);
AZ_TEST_VALIDATE_VECTOR_0(int_vector);
AZ_TEST_VALIDATE_VECTOR(int_vector1, 33);
AZ_TEST_ASSERT(int_vector1.front() == 55);
@ -963,7 +974,7 @@ namespace UnitTest
AZ_TEST_VALIDATE_VECTOR(deep_vec_2, 12);
deep_vec_2.clear();
AZ_TEST_VALIDATE_VECTOR(deep_vec_2, 0);
AZ_TEST_VALIDATE_VECTOR_0(deep_vec_2);
}
#endif // AZ_UNIT_TEST_SKIP_STD_VECTOR_AND_ARRAY_TESTS

@ -1081,16 +1081,6 @@ namespace AZ
return ResultCode::Error;
}
//bound check
//note that seeking beyond end or before beginning is system dependent
//therefore we will define that on all platforms it is not allowed
if (newFilePosition < 0)
{
AZ_TracePrintf(RemoteFileIOChannel, "RemoteFileIO::Seek(fileHandle=%u, offset=%i, type=%s) seek to a position before the begining of a file!", fileHandle, offset, type == SeekType::SeekFromCurrent ? "SeekFromCurrent" : type == SeekType::SeekFromEnd ? "SeekFromEnd" : type == SeekType::SeekFromStart ? "SeekFromStart" : "Unknown");
REMOTEFILE_LOG_APPEND(AZStd::string::format("RemoteFileIO::Seek(fileHandle=%u, offset=%i, type=%s) seek to a position before the begining of a file!", fileHandle, offset, type == SeekType::SeekFromCurrent ? "SeekFromCurrent" : type == SeekType::SeekFromEnd ? "SeekFromEnd" : type == SeekType::SeekFromStart ? "SeekFromStart" : "Unknown").c_str());
newFilePosition = 0;
}
else
{
AZ::u64 fileSize = 0;
Size(fileHandle, fileSize);

@ -13,14 +13,6 @@
#include <AzFramework/Physics/CollisionBus.h>
//This bit is defined in the TouchBending Gem wscript.
//Make sure the bit has a valid value.
#ifdef TOUCHBENDING_LAYER_BIT
#if (TOUCHBENDING_LAYER_BIT < 1) || (TOUCHBENDING_LAYER_BIT > 63)
#error Invalid Bit Definition For the TouchBending Layer Bit
#endif
#endif //#ifdef TOUCHBENDING_LAYER_BIT
namespace AzPhysics
{
AZ_CLASS_ALLOCATOR_IMPL(CollisionGroup, AZ::SystemAllocator, 0);
@ -31,10 +23,6 @@ namespace AzPhysics
const CollisionGroup CollisionGroup::None = 0x0000000000000000ULL;
const CollisionGroup CollisionGroup::All = 0xFFFFFFFFFFFFFFFFULL;
#ifdef TOUCHBENDING_LAYER_BIT
const CollisionGroup CollisionGroup::All_NoTouchBend = CollisionGroup::All.GetMask() & ~CollisionLayer::TouchBend.GetMask();
#endif
void CollisionGroupScriptConstructor(CollisionGroup* thisPtr, AZ::ScriptDataContext& scriptDataContext)
{
if (int numArgs = scriptDataContext.GetNumArguments();

@ -14,14 +14,6 @@
#include <AzFramework/Physics/CollisionBus.h>
//This bit is defined in the TouchBending Gem wscript.
//Make sure the bit has a valid value.
#ifdef TOUCHBENDING_LAYER_BIT
#if (TOUCHBENDING_LAYER_BIT < 1) || (TOUCHBENDING_LAYER_BIT > 63)
#error Invalid Bit Definition For the TouchBending Layer Bit
#endif
#endif //#ifdef TOUCHBENDING_LAYER_BIT
namespace AzPhysics
{
AZ_CLASS_ALLOCATOR_IMPL(CollisionLayer, AZ::SystemAllocator, 0);
@ -29,10 +21,6 @@ namespace AzPhysics
const CollisionLayer CollisionLayer::Default = 0;
#ifdef TOUCHBENDING_LAYER_BIT
const CollisionLayer CollisionLayer::TouchBend = TOUCHBENDING_LAYER_BIT;
#endif
void CollisionLayer::Reflect(AZ::ReflectContext* context)
{
if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))

@ -32,12 +32,20 @@ namespace AzPhysics
{
public:
AZ_CLASS_ALLOCATOR_DECL;
AZ_RTTI(StaticRigidBody, "{13A677BB-7085-4EDB-BCC8-306548238692}", SimulatedBody);
AZ_RTTI(AzPhysics::StaticRigidBody, "{13A677BB-7085-4EDB-BCC8-306548238692}", AzPhysics::SimulatedBody);
static void Reflect(AZ::ReflectContext* context);
//Legacy API - may change with LYN-438
//! Add a shape to the static rigid body.
//! @param shape A shared pointer of the shape to add.
virtual void AddShape(const AZStd::shared_ptr<Physics::Shape>& shape) = 0;
//! Returns the number of shapes that make up this static rigid body.
//! @return Returns the number of shapes as a AZ::u32.
virtual AZ::u32 GetShapeCount() { return 0; }
//! Returns a shared pointer to the requested shape index.
//! @param index The index of the shapes to return. Expected to be between 0 and GetShapeCount().
//! @return Returns a shared pointer of the shape requested or nullptr if index is out of bounds.
virtual AZStd::shared_ptr<Physics::Shape> GetShape([[maybe_unused]]AZ::u32 index) { return nullptr; }
};
}

@ -102,11 +102,25 @@ namespace AzFramework
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
//////////////////////////////////////////////////////////////////////////
virtual void OnTerrainDataCreateBegin() {};
virtual void OnTerrainDataCreateEnd() {};
enum TerrainDataChangedMask : uint8_t
{
None = 0b00000000,
Settings = 0b00000001,
HeightData = 0b00000010,
ColorData = 0b00000100,
SurfaceData = 0b00001000
};
virtual void OnTerrainDataCreateBegin() {}
virtual void OnTerrainDataCreateEnd() {}
virtual void OnTerrainDataDestroyBegin() {};
virtual void OnTerrainDataDestroyEnd() {};
virtual void OnTerrainDataDestroyBegin() {}
virtual void OnTerrainDataDestroyEnd() {}
virtual void OnTerrainDataChanged(
[[maybe_unused]] const AZ::Aabb& dirtyRegion, [[maybe_unused]] TerrainDataChangedMask dataChangedMask)
{
}
};
using TerrainDataNotificationBus = AZ::EBus<TerrainDataNotifications>;

@ -10,8 +10,6 @@
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME})
ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common)
set(LY_TOUCHBENDING_LAYER_BIT 63 CACHE STRING "Use TouchBending as the collision layer. The TouchBending layer can be a number from 1 to 63 (Default=63).")
ly_add_target(
NAME AzFramework STATIC
NAMESPACE AZ
@ -37,14 +35,6 @@ ly_add_target(
3rdParty::lz4
)
ly_add_source_properties(
SOURCES
AzFramework/Physics/Collision/CollisionGroups.cpp
AzFramework/Physics/Collision/CollisionLayers.cpp
PROPERTY COMPILE_DEFINITIONS
VALUES TOUCHBENDING_LAYER_BIT=${LY_TOUCHBENDING_LAYER_BIT}
)
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME})

@ -1,34 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/EBus/EBus.h>
#include <AzCore/Math/Aabb.h>
namespace AZ
{
/**
* the EBus is used to request information about potential vegetation surfaces
*/
class HeightmapUpdateNotification
: public AZ::EBusTraits
{
public:
////////////////////////////////////////////////////////////////////////
// EBusTraits
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
////////////////////////////////////////////////////////////////////////
// Occurs when the terrain height map is modified.
virtual void HeightmapModified(const AZ::Aabb& bounds) = 0;
};
typedef AZ::EBus<HeightmapUpdateNotification> HeightmapUpdateNotificationBus;
}

@ -745,7 +745,7 @@ private:
void Update()
{
if (m_index >= 0 && m_index < m_parentNode->getChildCount())
if (m_index < m_parentNode->getChildCount())
{
m_currentChildNode = m_parentNode->getChild(static_cast<int>(m_index));
}

@ -53,7 +53,6 @@ set(FILES
HMDBus.h
VRCommon.h
StereoRendererBus.h
HeightmapUpdateNotificationBus.h
INavigationSystem.h
IMNM.h
SFunctor.h

@ -1626,6 +1626,9 @@ AZ_POP_DISABLE_WARNING
// Send out EBus event
EBUS_EVENT(CrySystemEventBus, OnCrySystemInitialized, *this, startupParams);
// Execute any deferred commands that uses the CVar commands that were just registered
AZ::Interface<AZ::IConsole>::Get()->ExecuteDeferredConsoleCommands();
// Verify that the Maestro Gem initialized the movie system correctly. This can be removed if and when Maestro is not a required Gem
if (gEnv->IsEditor() && !gEnv->pMovieSystem)
{
@ -1641,7 +1644,7 @@ AZ_POP_DISABLE_WARNING
m_bInitializedSuccessfully = true;
return (true);
return true;
}

@ -3133,6 +3133,9 @@ char* CXConsole::GetCheatVarAt(uint32 nOffset)
//////////////////////////////////////////////////////////////////////////
size_t CXConsole::GetSortedVars(AZStd::vector<AZStd::string_view>& pszArray, const char* szPrefix)
{
// This method used to insert instead of push_back, so we need to clear first
pszArray.clear();
size_t iPrefixLen = szPrefix ? strlen(szPrefix) : 0;
// variables

@ -197,11 +197,11 @@ namespace AssetProcessor
m_jobsInFlight.insert(rcJob);
for(size_t jobIndex = m_jobs.size() - 1; jobIndex >= 0; --jobIndex)
for(int jobIndex = static_cast<int>(m_jobs.size()) - 1; jobIndex >= 0; --jobIndex)
{
if(m_jobs[jobIndex] == rcJob)
{
Q_EMIT dataChanged(index(aznumeric_caster(jobIndex), 0, QModelIndex()), index(aznumeric_caster(jobIndex), 0, QModelIndex()));
Q_EMIT dataChanged(index(jobIndex, 0, QModelIndex()), index(jobIndex, 0, QModelIndex()));
return;
}
}
@ -240,7 +240,7 @@ namespace AssetProcessor
foundInQueue = m_jobsInQueueLookup.erase(foundInQueue);
}
for (size_t jobIndex = m_jobs.size() - 1; jobIndex >= 0; --jobIndex)
for (int jobIndex = static_cast<int>(m_jobs.size()) - 1; jobIndex >= 0; --jobIndex)
{
if(m_jobs[jobIndex] == rcJob)
{
@ -251,7 +251,7 @@ namespace AssetProcessor
#if defined(DEBUG_RCJOB_MODEL)
AZ_TracePrintf(AssetProcessor::DebugChannel, "JobTrace =>JobCompleted(%i %s,%s,%s)\n", rcJob, rcJob->GetJobEntry().m_databaseSourceName.toUtf8().constData(), rcJob->GetPlatformInfo().m_identifier.c_str(), rcJob->GetJobKey().toUtf8().constData());
#endif
beginRemoveRows(QModelIndex(), aznumeric_caster(jobIndex), aznumeric_caster(jobIndex));
beginRemoveRows(QModelIndex(), jobIndex, jobIndex);
m_jobs.erase(m_jobs.begin() + jobIndex);
endRemoveRows();

@ -52,7 +52,6 @@ namespace AssetProcessor
SizeType finalPosition = GenericStream::ComputeSeekPosition(bytes, mode);
AZ_Assert(finalPosition < INT_MAX, "Overflow of SizeType to int in ByteArrayStream.");
AZ_Assert(finalPosition >= 0, "underflow in seek in ByteArrayStream");
AZ_Assert(finalPosition <= m_activeArray->size(), "You cant seek beyond end of file");
// safety clamp!

@ -72,11 +72,6 @@ namespace AssetUtilsInternal
bool FileCopyMoveWithTimeout(QString sourceFile, QString outputFile, bool isCopy, unsigned int waitTimeInSeconds)
{
if (waitTimeInSeconds < 0)
{
AZ_Warning("Asset Processor", waitTimeInSeconds >= 0, "Invalid timeout specified by the user");
waitTimeInSeconds = 0;
}
bool failureOccurredOnce = false; // used for logging.
bool operationSucceeded = false;
QFile outFile(outputFile);

@ -173,10 +173,7 @@ namespace AreaChart
void AreaChart::ConfigureVerticalAxis(QString label, unsigned int minimumHeight)
{
if (minimumHeight >= 0)
{
SetMinimumValueRange(minimumHeight);
}
SetMinimumValueRange(minimumHeight);
if (m_verticalAxis == nullptr)
{
@ -323,7 +320,7 @@ namespace AreaChart
// Need to handle the areas right at the edge of the polygons
for (int i = -1; i <= 1; ++i)
{
if ((counter+i) < 0 || (counter + i) >= m_hitAreas.size())
if ((counter + i) >= m_hitAreas.size())
{
continue;
}

@ -7,6 +7,7 @@
*/
#include <TestImpactConsoleUtils.h>
#include <AzCore/Casting/numeric_cast.h>
namespace TestImpact
{

@ -90,7 +90,7 @@ namespace AWSGameLift
{
auto gameliftCreateSessionRequest = azrtti_cast<const AWSGameLiftCreateSessionRequest*>(&createSessionRequest);
return gameliftCreateSessionRequest && gameliftCreateSessionRequest->m_maxPlayer >= 0 &&
return gameliftCreateSessionRequest &&
(!gameliftCreateSessionRequest->m_aliasId.empty() || !gameliftCreateSessionRequest->m_fleetId.empty());
}
} // namespace CreateSessionActivity

@ -79,7 +79,7 @@ namespace AWSGameLift
auto gameliftCreateSessionOnQueueRequest =
azrtti_cast<const AWSGameLiftCreateSessionOnQueueRequest*>(&createSessionRequest);
return gameliftCreateSessionOnQueueRequest && gameliftCreateSessionOnQueueRequest->m_maxPlayer >= 0 &&
return gameliftCreateSessionOnQueueRequest &&
!gameliftCreateSessionOnQueueRequest->m_queueName.empty() && !gameliftCreateSessionOnQueueRequest->m_placementId.empty();
}
} // namespace CreateSessionOnQueueActivity

@ -6,6 +6,8 @@
#
#
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME})
ly_add_target(
NAME Atom_Bootstrap.Headers HEADERONLY
NAMESPACE Gem
@ -21,9 +23,12 @@ ly_add_target(
NAMESPACE Gem
FILES_CMAKE
bootstrap_files.cmake
${pal_dir}/bootstrap_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
PLATFORM_INCLUDE_FILES
INCLUDE_DIRECTORIES
PRIVATE
Source
${pal_dir}
PUBLIC
Include
BUILD_DEPENDENCIES

@ -38,6 +38,10 @@
#include <Atom/Bootstrap/BootstrapNotificationBus.h>
#include <Atom/RPI.Reflect/System/AnyAsset.h>
#include <AzCore/Console/IConsole.h>
#include <BootstrapSystemComponent_Traits_Platform.h>
AZ_CVAR(AZ::CVarFixedString, r_default_pipeline_name, AZ_TRAIT_BOOTSTRAPSYSTEMCOMPONENT_PIPELINE_NAME, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Default Render pipeline name");
namespace AZ
{
@ -50,8 +54,7 @@ namespace AZ
if (SerializeContext* serialize = azrtti_cast<SerializeContext*>(context))
{
serialize->Class<BootstrapSystemComponent, Component>()
->Version(0)
->Field("DefaultRenderPipelineAssetFile", &BootstrapSystemComponent::m_defaultPipelineAssetPath)
->Version(1)
;
if (EditContext* ec = serialize->GetEditContext())
@ -60,8 +63,6 @@ namespace AZ
->ClassElement(Edit::ClassElements::EditorData, "")
->Attribute(Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b))
->Attribute(Edit::Attributes::AutoExpand, true)
->DataElement(Edit::UIHandlers::Default, &BootstrapSystemComponent::m_defaultPipelineAssetPath, "Default RenderPipeline Asset",
"The asset file path of default render pipeline for default window")
;
}
}
@ -314,13 +315,15 @@ namespace AZ
// Create a render pipeline from the specified asset for the window context and add the pipeline to the scene.
// When running with no Asset Processor (for example in release), CompileAssetSync will return AssetStatus_Unknown.
AzFramework::AssetSystem::AssetStatus status = AzFramework::AssetSystem::AssetStatus_Unknown;
AzFramework::AssetSystemRequestBus::BroadcastResult(
status, &AzFramework::AssetSystemRequestBus::Events::CompileAssetSync, m_defaultPipelineAssetPath);
AZ_Assert(status == AzFramework::AssetSystem::AssetStatus_Compiled || status == AzFramework::AssetSystem::AssetStatus_Unknown, "Could not compile the default render pipeline at '%s'", m_defaultPipelineAssetPath.c_str());
const AZ::CVarFixedString pipelineName = static_cast<AZ::CVarFixedString>(r_default_pipeline_name);
AzFramework::AssetSystemRequestBus::BroadcastResult(status, &AzFramework::AssetSystemRequestBus::Events::CompileAssetSync, pipelineName.data());
AZ_Assert(status == AzFramework::AssetSystem::AssetStatus_Compiled || status == AzFramework::AssetSystem::AssetStatus_Unknown, "Could not compile the default render pipeline at '%s'", pipelineName.c_str());
Data::Asset<RPI::AnyAsset> pipelineAsset = RPI::AssetUtils::LoadAssetByProductPath<RPI::AnyAsset>(m_defaultPipelineAssetPath.c_str(), RPI::AssetUtils::TraceLevel::Error);
Data::Asset<RPI::AnyAsset> pipelineAsset = RPI::AssetUtils::LoadAssetByProductPath<RPI::AnyAsset>(pipelineName.data(), RPI::AssetUtils::TraceLevel::Error);
RPI::RenderPipelineDescriptor renderPipelineDescriptor = *RPI::GetDataFromAnyAsset<RPI::RenderPipelineDescriptor>(pipelineAsset);
renderPipelineDescriptor.m_name = AZStd::string::format("%s_%i", renderPipelineDescriptor.m_name.c_str(), viewportContext->GetId());
if (!scene->GetRenderPipeline(AZ::Name(renderPipelineDescriptor.m_name)))
{
RPI::RenderPipelinePtr renderPipeline = RPI::RenderPipeline::CreateRenderPipelineForWindow(renderPipelineDescriptor, *viewportContext->GetWindowContext().get());

@ -112,10 +112,7 @@ namespace AZ
// The id of the render pipeline created by this component
RPI::RenderPipelineId m_renderPipelineId;
// Variables which are system component configuration
AZStd::string m_defaultPipelineAssetPath = "passes/MainRenderPipeline.azasset";
// Save a reference to the image created by the BRDF pipeline so it doesn't get auto deleted if it's ref count goes to zero
// For example, if we delete all the passes, we won't have to recreate the BRDF pipeline to recreate the BRDF texture
Data::Instance<RPI::AttachmentImage> m_brdfTexture;

@ -0,0 +1,9 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#define AZ_TRAIT_BOOTSTRAPSYSTEMCOMPONENT_PIPELINE_NAME "passes/LowEndRenderPipeline.azasset"

@ -7,6 +7,6 @@
#
set(FILES
RadTelemetry/ProfileTelemetry.h
RadTelemetry/ProfileTelemetryBus.h
BootstrapSystemComponent_Traits_Platform.h
)

@ -0,0 +1,9 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#define AZ_TRAIT_BOOTSTRAPSYSTEMCOMPONENT_PIPELINE_NAME "passes/MainRenderPipeline.azasset"

@ -6,9 +6,7 @@
#
#
ly_add_external_target(
NAME RadTelemetry
3RDPARTY_ROOT_DIRECTORY "${LY_RAD_TELEMETRY_INSTALL_ROOT}"
VERSION 3.5.0.17
INCLUDE_DIRECTORIES Include
set(FILES
BootstrapSystemComponent_Traits_Platform.h
)

@ -0,0 +1,9 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#define AZ_TRAIT_BOOTSTRAPSYSTEMCOMPONENT_PIPELINE_NAME "passes/MainRenderPipeline.azasset"

@ -0,0 +1,12 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
set(FILES
BootstrapSystemComponent_Traits_Platform.h
)

@ -0,0 +1,9 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#define AZ_TRAIT_BOOTSTRAPSYSTEMCOMPONENT_PIPELINE_NAME "passes/MainRenderPipeline.azasset"

@ -0,0 +1,12 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
set(FILES
BootstrapSystemComponent_Traits_Platform.h
)

@ -0,0 +1,9 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#define AZ_TRAIT_BOOTSTRAPSYSTEMCOMPONENT_PIPELINE_NAME "passes/LowEndRenderPipeline.azasset"

@ -0,0 +1,12 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
set(FILES
BootstrapSystemComponent_Traits_Platform.h
)

@ -0,0 +1,15 @@
{
"Type": "JsonSerialization",
"Version": 1,
"ClassName": "RenderPipelineDescriptor",
"ClassData": {
"Name": "LowEndPipeline",
"MainViewTag": "MainCamera",
"RootPassTemplate": "LowEndPipelineTemplate",
"RenderSettings": {
"MultisampleState": {
"samples": 1
}
}
}
}

@ -499,7 +499,7 @@ namespace AZ
// outSH -> output SH coefficient array
void EvalSHRotationFast(const float R[9], const uint32_t maxBand, const float* inSH, float* outSH)
{
if (maxBand >= 0 && maxBand <= 2)
if (maxBand <= 2)
{
ZHF3(R, maxBand, inSH, outSH);
}
@ -514,10 +514,7 @@ namespace AZ
// outSH -> output SH coefficient array
void EvalSHRotation(const float R[9], const uint32_t maxBand, const double* inSH, double* outSH)
{
if (maxBand >= 0)
{
WignerD(R, maxBand, inSH, outSH);
}
WignerD(R, maxBand, inSH, outSH);
}
// Fast evaluation for first 3 bands

@ -107,8 +107,7 @@ namespace AZ
if (m_deviceBufferNeedsUpdate)
{
[[maybe_unused]] bool success = m_lightBufferHandler.UpdateBuffer(m_capsuleLightData.GetDataVector());
AZ_Error(FeatureProcessorName, success, "Unable to update buffer during Simulate().");
m_lightBufferHandler.UpdateBuffer(m_capsuleLightData.GetDataVector());
m_deviceBufferNeedsUpdate = false;
}
}

@ -112,8 +112,7 @@ namespace AZ
if (m_deviceBufferNeedsUpdate)
{
[[maybe_unused]] bool success = m_decalBufferHandler.UpdateBuffer(m_decalData.GetDataVector<0>());
AZ_Error(FeatureProcessorName, success, "Unable to update buffer during Simulate().");
m_decalBufferHandler.UpdateBuffer(m_decalData.GetDataVector<0>());
m_deviceBufferNeedsUpdate = false;
}
}

@ -150,8 +150,7 @@ namespace AZ
if (m_deviceBufferNeedsUpdate)
{
[[maybe_unused]] bool success = m_decalBufferHandler.UpdateBuffer(m_decalData.GetDataVector());
AZ_Error(FeatureProcessorName, success, "Unable to update buffer during Simulate().");
m_decalBufferHandler.UpdateBuffer(m_decalData.GetDataVector());
m_deviceBufferNeedsUpdate = false;
}
}

@ -223,6 +223,9 @@ namespace AZ
/// Called when a buffer is being streamed asynchronously.
virtual ResultCode StreamBufferInternal(const BufferStreamRequest& request);
//Called in order to do a simple mem copy allowing Null rhi to opt out
virtual void BufferCopy(void* destination, const void* source, size_t num);
//////////////////////////////////////////////////////////////////////////
BufferPoolDescriptor m_descriptor;

@ -143,7 +143,7 @@ namespace AZ
resultCode = MapBufferInternal(mapRequest, mapResponse);
if (resultCode == ResultCode::Success)
{
memcpy(mapResponse.m_data, initRequest.m_initialData, initRequest.m_descriptor.m_byteCount);
BufferCopy(mapResponse.m_data, initRequest.m_initialData, initRequest.m_descriptor.m_byteCount);
UnmapBufferInternal(*initRequest.m_buffer);
}
}
@ -219,6 +219,11 @@ namespace AZ
return m_descriptor;
}
void BufferPool::BufferCopy(void* destination, const void* source, size_t num)
{
memcpy(destination, source, num);
}
ResultCode BufferPool::StreamBufferInternal([[maybe_unused]] const BufferStreamRequest& request)
{
return ResultCode::Unimplemented;

@ -34,7 +34,7 @@ namespace AZ
if (!isDataValid)
{
AZ_Warning("BufferPoolBase", false, "Failed to map buffer '%s'.", buffer.GetName().GetCStr());
AZ_Error("BufferPoolBase", false, "Failed to map buffer '%s'.", buffer.GetName().GetCStr());
}
++buffer.m_mapRefCount;
++m_mapRefCount;

@ -111,6 +111,8 @@ namespace AZ
void IndirectBufferSignature::ShutdownInternal()
{
auto& device = static_cast<Device&>(GetDevice());
device.QueueForRelease(m_signature);
m_signature = nullptr;
m_stride = 0;
}

@ -237,5 +237,14 @@ namespace AZ
static constexpr D3D12_RANGE InvalidRange = {0,0};
m_readBackBuffer->Unmap(0, &InvalidRange);
}
void QueryPool::ShutdownInternal()
{
auto& device = static_cast<Device&>(GetDevice());
device.QueueForRelease(m_queryHeap);
m_queryHeap = nullptr;
device.QueueForRelease(m_readBackBuffer);
m_readBackBuffer = nullptr;
}
}
}

@ -44,6 +44,7 @@ namespace AZ
RHI::ResultCode InitInternal(RHI::Device& device, const RHI::QueryPoolDescriptor& descriptor) override;
RHI::ResultCode InitQueryInternal(RHI::Query& query) override;
RHI::ResultCode GetResultsInternal(uint32_t startIndex, uint32_t queryCount, uint64_t* results, uint32_t resultsCount, RHI::QueryResultFlagBits flags) override;
void ShutdownInternal() override;
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////

@ -204,6 +204,7 @@ namespace AZ
{
RHI::Ptr<Memory> nullMtlImagePtr = m_device->GetNullDescriptorManager().GetNullImage(shaderInputImage.m_type).GetMemory();
mtlTextures[imageArrayLen] = nullMtlImagePtr->GetGpuAddress<id<MTLTexture>>();
m_useNullDescriptorHeap = true;
}
imageArrayLen++;
}
@ -282,12 +283,16 @@ namespace AZ
{
RHI::Ptr<Memory> nullMtlBufferMemPtr = nullDescriptorManager.GetNullImageBuffer().GetMemory();
mtlTextures[bufferArrayLen] = nullMtlBufferMemPtr->GetGpuAddress<id<MTLTexture>>();
m_useNullDescriptorHeap = true;
}
else
{
RHI::Ptr<Memory> nullMtlBufferMemPtr = nullDescriptorManager.GetNullBuffer().GetMemory();
mtlBuffers[bufferArrayLen] = nullMtlBufferMemPtr->GetGpuAddress<id<MTLBuffer>>();
mtlBufferOffsets[bufferArrayLen] = nullDescriptorManager.GetNullBuffer().GetOffset();
m_resourceBindings[shaderInputBuffer.m_name].insert(
ResourceBindingData{nullMtlBufferMemPtr, .m_bufferAccess = shaderInputBuffer.m_access}
);
}
}
@ -499,5 +504,26 @@ namespace AZ
resourcesToMakeResidentMap[key].emplace(mtlResourceToBind);
}
}
bool ArgumentBuffer::IsNullHeapNeededForVertexStage(const ShaderResourceGroupVisibility& srgResourcesVisInfo) const
{
bool isUsedByVertexStage = false;
//Iterate over all the SRG entries
for (const auto& it : srgResourcesVisInfo.m_resourcesStageMask)
{
//Only the ones not added to m_resourceBindings would require null heap
if( m_resourceBindings.find(it.first) == m_resourceBindings.end())
{
isUsedByVertexStage |= RHI::CheckBitsAny(it.second, RHI::ShaderStageMask::Vertex);
}
}
return isUsedByVertexStage;
}
bool ArgumentBuffer::IsNullDescHeapNeeded() const
{
return m_useNullDescriptorHeap;
}
}
}

@ -104,6 +104,8 @@ namespace AZ
GraphicsResourcesToMakeResidentMap& resourcesToMakeResidentGraphics) const;
void ClearResourceTracking();
bool IsNullHeapNeededForVertexStage(const ShaderResourceGroupVisibility& srgResourcesVisInfo) const;
bool IsNullDescHeapNeeded() const;
//////////////////////////////////////////////////////////////////////////
// RHI::DeviceObject
@ -153,6 +155,7 @@ namespace AZ
MemoryView m_argumentBuffer;
MemoryView m_constantBuffer;
#endif
bool m_useNullDescriptorHeap = false;
};
}
}

@ -245,6 +245,8 @@ namespace AZ
bool CommandList::SetArgumentBuffers(const PipelineState* pipelineState, RHI::PipelineStateType stateType)
{
bool bindNullDescriptorHeap = false;
MTLRenderStages mtlRenderStagesForNullDescHeap = 0;
ShaderResourceBindings& bindings = GetShaderResourceBindingsByPipelineType(stateType);
const PipelineLayout& pipelineLayout = pipelineState->GetPipelineLayout();
@ -280,7 +282,8 @@ namespace AZ
uint32_t srgVisIndex = pipelineLayout.GetIndexBySlot(shaderResourceGroup->GetBindingSlot());
const RHI::ShaderStageMask& srgVisInfo = pipelineLayout.GetSrgVisibility(srgVisIndex);
const ShaderResourceGroupVisibility& srgResourcesVisInfo = pipelineLayout.GetSrgResourcesVisibility(srgVisIndex);
bool isSrgUpdatd = bindings.m_srgsByIndex[slot] != shaderResourceGroup;
if(isSrgUpdatd)
{
@ -291,6 +294,9 @@ namespace AZ
if(srgVisInfo != RHI::ShaderStageMask::None)
{
bool isNullDescHeapNeeded = compiledArgBuffer.IsNullDescHeapNeeded();
bindNullDescriptorHeap |= isNullDescHeapNeeded;
//For graphics and compute shader stages, cache all the argument buffers, offsets and track the min/max indices
if(m_commandEncoderType == CommandEncoderType::Render)
{
@ -300,7 +306,9 @@ namespace AZ
mtlVertexArgBuffers[slotIndex] = argBuffer;
mtlVertexArgBufferOffsets[slotIndex] = argBufferOffset;
bufferVertexRegisterIdMin = AZStd::min(slotIndex, bufferVertexRegisterIdMin);
bufferVertexRegisterIdMax = AZStd::max(slotIndex, bufferVertexRegisterIdMax);
bufferVertexRegisterIdMax = AZStd::max(slotIndex, bufferVertexRegisterIdMax);
mtlRenderStagesForNullDescHeap = shaderResourceGroup->IsNullHeapNeededForVertexStage(srgResourcesVisInfo) ?
mtlRenderStagesForNullDescHeap | MTLRenderStageVertex : mtlRenderStagesForNullDescHeap;
}
if( numBitsSet > 1 || srgVisInfo == RHI::ShaderStageMask::Fragment)
@ -309,6 +317,7 @@ namespace AZ
mtlFragmentOrComputeArgBufferOffsets[slotIndex] = argBufferOffset;
bufferFragmentOrComputeRegisterIdMin = AZStd::min(slotIndex, bufferFragmentOrComputeRegisterIdMin);
bufferFragmentOrComputeRegisterIdMax = AZStd::max(slotIndex, bufferFragmentOrComputeRegisterIdMax);
mtlRenderStagesForNullDescHeap = isNullDescHeapNeeded ? mtlRenderStagesForNullDescHeap | MTLRenderStageFragment : mtlRenderStagesForNullDescHeap;
}
}
else if(m_commandEncoderType == CommandEncoderType::Compute)
@ -329,7 +338,7 @@ namespace AZ
bindings.m_srgVisHashByIndex[slot] = srgResourcesVisHash;
if(srgVisInfo != RHI::ShaderStageMask::None)
{
const ShaderResourceGroupVisibility& srgResourcesVisInfo = pipelineLayout.GetSrgResourcesVisibility(srgVisIndex);
//For graphics and compute encoder make the resource resident (call UseResource) for the duration
//of the work associated with the current scope and ensure that it's in a
@ -396,6 +405,10 @@ namespace AZ
stages: key.first.second];
}
if(bindNullDescriptorHeap)
{
MakeHeapsResident(mtlRenderStagesForNullDescHeap);
}
return true;
}

@ -64,6 +64,7 @@ namespace AZ
{
[m_encoder endEncoding];
m_encoder = nil;
m_isNullDescHeapBound = false;
#if AZ_TRAIT_ATOM_METAL_COUNTER_SAMPLING
if (m_supportsInterDrawTimestamps)
{
@ -73,18 +74,25 @@ namespace AZ
}
}
void CommandListBase::MakeHeapsResident()
void CommandListBase::MakeHeapsResident(MTLRenderStages renderStages)
{
if(m_isNullDescHeapBound)
{
return;
}
switch(m_commandEncoderType)
{
case CommandEncoderType::Render:
{
id<MTLRenderCommandEncoder> renderEncoder = GetEncoder<id<MTLRenderCommandEncoder>>();
for (id<MTLHeap> residentHeap : *m_residentHeaps)
if(renderStages != 0)
{
//MTLRenderStageVertex is not added to this as it was causing an immediate gpu crash on ios (first buffer commit)
[renderEncoder useHeap : residentHeap
stages : MTLRenderStageFragment];
id<MTLRenderCommandEncoder> renderEncoder = GetEncoder<id<MTLRenderCommandEncoder>>();
for (id<MTLHeap> residentHeap : *m_residentHeaps)
{
[renderEncoder useHeap : residentHeap
stages : renderStages];
}
}
break;
}
@ -102,6 +110,7 @@ namespace AZ
AZ_Assert(false, "Encoder Type not supported");
}
}
m_isNullDescHeapBound = true;
}
void CommandListBase::CreateEncoder(CommandEncoderType encoderType)
@ -119,16 +128,12 @@ namespace AZ
m_commandEncoderType = CommandEncoderType::Render;
m_encoder = [m_mtlCommandBuffer renderCommandEncoderWithDescriptor : m_renderPassDescriptor];
m_renderPassDescriptor = nil;
MakeHeapsResident();
break;
}
case CommandEncoderType::Compute:
{
m_commandEncoderType = CommandEncoderType::Compute;
m_encoder = [m_mtlCommandBuffer computeCommandEncoder];
MakeHeapsResident();
break;
}
case CommandEncoderType::Blit:

@ -89,12 +89,14 @@ namespace AZ
/// Cache multisample state. Used mainly to validate the MSAA image descriptor against the one passed into the pipelinestate
RHI::MultisampleState m_renderPassMultiSampleState;
//! Go through all the heaps and call UseHeap on them to make them resident for the upcoming pass.
void MakeHeapsResident(MTLRenderStages renderStages);
private:
//! Go through all the heaps and call UseHeap on them to make them resident for the upcoming pass.
void MakeHeapsResident();
bool m_isEncoded = false;
bool m_isNullDescHeapBound = false;
RHI::HardwareQueueClass m_hardwareQueueClass = RHI::HardwareQueueClass::Graphics;
NSString* m_encoderScopeName = nullptr;
id <MTLCommandBuffer> m_mtlCommandBuffer = nil;

@ -126,10 +126,10 @@ namespace AZ
Device& device = static_cast<Device&>(GetDevice());
m_nullBuffer.m_name = "NULL_DESCRIPTOR_BUFFER";
m_nullBuffer.m_bufferDescriptor.m_byteCount = 64;
m_nullBuffer.m_bufferDescriptor.m_byteCount = 1024;
m_nullBuffer.m_bufferDescriptor.m_bindFlags = RHI::BufferBindFlags::ShaderWrite;
m_nullBuffer.m_memoryView = device.CreateBufferCommitted(m_nullBuffer.m_bufferDescriptor);
m_nullBuffer.m_memoryView.SetName( m_nullBuffer.m_name.c_str());
if(!m_nullBuffer.m_memoryView.IsValid())
{
AZ_Assert(false, "Couldnt create a null buffer for ArgumentTable");

@ -36,5 +36,10 @@ namespace AZ
{
GetCompiledArgumentBuffer().CollectUntrackedResources(commandEncoder, srgResourcesVisInfo, resourcesToMakeResidentCompute, resourcesToMakeResidentGraphics);
}
bool ShaderResourceGroup::IsNullHeapNeededForVertexStage(const ShaderResourceGroupVisibility& srgResourcesVisInfo) const
{
return GetCompiledArgumentBuffer().IsNullHeapNeededForVertexStage(srgResourcesVisInfo);
}
}
}

@ -47,7 +47,8 @@ namespace AZ
const ShaderResourceGroupVisibility& srgResourcesVisInfo,
ArgumentBuffer::ComputeResourcesToMakeResidentMap& resourcesToMakeResidentCompute,
ArgumentBuffer::GraphicsResourcesToMakeResidentMap& resourcesToMakeResidentGraphics) const;
bool IsNullHeapNeededForVertexStage(const ShaderResourceGroupVisibility& srgResourcesVisInfo) const;
private:
ShaderResourceGroup() = default;

@ -39,9 +39,10 @@ namespace AZ
RHI::ResultCode InitBufferInternal([[maybe_unused]] RHI::Buffer& buffer, [[maybe_unused]] const RHI::BufferDescriptor& rhiDescriptor) override{ return RHI::ResultCode::Success;}
void ShutdownResourceInternal([[maybe_unused]] RHI::Resource& resource) override {}
RHI::ResultCode OrphanBufferInternal([[maybe_unused]] RHI::Buffer& buffer) override { return RHI::ResultCode::Success;}
RHI::ResultCode MapBufferInternal([[maybe_unused]] const RHI::BufferMapRequest& mapRequest, [[maybe_unused]] RHI::BufferMapResponse& response) override { return RHI::ResultCode::Unimplemented;}
RHI::ResultCode MapBufferInternal([[maybe_unused]] const RHI::BufferMapRequest& mapRequest, [[maybe_unused]] RHI::BufferMapResponse& response) override { return RHI::ResultCode::Success;}
void UnmapBufferInternal([[maybe_unused]] RHI::Buffer& buffer) override {}
RHI::ResultCode StreamBufferInternal([[maybe_unused]] const RHI::BufferStreamRequest& request) override { return RHI::ResultCode::Success;}
void BufferCopy([[maybe_unused]] void* destination, [[maybe_unused]] const void* source, [[maybe_unused]] size_t num) override {}
//////////////////////////////////////////////////////////////////////////
};

@ -176,8 +176,7 @@ namespace AZ
return RHI::ResultCode::Success;
}
// ResultCode::Unimplemented is used by Null Renderer and hence is a valid use case
AZ_Error("Buffer", resultCode == AZ::RHI::ResultCode::Unimplemented, "Buffer::Init() failed to initialize RHI buffer. Error code: %d", static_cast<uint32_t>(resultCode));
AZ_Error("Buffer", false, "Buffer::Init() failed to initialize RHI buffer. Error code: %d", static_cast<uint32_t>(resultCode));
return resultCode;
}
@ -241,11 +240,6 @@ namespace AZ
{
return response.m_data;
}
else if (result == RHI::ResultCode::Unimplemented)
{
// ResultCode::Unimplemented is used by Null Renderer and hence is a valid use case
return nullptr;
}
else
{
AZ_Error("RPI::Buffer", false, "Failed to update RHI buffer. Error code: %d", result);

@ -136,6 +136,7 @@ namespace AZ
return false;
}
bufferPool->SetName(Name(AZStd::string::format("RPI::CommonBufferPool_%i", static_cast<uint32_t>(poolType))));
RHI::ResultCode resultCode = bufferPool->Init(*device, bufferPoolDesc);
if (resultCode != RHI::ResultCode::Success)
{

@ -31,7 +31,7 @@
#include <MaskedOcclusionCulling/MaskedOcclusionCulling.h>
#endif
//Enables more inner-loop profiling scopes (can create high overhead in RadTelemetry if there are many-many objects in a scene)
//Enables more inner-loop profiling scopes (can create high overhead in telemetry if there are many-many objects in a scene)
//#define AZ_CULL_PROFILE_DETAILED
//Enables more detailed profiling descriptions within the culling system, but adds some performance overhead.

@ -199,7 +199,6 @@ namespace AZ
if ((shaderVariantId.m_mask & option.GetBitMask()).any())
{
optionValues.push_back(option.DecodeBits(shaderVariantId.m_key));
AZ_Assert(optionValues.back() >= 0, "Invalid shader variant key");
}
else
{

@ -19,6 +19,7 @@
#include <AzFramework/Asset/AssetSystemBus.h>
#include <AzQtComponents/Application/AzQtApplication.h>
#include <AzQtComponents/Components/StyleManager.h>
#include <AzToolsFramework/API/AssetDatabaseBus.h>
#include <AzToolsFramework/API/EditorPythonConsoleBus.h>
@ -113,6 +114,8 @@ namespace AtomToolsFramework
AzToolsFramework::TraceLogger m_traceLogger;
AZStd::unique_ptr<AzQtComponents::StyleManager> m_styleManager;
//! Local user settings are used to store material browser tree expansion state
AZ::UserSettingsProvider m_localUserSettings;

@ -21,6 +21,8 @@
#include <AzFramework/Network/AssetProcessorConnection.h>
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzQtComponents/Components/GlobalEventFilter.h>
#include <AzToolsFramework/API/EditorPythonConsoleBus.h>
#include <AzToolsFramework/API/EditorPythonRunnerRequestsBus.h>
#include <AzToolsFramework/Asset/AssetSystemComponent.h>
@ -61,14 +63,26 @@ namespace AtomToolsFramework
: Application(argc, argv)
, AzQtApplication(*argc, *argv)
{
// Suppress spam from the Source Control system
m_traceLogger.AddWindowFilter(AzToolsFramework::SCC_WINDOW);
installEventFilter(new AzQtComponents::GlobalEventFilter(this));
AZ::IO::FixedMaxPath engineRootPath;
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
{
settingsRegistry->Get(engineRootPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder);
}
m_styleManager.reset(new AzQtComponents::StyleManager(this));
m_styleManager->initialize(this, engineRootPath);
connect(&m_timer, &QTimer::timeout, this, [&]()
{
this->PumpSystemEventLoopUntilEmpty();
this->Tick();
});
// Suppress spam from the Source Control system
m_traceLogger.AddWindowFilter(AzToolsFramework::SCC_WINDOW);
}
AtomToolsApplication ::~AtomToolsApplication()

@ -6,46 +6,19 @@
*
*/
#if !defined(Q_MOC_RUN)
#include <MaterialEditorApplication.h>
#include <AzCore/IO/Path/Path.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzQtComponents/Components/GlobalEventFilter.h>
#include <AzQtComponents/Components/O3DEStylesheet.h>
#include <AzQtComponents/Components/StyleManager.h>
#include <AzQtComponents/Components/StyledDockWidget.h>
#include <AzQtComponents/Components/WindowDecorationWrapper.h>
#include <AzQtComponents/Utilities/HandleDpiAwareness.h>
#include <AzQtComponents/Utilities/QtPluginPaths.h>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtWidgets/QApplication>
#endif
int main(int argc, char** argv)
{
AzQtComponents::AzQtApplication::InitializeDpiScaling();
MaterialEditor::MaterialEditorApplication app(&argc, &argv);
if (!app.LaunchLocalServer())
if (app.LaunchLocalServer())
{
return 0;
app.Start(AZ::ComponentApplication::Descriptor{});
app.exec();
app.Stop();
}
app.installEventFilter(new AzQtComponents::GlobalEventFilter(&app));
AZ::IO::FixedMaxPath engineRootPath;
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
{
settingsRegistry->Get(engineRootPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder);
}
AzQtComponents::StyleManager styleManager(&app);
styleManager.initialize(&app, engineRootPath);
app.Start(AZ::ComponentApplication::Descriptor{});
app.exec();
app.Stop();
return 0;
}

@ -6,46 +6,19 @@
*
*/
#include <AzCore/IO/Path/Path.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzQtComponents/Components/StyleManager.h>
#include <AzQtComponents/Utilities/QtPluginPaths.h>
#include <AzQtComponents/Components/GlobalEventFilter.h>
#include <AzQtComponents/Components/StyledDockWidget.h>
#include <AzQtComponents/Components/O3DEStylesheet.h>
#include <AzQtComponents/Utilities/QtPluginPaths.h>
#include <AzQtComponents/Utilities/HandleDpiAwareness.h>
#include <AzQtComponents/Components/WindowDecorationWrapper.h>
#include <AzQtComponents/Application/AzQtApplication.h>
#include <QtWidgets/QApplication>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <Source/ShaderManagementConsoleApplication.h>
#include <ShaderManagementConsoleApplication.h>
int main(int argc, char** argv)
{
AzQtComponents::AzQtApplication::InitializeDpiScaling();
ShaderManagementConsole::ShaderManagementConsoleApplication app(&argc, &argv);
if (!app.LaunchLocalServer())
if (app.LaunchLocalServer())
{
return 0;
app.Start(AZ::ComponentApplication::Descriptor{});
app.exec();
app.Stop();
}
app.installEventFilter(new AzQtComponents::GlobalEventFilter(&app));
AZ::IO::FixedMaxPath engineRootPath;
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
{
settingsRegistry->Get(engineRootPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder);
}
AzQtComponents::StyleManager styleManager(&app);
styleManager.initialize(&app, engineRootPath);
app.Start(AZ::ComponentApplication::Descriptor{});
app.exec();
app.Stop();
return 0;
}

@ -834,8 +834,10 @@ namespace AZ
{
// Check whether it should be sorted by name.
const uint32_t sortType = static_cast<uint32_t>(m_sortType);
AZ_PUSH_DISABLE_WARNING(4296, "-Wunknown-warning-option")
bool sortByName = (sortType >= static_cast<uint32_t>(ProfilerSortType::Alphabetical) &&
(sortType < static_cast<uint32_t>(ProfilerSortType::AlphabeticalCount)));
AZ_POP_DISABLE_WARNING
if (ImGui::Selectable("Pass Names", sortByName))
{
@ -1011,7 +1013,7 @@ namespace AZ
const uint32_t countNumerical = static_cast<uint32_t>(count);
const uint32_t offset = static_cast<uint32_t>(m_sortType) - startNumerical;
if (offset < countNumerical && offset >= 0u)
if (offset < countNumerical)
{
// Change the sorting order.
m_sortType = static_cast<ProfilerSortType>(((offset + 1u) % countNumerical) + startNumerical);
@ -1107,7 +1109,7 @@ namespace AZ
{
ImGui::TableSetupColumn("Parent pool");
ImGui::TableSetupColumn("Name");
ImGui::TableSetupColumn("Size (MB)", 0, 100.0f);
ImGui::TableSetupColumn("Size (MB)");
ImGui::TableSetupColumn("BindFlags", ImGuiTableColumnFlags_NoSort);
ImGui::TableHeadersRow();
ImGui::TableNextColumn();
@ -1133,7 +1135,7 @@ namespace AZ
ImGui::TableNextColumn();
ImGui::Text(tableRow.m_bufImgName.GetCStr());
ImGui::TableNextColumn();
ImGui::Text("%.2f", 1.0f * tableRow.m_sizeInBytes / GpuProfilerImGuiHelper::MB);
ImGui::Text("%.4f", 1.0f * tableRow.m_sizeInBytes / GpuProfilerImGuiHelper::MB);
ImGui::TableNextColumn();
ImGui::Text(tableRow.m_bindFlags.c_str());
ImGui::TableNextColumn();
@ -1271,6 +1273,7 @@ namespace AZ
m_nameFilter.Draw("Search");
DrawTable();
}
ImGui::End();
}
// --- ImGuiGpuProfiler ---

@ -122,7 +122,6 @@ namespace AZ
int m_currentHistoryIndex = -1; //!< The current index into the input history when browsing.
int m_maxEntriesToDisplay = DefaultMaxEntriesToDisplay; //!< The maximum entries to display.
int m_maxInputHistorySize = DefaultMaxInputHistorySize; //!< The maximum input history size.
int m_logLevelToSet = 0; //!< The minimum log level to set (see AZ::LogLevel).
bool m_isShowing = false; //!< Is the debug console currently being displayed?
bool m_autoScroll = true; //!< Should we auto-scroll as new entries are added?
bool m_forceScroll = false; //!< Do we need to force scroll after input entered?

@ -12,6 +12,7 @@
#include <platform.h>
#include <AzCore/AzCore_Traits_Platform.h>
#include <AzCore/Debug/Profiler.h>
#include <AzCore/std/containers/set.h>
#include <AzCore/std/string/conversions.h>
#include <AzCore/StringFunc/StringFunc.h>
@ -1779,8 +1780,8 @@ namespace Audio
AK::MemoryMgr::CategoryStats categoryStats;
AK::MemoryMgr::GetCategoryStats(memInfo.m_poolId, categoryStats);
memInfo.m_memoryUsed = categoryStats.uUsed;
memInfo.m_peakUsed = categoryStats.uPeakUsed;
memInfo.m_memoryUsed = static_cast<AZ::u32>(categoryStats.uUsed);
memInfo.m_peakUsed = static_cast<AZ::u32>(categoryStats.uPeakUsed);
memInfo.m_numAllocs = categoryStats.uAllocs;
memInfo.m_numFrees = categoryStats.uFrees;
}
@ -1789,9 +1790,9 @@ namespace Audio
AK::MemoryMgr::GetGlobalStats(globalStats);
auto& memInfo = m_debugMemoryInfo.back();
memInfo.m_memoryReserved = globalStats.uReserved;
memInfo.m_memoryUsed = globalStats.uUsed;
memInfo.m_peakUsed = globalStats.uMax;
memInfo.m_memoryReserved = static_cast<AZ::u32>(globalStats.uReserved);
memInfo.m_memoryUsed = static_cast<AZ::u32>(globalStats.uUsed);
memInfo.m_peakUsed = static_cast<AZ::u32>(globalStats.uMax);
// return the memory infos...
return m_debugMemoryInfo;

@ -12,6 +12,7 @@
#include <AzCore/Casting/numeric_cast.h>
#include <AzCore/IO/FileIO.h>
#include <AzCore/IO/IStreamer.h>
#include <AzCore/Debug/Profiler.h>
#include <IAudioInterfacesCommonData.h>
#include <AkPlatformFuncs_Platform.h>

@ -769,124 +769,6 @@ namespace Audio
return (eStatus == eARS_SUCCESS || eStatus == eARS_FAILURE);
}
#if !defined(AUDIO_RELEASE)
// Debug Logging Helper
AZStd::string ToString()
{
static const AZStd::unordered_map<const EAudioManagerRequestType, const AZStd::string> managerRequests
{
{ eAMRT_INIT_AUDIO_IMPL, "INIT IMPL" },
{ eAMRT_RELEASE_AUDIO_IMPL, "RELEASE IMPL" },
{ eAMRT_RESERVE_AUDIO_OBJECT_ID, "RESERVE OBJECT ID" },
{ eAMRT_CREATE_SOURCE, "CREATE SOURCE" },
{ eAMRT_DESTROY_SOURCE, "DESTROY SOURCE" },
{ eAMRT_PARSE_CONTROLS_DATA, "PARSE CONTROLS" },
{ eAMRT_PARSE_PRELOADS_DATA, "PARSE PRELOADS" },
{ eAMRT_CLEAR_CONTROLS_DATA, "CLEAR CONTROLS" },
{ eAMRT_CLEAR_PRELOADS_DATA, "CLEAR PRELOADS" },
{ eAMRT_PRELOAD_SINGLE_REQUEST, "PRELOAD SINGLE" },
{ eAMRT_UNLOAD_SINGLE_REQUEST, "UNLOAD SINGLE" },
{ eAMRT_UNLOAD_AFCM_DATA_BY_SCOPE, "UNLOAD SCOPE" },
{ eAMRT_REFRESH_AUDIO_SYSTEM, "REFRESH AUDIO SYSTEM" },
{ eAMRT_LOSE_FOCUS, "LOSE FOCUS" },
{ eAMRT_GET_FOCUS, "GET FOCUS" },
{ eAMRT_MUTE_ALL, "MUTE" },
{ eAMRT_UNMUTE_ALL, "UNMUTE" },
{ eAMRT_STOP_ALL_SOUNDS, "STOP ALL" },
{ eAMRT_DRAW_DEBUG_INFO, "DRAW DEBUG" },
{ eAMRT_CHANGE_LANGUAGE, "CHANGE LANGUAGE" },
{ eAMRT_SET_AUDIO_PANNING_MODE, "SET PANNING MODE" },
};
static const AZStd::unordered_map<const EAudioCallbackManagerRequestType, const AZStd::string> callbackRequests
{
{ eACMRT_REPORT_STARTED_EVENT, "STARTED EVENT" },
{ eACMRT_REPORT_FINISHED_EVENT, "FINISHED EVENT" },
{ eACMRT_REPORT_FINISHED_TRIGGER_INSTANCE, "FINISHED TRIGGER INSTANCE" },
};
static const AZStd::unordered_map<const EAudioListenerRequestType, const AZStd::string> listenerRequests
{
{ eALRT_SET_POSITION, "SET POSITION" },
};
static const AZStd::unordered_map<const EAudioObjectRequestType, const AZStd::string> objectRequests
{
{ eAORT_PREPARE_TRIGGER, "PREPARE TRIGGER" },
{ eAORT_UNPREPARE_TRIGGER, "UNPREPARE TRIGGER" },
{ eAORT_EXECUTE_TRIGGER, "EXECUTE TRIGGER" },
{ eAORT_STOP_TRIGGER, "STOP TRIGGER" },
{ eAORT_STOP_ALL_TRIGGERS, "STOP ALL" },
{ eAORT_SET_POSITION, "SET POSITION" },
{ eAORT_SET_RTPC_VALUE, "SET RTPC" },
{ eAORT_SET_SWITCH_STATE, "SET SWITCH" },
{ eAORT_SET_ENVIRONMENT_AMOUNT, "SET ENV AMOUNT" },
{ eAORT_RESET_ENVIRONMENTS, "RESET ENVS" },
{ eAORT_RESET_RTPCS, "RESET RTPCS" },
{ eAORT_RELEASE_OBJECT, "RELEASE OBJECT" },
{ eAORT_EXECUTE_SOURCE_TRIGGER, "EXECUTE SOURCE TRIGGER" },
{ eAORT_SET_MULTI_POSITIONS, "SET MULTI POSITIONS" },
};
std::stringstream ss;
ss << "AudioRequest(";
if (pData->eRequestType == eART_AUDIO_MANAGER_REQUEST)
{
ss << "AUDIO MANAGER : ";
auto requestStr = managerRequests.at(static_cast<const SAudioManagerRequestDataInternalBase*>(pData.get())->eType);
ss << requestStr.c_str();
}
if (pData->eRequestType == eART_AUDIO_CALLBACK_MANAGER_REQUEST)
{
ss << "AUDIO CALLBACK MGR : ";
auto requestStr = callbackRequests.at(static_cast<const SAudioCallbackManagerRequestDataInternalBase*>(pData.get())->eType);
ss << requestStr.c_str();
}
if (pData->eRequestType == eART_AUDIO_LISTENER_REQUEST)
{
ss << "AUDIO LISTENER : ";
auto requestStr = listenerRequests.at(static_cast<const SAudioListenerRequestDataInternalBase*>(pData.get())->eType);
ss << requestStr.c_str();
}
if (pData->eRequestType == eART_AUDIO_OBJECT_REQUEST)
{
ss << "AUDIO OBJECT : ";
auto requestStr = objectRequests.at(static_cast<const SAudioObjectRequestDataInternalBase*>(pData.get())->eType);
ss << requestStr.c_str();
}
ss << "): [";
if (nFlags & eARF_PRIORITY_NORMAL)
{
ss << "PRIORITY NORMAL, ";
}
if (nFlags & eARF_PRIORITY_HIGH)
{
ss << "PRIORITY HIGH, ";
}
if (nFlags & eARF_EXECUTE_BLOCKING)
{
ss << "EXECUTE BLOCKING, ";
}
if (nFlags & eARF_SYNC_CALLBACK)
{
ss << "SYNC CALLBACK, ";
}
if (nFlags & eARF_SYNC_FINISHED_CALLBACK)
{
ss << "SYNC FINISHED CALLBACK, ";
}
if (nFlags & eARF_THREAD_SAFE_PUSH)
{
ss << "THREAD SAFE PUSH, ";
}
ss << "]";
return AZStd::string(ss.str().c_str());
}
#endif // !AUDIO_RELEASE
TATLEnumFlagsType nFlags;
TAudioObjectID nAudioObjectID;
void* pOwner;

@ -616,7 +616,7 @@ namespace Audio
void CAudioSystem::ProcessRequestThreadSafe(CAudioRequestInternal request)
{
// Audio Thread!
AZ_PROFILE_SCOPE(Audio, "Thread-Safe Request: %s", request.ToString().c_str());
AZ_PROFILE_SCOPE(Audio, "Process Thread-Safe Request");
if (m_oATL.CanProcessRequests())
{
@ -641,7 +641,7 @@ namespace Audio
{
// Todo: This should handle request priority, use request priority as bus Address and process in priority order.
AZ_PROFILE_SCOPE(Audio, "Normal Request: %s", request.ToString().c_str());
AZ_PROFILE_SCOPE(Audio, "Process Normal Request");
AZ_Assert(g_mainThreadId != AZStd::this_thread::get_id(), "AudioSystem::ProcessRequestByPriority - called from Main thread!");
@ -672,7 +672,7 @@ namespace Audio
{
if (!(request.nInternalInfoFlags & eARIF_WAITING_FOR_REMOVAL))
{
AZ_PROFILE_SCOPE(Audio, "Blocking Request: %s", request.ToString().c_str());
AZ_PROFILE_SCOPE(Audio, "Process Blocking Request");
if (request.eStatus == eARS_NONE)
{

@ -147,7 +147,7 @@ namespace BarrierInput
{
inputChannelId = InputChannelIdByScanCodeTable[scanCode];
}
else if (0 <= (scanCode - 0x100) && scanCode < InputChannelIdByScanCodeWithExtendedPrefixTable.size())
else if (0x100 <= scanCode && scanCode < InputChannelIdByScanCodeWithExtendedPrefixTable.size())
{
inputChannelId = InputChannelIdByScanCodeWithExtendedPrefixTable[scanCode - 0x100];
}

@ -497,13 +497,13 @@ namespace CommandSystem
}
// verify port ranges
if (m_sourcePort >= static_cast<int32>(sourceNode->GetOutputPorts().size()) || m_sourcePort < 0)
if (m_sourcePort >= static_cast<int32>(sourceNode->GetOutputPorts().size()))
{
outResult = AZStd::string::format("The output port number is not valid for the given node. Node '%s' only has %zu output ports.", sourceNode->GetName(), sourceNode->GetOutputPorts().size());
return false;
}
if (m_targetPort >= static_cast<int32>(targetNode->GetInputPorts().size()) || m_targetPort < 0)
if (m_targetPort >= static_cast<int32>(targetNode->GetInputPorts().size()))
{
outResult = AZStd::string::format("The input port number is not valid for the given node. Node '%s' only has %zu input ports.", targetNode->GetName(), targetNode->GetInputPorts().size());
return false;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save