Merge branch 'development' into cmake/win_fix_wnew

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

# Conflicts:
#	Code/Legacy/CryCommon/Cry_Camera.h
#	Code/Legacy/CryCommon/IShader.h
This commit is contained in:
Esteban Papp
2021-08-24 10:46:18 -07:00
206 changed files with 3021 additions and 2322 deletions
@@ -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
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -69,7 +69,7 @@
{},
{},
{},
"TouchBend"
{}
]
},
"Groups": {
@@ -19,6 +19,66 @@ namespace UnitTest
using AzToolsFramework::ViewportInteraction::MouseInteractionEvent;
class ViewportMouseCursorRequestImpl : public AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Handler
{
public:
void Connect(const AzFramework::ViewportId viewportId, AzToolsFramework::QtEventToAzInputMapper* inputChannelMapper)
{
AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Handler::BusConnect(viewportId);
m_inputChannelMapper = inputChannelMapper;
}
void Disconnect()
{
AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Handler::BusDisconnect();
}
// ViewportMouseCursorRequestBus overrides ...
void BeginCursorCapture() override;
void EndCursorCapture() override;
bool IsMouseOver() const override;
private:
AzToolsFramework::QtEventToAzInputMapper* m_inputChannelMapper = nullptr;
};
void ViewportMouseCursorRequestImpl::BeginCursorCapture()
{
m_inputChannelMapper->SetCursorCaptureEnabled(true);
}
void ViewportMouseCursorRequestImpl::EndCursorCapture()
{
m_inputChannelMapper->SetCursorCaptureEnabled(false);
}
bool ViewportMouseCursorRequestImpl::IsMouseOver() const
{
return true;
}
class TestModularCameraViewportContextImpl : public AtomToolsFramework::ModularCameraViewportContext
{
public:
AZ::Transform GetCameraTransform() const override
{
return m_cameraTransform;
}
void SetCameraTransform(const AZ::Transform& transform) override
{
m_cameraTransform = transform;
}
void ConnectViewMatrixChangedHandler(AZ::RPI::ViewportContext::MatrixChangedEvent::Handler&) override
{
// noop
}
private:
AZ::Transform m_cameraTransform = AZ::Transform::CreateIdentity();
};
class ModularViewportCameraControllerFixture : public AllocatorsTestFixture
{
public:
@@ -48,123 +108,159 @@ namespace UnitTest
AllocatorsTestFixture::TearDown();
}
void PrepareCollaborators()
{
AzFramework::NativeWindowHandle nativeWindowHandle = nullptr;
// listen for events signaled from QtEventToAzInputMapper and forward to the controller list
QObject::connect(
m_inputChannelMapper.get(), &AzToolsFramework::QtEventToAzInputMapper::InputChannelUpdated, m_rootWidget.get(),
[this, nativeWindowHandle](const AzFramework::InputChannel* inputChannel, [[maybe_unused]] QEvent* event)
{
m_controllerList->HandleInputChannelEvent(
AzFramework::ViewportControllerInputEvent{ TestViewportId, nativeWindowHandle, *inputChannel });
});
m_mockWindowRequests.Connect(nativeWindowHandle);
using ::testing::Return;
// note: WindowRequests is used internally by ModularViewportCameraController, this ensures it returns the viewport size we want
ON_CALL(m_mockWindowRequests, GetClientAreaSize())
.WillByDefault(Return(AzFramework::WindowSize(WidgetSize.width(), WidgetSize.height())));
// respond to begin/end cursor capture events
m_viewportMouseCursorRequests.Connect(TestViewportId, m_inputChannelMapper.get());
// create editor modular camera
auto controller = CreateModularViewportCameraController(TestViewportId);
// set some overrides for the test
controller->SetCameraViewportContextBuilderCallback(
[this](AZStd::unique_ptr<AtomToolsFramework::ModularCameraViewportContext>& cameraViewportContext)
{
cameraViewportContext = AZStd::make_unique<TestModularCameraViewportContextImpl>();
m_cameraViewportContextView = cameraViewportContext.get();
});
// disable smoothing in the test
controller->SetCameraPropsBuilderCallback(
[](AzFramework::CameraProps& cameraProps)
{
cameraProps.m_rotateSmoothingEnabledFn = []
{
return false;
};
cameraProps.m_translateSmoothingEnabledFn = []
{
return false;
};
});
m_controllerList->Add(controller);
}
void HaltCollaborators()
{
m_mockWindowRequests.Disconnect();
m_viewportMouseCursorRequests.Disconnect();
m_cameraViewportContextView = nullptr;
}
void RepeatDiagonalMouseMovements(const AZStd::function<float()>& deltaTimeFn)
{
// move to the center of the screen
auto start = QPoint(WidgetSize.width() / 2, WidgetSize.height() / 2);
MouseMove(m_rootWidget.get(), start, QPoint(0, 0));
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTimeFn()), AZ::ScriptTimePoint() });
// move mouse diagonally to top right, then to bottom left and back repeatedly
auto current = start;
auto halfDelta = QPoint(200, -200);
const int iterationsPerDiagonal = 50;
for (int diagonals = 0; diagonals < 80; ++diagonals)
{
for (int i = 0; i < iterationsPerDiagonal; ++i)
{
MousePressAndMove(m_rootWidget.get(), current, halfDelta / iterationsPerDiagonal, Qt::MouseButton::RightButton);
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTimeFn()), AZ::ScriptTimePoint() });
current += halfDelta / iterationsPerDiagonal;
}
if (diagonals % 2 == 0)
{
halfDelta.setX(halfDelta.x() * -1);
halfDelta.setY(halfDelta.y() * -1);
}
}
QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::RightButton, Qt::KeyboardModifier::NoModifier, current);
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTimeFn()), AZ::ScriptTimePoint() });
}
AZStd::unique_ptr<QWidget> m_rootWidget;
AzFramework::ViewportControllerListPtr m_controllerList;
AZStd::unique_ptr<AzToolsFramework::QtEventToAzInputMapper> m_inputChannelMapper;
::testing::NiceMock<MockWindowRequests> m_mockWindowRequests;
ViewportMouseCursorRequestImpl m_viewportMouseCursorRequests;
AtomToolsFramework::ModularCameraViewportContext* m_cameraViewportContextView = nullptr;
};
const AzFramework::ViewportId ModularViewportCameraControllerFixture::TestViewportId = AzFramework::ViewportId(0);
class TestModularCameraViewportContextImpl : public AtomToolsFramework::ModularCameraViewportContext
TEST_F(ModularViewportCameraControllerFixture, MouseMovementDoesNotAccumulateExcessiveDriftInModularViewportCameraWithVaryingDeltaTime)
{
public:
AZ::Transform GetCameraTransform() const override
{
return m_cameraTransform;
}
void SetCameraTransform(const AZ::Transform& transform) override
{
m_cameraTransform = transform;
}
void ConnectViewMatrixChangedHandler(AZ::RPI::ViewportContext::MatrixChangedEvent::Handler&) override
{
// noop
}
private:
AZ::Transform m_cameraTransform = AZ::Transform::CreateIdentity();
};
TEST_F(ModularViewportCameraControllerFixture, Mouse_movement_does_not_accumulate_excessive_drift_in_modular_viewport_camera)
{
AzFramework::NativeWindowHandle nativeWindowHandle = nullptr;
const float deltaTime = 1.0f / 60.0f; // mimic 60fps
// Given
// listen for events signaled from QtEventToAzInputMapper and forward to the controller list
QObject::connect(
m_inputChannelMapper.get(), &AzToolsFramework::QtEventToAzInputMapper::InputChannelUpdated, m_rootWidget.get(),
[this, nativeWindowHandle](const AzFramework::InputChannel* inputChannel, [[maybe_unused]] QEvent* event)
{
m_controllerList->HandleInputChannelEvent(
AzFramework::ViewportControllerInputEvent{ TestViewportId, nativeWindowHandle, *inputChannel });
});
using ::testing::NiceMock;
using ::testing::Return;
NiceMock<MockWindowRequests> mockWindowRequests;
mockWindowRequests.Connect(nativeWindowHandle);
// note: WindowRequests is used internally by ModularViewportCameraController, this ensures it returns the viewport size we want
ON_CALL(mockWindowRequests, GetClientAreaSize())
.WillByDefault(Return(AzFramework::WindowSize(WidgetSize.width(), WidgetSize.height())));
// create editor modular camera
auto controller = CreateModularViewportCameraController(TestViewportId);
// set some overrides for the test
AtomToolsFramework::ModularCameraViewportContext* cameraViewportContextView = nullptr;
controller->SetCameraViewportContextBuilderCallback(
[&cameraViewportContextView](AZStd::unique_ptr<AtomToolsFramework::ModularCameraViewportContext>& cameraViewportContext)
{
cameraViewportContext = AZStd::make_unique<TestModularCameraViewportContextImpl>();
cameraViewportContextView = cameraViewportContext.get();
});
controller->SetCameraPropsBuilderCallback(
[](AzFramework::CameraProps& cameraProps)
{
cameraProps.m_rotateSmoothingEnabledFn = []
{
return false;
};
cameraProps.m_translateSmoothingEnabledFn = []
{
return false;
};
});
m_controllerList->Add(controller);
// move to the center of the screen
auto start = QPoint(WidgetSize.width() / 2, WidgetSize.height() / 2);
MouseMove(m_rootWidget.get(), start, QPoint(0, 0));
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() });
PrepareCollaborators();
// When
// move mouse diagonally to top right, then to bottom left and back repeatedly
auto current = start;
auto halfDelta = QPoint(200, -200);
const int iterationsPerDiagonal = 50;
for (int diagonals = 0; diagonals < 80; ++diagonals)
{
for (int i = 0; i < iterationsPerDiagonal; ++i)
RepeatDiagonalMouseMovements(
[t = 0.0f]() mutable
{
MousePressAndMove(m_rootWidget.get(), current, halfDelta / iterationsPerDiagonal, Qt::MouseButton::RightButton);
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() });
current += halfDelta / iterationsPerDiagonal;
}
if (diagonals % 2 == 0)
{
halfDelta.setX(halfDelta.x() * -1);
halfDelta.setY(halfDelta.y() * -1);
}
}
QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::RightButton, Qt::KeyboardModifier::NoModifier, current);
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() });
// vary between 30 and 50 fps (40 +/- 10)
const float fps = 40.0f + (10.0f * AZStd::sin(t));
t += AZ::DegToRad(5.0f);
return 1.0f / fps;
});
// Then
// ensure the camera rotation is the identity (no significant drift has occurred as we moved the mouse)
const AZ::Transform cameraRotation = cameraViewportContextView->GetCameraTransform();
const AZ::Transform cameraRotation = m_cameraViewportContextView->GetCameraTransform();
EXPECT_THAT(cameraRotation.GetRotation(), IsClose(AZ::Quaternion::CreateIdentity()));
mockWindowRequests.Disconnect();
// Clean-up
HaltCollaborators();
}
class ModularViewportCameraControllerDeltaTimeParamFixture
: public ModularViewportCameraControllerFixture
, public ::testing::WithParamInterface<float> // delta time
{
};
TEST_P(
ModularViewportCameraControllerDeltaTimeParamFixture,
MouseMovementDoesNotAccumulateExcessiveDriftInModularViewportCameraWithFixedDeltaTime)
{
// Given
PrepareCollaborators();
// When
RepeatDiagonalMouseMovements(
[this]
{
return GetParam();
});
// Then
// ensure the camera rotation is the identity (no significant drift has occurred as we moved the mouse)
const AZ::Transform cameraRotation = m_cameraViewportContextView->GetCameraTransform();
EXPECT_THAT(cameraRotation.GetRotation(), IsClose(AZ::Quaternion::CreateIdentity()));
// Clean-up
HaltCollaborators();
}
INSTANTIATE_TEST_CASE_P(
All, ModularViewportCameraControllerDeltaTimeParamFixture, testing::Values(1.0f / 60.0f, 1.0f / 50.0f, 1.0f / 30.0f));
} // namespace UnitTest
@@ -12,29 +12,29 @@ namespace AZ
{
namespace Simd
{
static AZ_ALIGN(constexpr float g_sinCoef1[4], 16) = { -0.0001950727f, -0.0001950727f, -0.0001950727f, -0.0001950727f };
static AZ_ALIGN(constexpr float g_sinCoef2[4], 16) = { 0.0083320758f, 0.0083320758f, 0.0083320758f, 0.0083320758f };
static AZ_ALIGN(constexpr float g_sinCoef3[4], 16) = { -0.1666665247f, -0.1666665247f, -0.1666665247f, -0.1666665247f };
static AZ_ALIGN(constexpr float g_cosCoef1[4], 16) = { -0.0013602249f, -0.0013602249f, -0.0013602249f, -0.0013602249f };
static AZ_ALIGN(constexpr float g_cosCoef2[4], 16) = { 0.0416566950f, 0.0416566950f, 0.0416566950f, 0.0416566950f };
static AZ_ALIGN(constexpr float g_cosCoef3[4], 16) = { -0.4999990225f, -0.4999990225f, -0.4999990225f, -0.4999990225f };
static AZ_ALIGN(constexpr float g_acosHiCoef1[4], 16) = { -0.0012624911f, -0.0012624911f, -0.0012624911f, -0.0012624911f };
static AZ_ALIGN(constexpr float g_acosHiCoef2[4], 16) = { 0.0066700901f, 0.0066700901f, 0.0066700901f, 0.0066700901f };
static AZ_ALIGN(constexpr float g_acosHiCoef3[4], 16) = { -0.0170881256f, -0.0170881256f, -0.0170881256f, -0.0170881256f };
static AZ_ALIGN(constexpr float g_acosHiCoef4[4], 16) = { 0.0308918810f, 0.0308918810f, 0.0308918810f, 0.0308918810f };
static AZ_ALIGN(constexpr float g_acosLoCoef1[4], 16) = { -0.0501743046f, -0.0501743046f, -0.0501743046f, -0.0501743046f };
static AZ_ALIGN(constexpr float g_acosLoCoef2[4], 16) = { 0.0889789874f, 0.0889789874f, 0.0889789874f, 0.0889789874f };
static AZ_ALIGN(constexpr float g_acosLoCoef3[4], 16) = { -0.2145988016f, -0.2145988016f, -0.2145988016f, -0.2145988016f };
static AZ_ALIGN(constexpr float g_acosLoCoef4[4], 16) = { 1.5707963050f, 1.5707963050f, 1.5707963050f, 1.5707963050f };
static AZ_ALIGN(constexpr float g_acosCoef1[4], 16) = { -0.0200752200f, -0.0200752200f, -0.0200752200f, -0.0200752200f };
static AZ_ALIGN(constexpr float g_acosCoef2[4], 16) = { 0.0759031500f, 0.0759031500f, 0.0759031500f, 0.0759031500f };
static AZ_ALIGN(constexpr float g_acosCoef3[4], 16) = { -0.2126757000f, -0.2126757000f, -0.2126757000f, -0.2126757000f };
static AZ_ALIGN(constexpr float g_atanHiRange[4], 16) = { 2.4142135624f, 2.4142135624f, 2.4142135624f, 2.4142135624f };
static AZ_ALIGN(constexpr float g_atanLoRange[4], 16) = { 0.4142135624f, 0.4142135624f, 0.4142135624f, 0.4142135624f };
static AZ_ALIGN(constexpr float g_atanCoef1[4], 16) = { 8.05374449538e-2f, 8.05374449538e-2f, 8.05374449538e-2f, 8.05374449538e-2f };
static AZ_ALIGN(constexpr float g_atanCoef2[4], 16) = { -1.38776856032e-1f, -1.38776856032e-1f, -1.38776856032e-1f, -1.38776856032e-1f };
static AZ_ALIGN(constexpr float g_atanCoef3[4], 16) = { 1.99777106478e-1f, 1.99777106478e-1f, 1.99777106478e-1f, 1.99777106478e-1f };
static AZ_ALIGN(constexpr float g_atanCoef4[4], 16) = { -3.33329491539e-1f, -3.33329491539e-1f, -3.33329491539e-1f, -3.33329491539e-1f };
alignas(16) static constexpr float g_sinCoef1[4] = { -0.0001950727f, -0.0001950727f, -0.0001950727f, -0.0001950727f };
alignas(16) static constexpr float g_sinCoef2[4] = { 0.0083320758f, 0.0083320758f, 0.0083320758f, 0.0083320758f };
alignas(16) static constexpr float g_sinCoef3[4] = { -0.1666665247f, -0.1666665247f, -0.1666665247f, -0.1666665247f };
alignas(16) static constexpr float g_cosCoef1[4] = { -0.0013602249f, -0.0013602249f, -0.0013602249f, -0.0013602249f };
alignas(16) static constexpr float g_cosCoef2[4] = { 0.0416566950f, 0.0416566950f, 0.0416566950f, 0.0416566950f };
alignas(16) static constexpr float g_cosCoef3[4] = { -0.4999990225f, -0.4999990225f, -0.4999990225f, -0.4999990225f };
alignas(16) static constexpr float g_acosHiCoef1[4] = { -0.0012624911f, -0.0012624911f, -0.0012624911f, -0.0012624911f };
alignas(16) static constexpr float g_acosHiCoef2[4] = { 0.0066700901f, 0.0066700901f, 0.0066700901f, 0.0066700901f };
alignas(16) static constexpr float g_acosHiCoef3[4] = { -0.0170881256f, -0.0170881256f, -0.0170881256f, -0.0170881256f };
alignas(16) static constexpr float g_acosHiCoef4[4] = { 0.0308918810f, 0.0308918810f, 0.0308918810f, 0.0308918810f };
alignas(16) static constexpr float g_acosLoCoef1[4] = { -0.0501743046f, -0.0501743046f, -0.0501743046f, -0.0501743046f };
alignas(16) static constexpr float g_acosLoCoef2[4] = { 0.0889789874f, 0.0889789874f, 0.0889789874f, 0.0889789874f };
alignas(16) static constexpr float g_acosLoCoef3[4] = { -0.2145988016f, -0.2145988016f, -0.2145988016f, -0.2145988016f };
alignas(16) static constexpr float g_acosLoCoef4[4] = { 1.5707963050f, 1.5707963050f, 1.5707963050f, 1.5707963050f };
alignas(16) static constexpr float g_acosCoef1[4] = { -0.0200752200f, -0.0200752200f, -0.0200752200f, -0.0200752200f };
alignas(16) static constexpr float g_acosCoef2[4] = { 0.0759031500f, 0.0759031500f, 0.0759031500f, 0.0759031500f };
alignas(16) static constexpr float g_acosCoef3[4] = { -0.2126757000f, -0.2126757000f, -0.2126757000f, -0.2126757000f };
alignas(16) static constexpr float g_atanHiRange[4] = { 2.4142135624f, 2.4142135624f, 2.4142135624f, 2.4142135624f };
alignas(16) static constexpr float g_atanLoRange[4] = { 0.4142135624f, 0.4142135624f, 0.4142135624f, 0.4142135624f };
alignas(16) static constexpr float g_atanCoef1[4] = { 8.05374449538e-2f, 8.05374449538e-2f, 8.05374449538e-2f, 8.05374449538e-2f };
alignas(16) static constexpr float g_atanCoef2[4] = { -1.38776856032e-1f, -1.38776856032e-1f, -1.38776856032e-1f, -1.38776856032e-1f };
alignas(16) static constexpr float g_atanCoef3[4] = { 1.99777106478e-1f, 1.99777106478e-1f, 1.99777106478e-1f, 1.99777106478e-1f };
alignas(16) static constexpr float g_atanCoef4[4] = { -3.33329491539e-1f, -3.33329491539e-1f, -3.33329491539e-1f, -3.33329491539e-1f };
namespace Common
{
+18 -18
View File
@@ -24,24 +24,24 @@ namespace AZ
{
namespace Simd
{
static AZ_ALIGN(constexpr float g_vec1111[4], 16) = { 1.0f, 1.0f, 1.0f, 1.0f };
static AZ_ALIGN(constexpr float g_vec1000[4], 16) = { 1.0f, 0.0f, 0.0f, 0.0f };
static AZ_ALIGN(constexpr float g_vec0100[4], 16) = { 0.0f, 1.0f, 0.0f, 0.0f };
static AZ_ALIGN(constexpr float g_vec0010[4], 16) = { 0.0f, 0.0f, 1.0f, 0.0f };
static AZ_ALIGN(constexpr float g_vec0001[4], 16) = { 0.0f, 0.0f, 0.0f, 1.0f };
static AZ_ALIGN(constexpr float g_Pi[4], 16) = { Constants::Pi, Constants::Pi, Constants::Pi, Constants::Pi };
static AZ_ALIGN(constexpr float g_TwoPi[4], 16) = { Constants::TwoPi, Constants::TwoPi, Constants::TwoPi, Constants::TwoPi };
static AZ_ALIGN(constexpr float g_HalfPi[4], 16) = { Constants::HalfPi, Constants::HalfPi, Constants::HalfPi, Constants::HalfPi };
static AZ_ALIGN(constexpr float g_QuarterPi[4], 16) = { Constants::QuarterPi, Constants::QuarterPi, Constants::QuarterPi, Constants::QuarterPi };
static AZ_ALIGN(constexpr float g_TwoOverPi[4], 16) = { Constants::TwoOverPi, Constants::TwoOverPi, Constants::TwoOverPi, Constants::TwoOverPi };
static AZ_ALIGN(constexpr int32_t g_absMask[4], 16) = { (int32_t)0x7fffffff, (int32_t)0x7fffffff, (int32_t)0x7fffffff, (int32_t)0x7fffffff };
static AZ_ALIGN(constexpr int32_t g_negateMask[4], 16) = { (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x80000000 };
static AZ_ALIGN(constexpr int32_t g_negateXMask[4], 16) = { (int32_t)0x80000000, (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x00000000 };
static AZ_ALIGN(constexpr int32_t g_negateYMask[4], 16) = { (int32_t)0x00000000, (int32_t)0x80000000, (int32_t)0x00000000, (int32_t)0x00000000 };
static AZ_ALIGN(constexpr int32_t g_negateZMask[4], 16) = { (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x80000000, (int32_t)0x00000000 };
static AZ_ALIGN(constexpr int32_t g_negateWMask[4], 16) = { (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x80000000 };
static AZ_ALIGN(constexpr int32_t g_negateXYZMask[4], 16) = { (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x00000000 };
static AZ_ALIGN(constexpr int32_t g_wMask[4], 16) = { (int32_t)0xffffffff, (int32_t)0xffffffff, (int32_t)0xffffffff, (int32_t)0x00000000 };
alignas(16) static constexpr float g_vec1111[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
alignas(16) static constexpr float g_vec1000[4] = { 1.0f, 0.0f, 0.0f, 0.0f };
alignas(16) static constexpr float g_vec0100[4] = { 0.0f, 1.0f, 0.0f, 0.0f };
alignas(16) static constexpr float g_vec0010[4] = { 0.0f, 0.0f, 1.0f, 0.0f };
alignas(16) static constexpr float g_vec0001[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
alignas(16) static constexpr float g_Pi[4] = { Constants::Pi, Constants::Pi, Constants::Pi, Constants::Pi };
alignas(16) static constexpr float g_TwoPi[4] = { Constants::TwoPi, Constants::TwoPi, Constants::TwoPi, Constants::TwoPi };
alignas(16) static constexpr float g_HalfPi[4] = { Constants::HalfPi, Constants::HalfPi, Constants::HalfPi, Constants::HalfPi };
alignas(16) static constexpr float g_QuarterPi[4] = { Constants::QuarterPi, Constants::QuarterPi, Constants::QuarterPi, Constants::QuarterPi };
alignas(16) static constexpr float g_TwoOverPi[4] = { Constants::TwoOverPi, Constants::TwoOverPi, Constants::TwoOverPi, Constants::TwoOverPi };
alignas(16) static constexpr int32_t g_absMask[4] = { (int32_t)0x7fffffff, (int32_t)0x7fffffff, (int32_t)0x7fffffff, (int32_t)0x7fffffff };
alignas(16) static constexpr int32_t g_negateMask[4] = { (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x80000000 };
alignas(16) static constexpr int32_t g_negateXMask[4] = { (int32_t)0x80000000, (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x00000000 };
alignas(16) static constexpr int32_t g_negateYMask[4] = { (int32_t)0x00000000, (int32_t)0x80000000, (int32_t)0x00000000, (int32_t)0x00000000 };
alignas(16) static constexpr int32_t g_negateZMask[4] = { (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x80000000, (int32_t)0x00000000 };
alignas(16) static constexpr int32_t g_negateWMask[4] = { (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x80000000 };
alignas(16) static constexpr int32_t g_negateXYZMask[4] = { (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x00000000 };
alignas(16) static constexpr int32_t g_wMask[4] = { (int32_t)0xffffffff, (int32_t)0xffffffff, (int32_t)0xffffffff, (int32_t)0x00000000 };
}
}
+1 -1
View File
@@ -174,7 +174,7 @@ namespace AZ
}
// or _m128i and VMX ???
AZ_ALIGN(unsigned char data[16], 16);
alignas(16) unsigned char data[16];
};
} // namespace AZ
@@ -88,15 +88,6 @@
# define AZ_FORCE_INLINE __forceinline
/// Aligns a declaration.
# define AZ_ALIGN(_decl, _alignment) \
AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option") \
__declspec(align(_alignment)) \
_decl \
AZ_POP_DISABLE_WARNING
/// Return the alignment of a type. This if for internal use only (use AZStd::alignment_of<>())
# define AZ_INTERNAL_ALIGNMENT_OF(_type) __alignof(_type)
/// Pointer will be aliased.
# define AZ_MAY_ALIAS
/// Function signature macro
@@ -120,15 +111,7 @@
#define AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
# define AZ_FORCE_INLINE inline
/// Aligns a declaration.
# define AZ_ALIGN(_decl, _alignment) \
AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option") \
_decl \
__attribute__((aligned(_alignment)))
AZ_POP_DISABLE_WARNING
/// Return the alignment of a type. This if for internal use only (use AZStd::alignment_of<>())
# define AZ_INTERNAL_ALIGNMENT_OF(_type) __alignof__(_type)
/// Pointer will be aliased.
# define AZ_MAY_ALIAS __attribute__((__may_alias__))
/// Function signature macro
@@ -162,7 +162,7 @@ namespace UnitTest
struct CreationCounter
{
AZ_TYPE_INFO(CreationCounter, "{E9E35486-4366-4066-86E5-1A8CEB44198B}");
AZ_ALIGN(int test[size / sizeof(int)], alignment);
alignas(alignment) int test[size / sizeof(int)];
static int s_count;
static int s_copied;
+1 -1
View File
@@ -384,7 +384,7 @@ namespace AZStd
*/
union
{
AZ_ALIGN(char m_buffer[Internal::ANY_SBO_BUF_SIZE], 32); // Used for objects smaller than SBO_BUF_SIZE
alignas(32) char m_buffer[Internal::ANY_SBO_BUF_SIZE]; // Used for objects smaller than SBO_BUF_SIZE
void* m_pointer; // Pointer to large objects
};
type_info m_typeInfo;
@@ -164,7 +164,7 @@ namespace AZStd
//enough.
struct Node
{
AZ_ALIGN(T m_value, 64); //alignment to avoid cache line sharing
alignas(64) T m_value; //alignment to avoid cache line sharing
thread::id m_threadId;
Node* m_next;
};
@@ -21,7 +21,7 @@ namespace AZStd
template<typename T>
struct lock_free_stamped_node_ptr
{
AZ_ALIGN(struct lock_free_stamped_queue_node<T>* m_node, 8);
alignas(8) struct lock_free_stamped_queue_node<T>* m_node;
unsigned int m_stamp;
};
@@ -1073,7 +1073,7 @@ cleanup:
}
HANDLE hThread = nativeThread;
AZ_ALIGN(CONTEXT context, 8); // Without this alignment the function randomly crashes in release.
CONTEXT alignas(8) context; // Without this alignment the function randomly crashes in release.
context.ContextFlags = CONTEXT_ALL;
GetThreadContext(hThread, &context);
@@ -56,7 +56,7 @@ namespace UnitTestInternal
}
// We use this class on the stack often, so alignment more than 16 bytes will not work on all platforms.
AZ_ALIGN(int m_data, 16);
alignas(16) int m_data;
bool m_isMoved;
};
+1 -1
View File
@@ -982,7 +982,7 @@ namespace UnitTest
: m_data(data) {}
~MyClass() {}
AZ_ALIGN(int m_data, 32);
alignas(32) int m_data;
};
// Explicitly doesn't have AZ_CLASS_ALLOCATOR
class MyDerivedClass
+1 -1
View File
@@ -86,7 +86,7 @@ namespace UnitTest
struct Aligned16
{
AZ_ALIGN(char m_data, 16);
alignas(16) char m_data;
};
//! Class that changes a value when it's created and destroyed.
@@ -35,6 +35,7 @@ namespace AzFramework
//! Predefined input event listener priority, used to sort handlers from highest to lowest
inline static AZ::s32 GetPriorityFirst() { return std::numeric_limits<AZ::s32>::max(); }
inline static AZ::s32 GetPriorityDebug() { return (GetPriorityFirst() / 4) * 3; }
inline static AZ::s32 GetPriorityDebugUI() { return (GetPriorityFirst() / 8) * 5; }
inline static AZ::s32 GetPriorityUI() { return GetPriorityFirst() / 2; }
inline static AZ::s32 GetPriorityDefault() { return 0; }
inline static AZ::s32 GetPriorityLast() { return std::numeric_limits<AZ::s32>::min(); }
@@ -28,6 +28,7 @@ namespace AzFramework
//! Predefined text event listener priority, used to sort handlers from highest to lowest
inline static AZ::s32 GetPriorityFirst() { return std::numeric_limits<AZ::s32>::max(); }
inline static AZ::s32 GetPriorityDebug() { return (GetPriorityFirst() / 4) * 3; }
inline static AZ::s32 GetPriorityDebugUI() { return (GetPriorityFirst() / 8) * 5; }
inline static AZ::s32 GetPriorityUI() { return GetPriorityFirst() / 2; }
inline static AZ::s32 GetPriorityDefault() { return 0; }
inline static AZ::s32 GetPriorityLast() { return std::numeric_limits<AZ::s32>::min(); }
@@ -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();
@@ -321,5 +309,12 @@ namespace AzPhysics
group.SetLayer(layer, true);
return group;
}
CollisionGroup GetCollisionGroupById(const CollisionGroups::Id& id)
{
CollisionGroup group;
Physics::CollisionRequestBus::BroadcastResult(group, &Physics::CollisionRequests::GetCollisionGroupById, id);
return group;
}
}
@@ -34,7 +34,6 @@ namespace AzPhysics
static const CollisionGroup None; //!< Collide with nothing
static const CollisionGroup All; //!< Collide with everything
static const CollisionGroup All_NoTouchBend; //!< Collide with everything, except Touch Bendable Vegetation.
//! Construct a Group with the given bitmask.
//! The each bit in the bitmask corresponds to a CollisionLayer.
@@ -174,4 +173,9 @@ namespace AzPhysics
private:
AZStd::vector<Preset> m_groups;
};
//! Retrieves a Group with the given Id of a collision group.
//! This will lookup the group Id to retrieve the group mask. If not found, CollisionGroup::All is returned.
//! @param id The Id of the group to look up the group mask.
CollisionGroup GetCollisionGroupById(const CollisionGroups::Id& id);
}
@@ -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))
@@ -31,7 +31,6 @@ namespace AzPhysics
static void Reflect(AZ::ReflectContext* context);
static const CollisionLayer Default; //!< Default collision layer, 0.
static const CollisionLayer TouchBend; //!< Touch Bendable Vegetation collision layer.
//! Construct a layer with the given index.
//! @param index The index of the layer. Must be between 0 - CollisionLayers::MaxCollisionLayers. Default CollisionLayer::Default.
@@ -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; }
};
}
@@ -802,7 +802,6 @@ namespace AzFramework
{
return VerticalMotionEvent{ aznumeric_cast<int>(inputChannel.GetValue()) };
}
else if (inputChannelId == InputDeviceMouse::Movement::Z)
{
return ScrollEvent{ inputChannel.GetValue() };
-10
View File
@@ -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})
@@ -650,7 +650,10 @@ namespace AzToolsFramework
AZStd::unique_ptr<AZ::Entity> Instance::DetachContainerEntity()
{
m_instanceEntityMapper->UnregisterEntity(m_containerEntity->GetId());
if (m_containerEntity)
{
m_instanceEntityMapper->UnregisterEntity(m_containerEntity->GetId());
}
return AZStd::move(m_containerEntity);
}
}
@@ -65,16 +65,24 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils
AzFramework::Spawnable::EntityList& entities = spawnable->GetEntities();
for (auto it = entities.begin(); it != entities.end(); )
{
(*it)->InvalidateDependencies();
AZ::Entity::DependencySortOutcome evaluation = (*it)->EvaluateDependenciesGetDetails();
if (evaluation.IsSuccess())
if (*it)
{
++it;
(*it)->InvalidateDependencies();
AZ::Entity::DependencySortOutcome evaluation = (*it)->EvaluateDependenciesGetDetails();
if (evaluation.IsSuccess())
{
++it;
}
else
{
AZ_Error(
"Prefabs", false, "Entity '%s' %s cannot be activated for the following reason: %s", (*it)->GetName().c_str(),
(*it)->GetId().ToString().c_str(), evaluation.GetError().m_message.c_str());
it = entities.erase(it);
}
}
else
{
AZ_Error("Prefabs", false, "Entity '%s' %s cannot be activated for the following reason: %s",
(*it)->GetName().c_str(), (*it)->GetId().ToString().c_str(), evaluation.GetError().m_message.c_str());
it = entities.erase(it);
}
}
@@ -275,9 +275,7 @@ namespace AzToolsFramework
virtual void BeginCursorCapture() = 0;
//! Restores the cursor and ends locking it in place, allowing it to be moved freely.
virtual void EndCursorCapture() = 0;
//! Gets the most recent recorded cursor position in the viewport in screen space coordinates.
virtual AzFramework::ScreenPoint ViewportCursorScreenPosition() = 0;
//! Is mouse over viewport.
//! Is the mouse over the viewport.
virtual bool IsMouseOver() const = 0;
protected:
-3
View File
@@ -109,9 +109,6 @@ typedef unsigned char byte;
#define INVALID_FILE_ATTRIBUTES (-1)
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
type __attribute__ ((aligned(alignment))) name;
#include "LinuxSpecific.h"
// these functions do not exist int the wchar.h header
#undef wscasecomp
-7
View File
@@ -126,10 +126,6 @@ typedef uint8 byte;
#define STDMETHODCALLTYPE
#endif
#define _ALIGN(num) \
__attribute__ ((aligned(num))) \
AZ_POP_DISABLE_WARNING
#define _PACK __attribute__ ((packed))
// Safe memory freeing
@@ -265,9 +261,6 @@ typedef union _LARGE_INTEGER
#define INVALID_FILE_ATTRIBUTES (-1)
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
type __attribute__ ((aligned(alignment))) name;
#define BST_UNCHECKED 0x0000
#ifndef HRESULT_VALUES_DEFINED
+1 -1
View File
@@ -2146,7 +2146,7 @@ inline uint8 CCamera::IsOBBVisible_EH(const Vec3& wpos, const OBB& obb, f32 usca
//--- ADDITIONAL-TEST ---
//------------------------------------------------------------------------------
extern _MS_ALIGN(64) uint32 BoxSides[] _ALIGN(64);
alignas(64) extern uint32 BoxSides[];
// Description:
// A box can easily straddle one of the view-frustum planes far
-1
View File
@@ -1243,7 +1243,6 @@ struct Matrix33_tpl
typedef Matrix33_tpl<f32> Matrix33; //always 32 bit
typedef Matrix33_tpl<f64> Matrix33d; //always 64 bit
typedef Matrix33_tpl<real> Matrix33r; //variable float precision. depending on the target system it can be between 32, 64 or 80 bit
typedef _MS_ALIGN(16) Matrix33_tpl<f32> _ALIGN (16) Matrix33A;
//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
+5 -1
View File
@@ -1224,7 +1224,11 @@ struct Matrix34_tpl
typedef Matrix34_tpl<f32> Matrix34; //always 32 bit
typedef Matrix34_tpl<f64> Matrix34d;//always 64 bit
typedef Matrix34_tpl<real> Matrix34r;//variable float precision. depending on the target system it can be between 32, 64 or bit
typedef _MS_ALIGN(16) Matrix34_tpl<f32> _ALIGN (16) Matrix34A;
#if AZ_COMPILER_MSVC
typedef __declspec(align(16)) Matrix34_tpl<f32> Matrix34A;
#elif AZ_COMPILER_CLANG
typedef Matrix34_tpl<f32> __attribute__((aligned(16))) Matrix34A;
#endif
//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
+5 -1
View File
@@ -666,7 +666,11 @@ struct Matrix44_tpl
typedef Matrix44_tpl<f32> Matrix44; //always 32 bit
typedef Matrix44_tpl<f64> Matrix44d; //always 64 bit
typedef Matrix44_tpl<real> Matrix44r; //variable float precision. depending on the target system it can be between 32, 64 or 80 bit
typedef _MS_ALIGN(16) Matrix44_tpl<f32> _ALIGN (16) Matrix44A;
#if AZ_COMPILER_MSVC
typedef __declspec(align(16)) Matrix44_tpl<f32> Matrix44A;
#elif AZ_COMPILER_CLANG
typedef Matrix44_tpl<f32> __attribute__((aligned(16))) Matrix44A;
#endif
//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
-22
View File
@@ -908,14 +908,6 @@ typedef Quat_tpl<f32> CryQuat;
typedef Quat_tpl<f32> quaternionf;
typedef Quat_tpl<real> quaternion;
// alligned versions
#ifndef MAX_API_NUM
typedef DEFINE_ALIGNED_DATA (Quat, QuatA, 16); // typedef __declspec(align(16)) Quat_tpl<f32> CryQuatA;
typedef DEFINE_ALIGNED_DATA (Quatd, QuatrA, 32); // typedef __declspec(align(16)) Quat_tpl<f32> quaternionfA;
#endif
/*!
*
* The "inner product" or "dot product" operation.
@@ -1425,11 +1417,6 @@ typedef QuatT_tpl<f32> QuatT; //always 32 bit
typedef QuatT_tpl<f64> QuatTd;//always 64 bit
typedef QuatT_tpl<real> QuatTr;//variable float precision. depending on the target system it can be between 32, 64 or bit
// alligned versions
typedef DEFINE_ALIGNED_DATA (QuatT, QuatTA, 32); //wastest 4byte per quatT // typedef __declspec(align(16)) Quat_tpl<f32> QuatTA;
typedef DEFINE_ALIGNED_DATA (QuatTd, QuatTrA, 16); // typedef __declspec(align(16)) Quat_tpl<f32> QuatTrA;
/*!
*
* Implements the multiplication operator: QuatT=Quatpos*Quat
@@ -1711,10 +1698,6 @@ typedef QuatTS_tpl<f32> QuatTS; //always 64 bit
typedef QuatTS_tpl<f64> QuatTSd;//always 64 bit
typedef QuatTS_tpl<real> QuatTSr;//variable float precision. depending on the target system it can be between 32, 64 or 80 bit
// alligned versions
typedef DEFINE_ALIGNED_DATA (QuatTS, QuatTSA, 16); // typedef __declspec(align(16)) Quat_tpl<f32> QuatTSA;
typedef DEFINE_ALIGNED_DATA (QuatTSd, QuatTSrA, 64); // typedef __declspec(align(16)) QuatTS_tpl<f32> QuatTSrA;
template<class F1, class F2>
ILINE QuatTS_tpl<F1> operator * (const QuatTS_tpl<F1>& a, const Quat_tpl<F2>& b)
{
@@ -1972,11 +1955,6 @@ typedef QuatTNS_tpl<f32> QuatTNS;
typedef QuatTNS_tpl<f64> QuatTNSr;
typedef QuatTNS_tpl<f64> QuatTNS_f64;
// alligned versions
typedef DEFINE_ALIGNED_DATA (QuatTNS, QuatTNSA, 16);
typedef DEFINE_ALIGNED_DATA (QuatTNSr, QuatTNSrA, 64);
typedef DEFINE_ALIGNED_DATA (QuatTNS_f64, QuatTNS_f64A, 64);
template<class F1, class F2>
ILINE QuatTNS_tpl<F1> operator * (const QuatTNS_tpl<F1>& a, const Quat_tpl<F2>& b)
{
+11 -8
View File
@@ -753,7 +753,7 @@ struct SBending
// Description:
// Interface for the skinnable objects (renderer calls its functions to get the skinning data).
// should only created by EF_CreateSkinningData
_MS_ALIGN(16) struct SSkinningData
struct alignas(16) SSkinningData
{
uint32 nNumBones;
uint32 nHWSkinningFlags;
@@ -768,9 +768,10 @@ _MS_ALIGN(16) struct SSkinningData
// members below are for Software Skinning
void* pCustomData; // client specific data, used for example for sw-skinning on animation side
SSkinningData* pNextSkinningData; // List to the next element which needs SW-Skinning
} _ALIGN(16);
[[maybe_unused]] int m_padding[2]; // padding to avoid MSVC warning 4324
};
struct _MS_ALIGN(16) SRenderObjData
struct alignas(16) SRenderObjData
{
uintptr_t m_uniqueObjectId;
@@ -837,7 +838,7 @@ struct _MS_ALIGN(16) SRenderObjData
{
AZ_UNUSED(pSizer);
}
} _ALIGN(16);
};
//////////////////////////////////////////////////////////////////////
// Objects using in shader pipeline
@@ -856,7 +857,7 @@ struct ShadowMapFrustum;
/// It can be compiled into the platform specific efficient rendering compiled object.
///
//////////////////////////////////////////////////////////////////////
_MS_ALIGN(16) class CRenderObject
class alignas(16) CRenderObject
{
public:
AZ_CLASS_ALLOCATOR(CRenderObject, AZ::LegacyAllocator, 0);
@@ -929,6 +930,8 @@ public:
PerInstanceConstantBufferKey m_PerInstanceConstantBufferKey;
[[maybe_unused]] int m_padding[1]; // padding to avoid MSVC warning 4324
//! Embedded SRenderObjData, optional data carried by CRenderObject
SRenderObjData m_data;
@@ -1007,7 +1010,7 @@ protected:
}
friend class CRenderer;
} _ALIGN(16);
};
enum EResClassName
{
@@ -1200,8 +1203,8 @@ struct SEfTexModificator
return false;
}
_MS_ALIGN(16) Matrix44 m_TexGenMatrix _ALIGN(16);
_MS_ALIGN(16) Matrix44 m_TexMatrix _ALIGN(16);
alignas(16) Matrix44 m_TexGenMatrix;
alignas(16) Matrix44 m_TexMatrix;
float m_Tiling[3];
float m_Offs[3];
-3
View File
@@ -91,9 +91,6 @@ typedef unsigned char byte;
#define INVALID_FILE_ATTRIBUTES (-1)
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
type __attribute__ ((aligned(alignment))) name;
#include "LinuxSpecific.h"
#define TARGET_DEFAULT_ALIGN (0x4U)
-3
View File
@@ -97,9 +97,6 @@ typedef uint8 byte;
#define INVALID_FILE_ATTRIBUTES (-1)
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
type __attribute__ ((aligned(alignment))) name;
#include "LinuxSpecific.h"
#define TARGET_DEFAULT_ALIGN (0x8U)
-4
View File
@@ -83,10 +83,6 @@ typedef float FLOAT;
#define STDMETHODCALLTYPE
#endif
#define _ALIGN(num) \
__attribute__ ((aligned(num))) \
AZ_POP_DISABLE_WARNING
#define _PACK __attribute__ ((packed))
// Safe memory freeing
-6
View File
@@ -101,12 +101,6 @@ int64 CryGetTicksPerSec();
}
#endif
#define _MS_ALIGN(num) \
AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option") \
__declspec(align(num))
#define DEFINE_ALIGNED_DATA(type, name, alignment) _declspec(align(alignment)) type name;
#ifndef FILE_ATTRIBUTE_NORMAL
#define FILE_ATTRIBUTE_NORMAL 0x00000080
#endif
-6
View File
@@ -84,12 +84,6 @@ int64 CryGetTicksPerSec();
}
#endif
#define _MS_ALIGN(num) \
AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option") \
__declspec(align(num))
#define DEFINE_ALIGNED_DATA(type, name, alignment) _declspec(align(alignment)) type name;
#ifndef FILE_ATTRIBUTE_NORMAL
#define FILE_ATTRIBUTE_NORMAL 0x00000080
#endif
-10
View File
@@ -372,16 +372,6 @@ threadID CryGetCurrentThreadId();
#define __PACKED
#endif
// Fallback for Alignment macro of GCC/CLANG (must be after the class definition)
#if !defined(_ALIGN)
#define _ALIGN(num) AZ_POP_DISABLE_WARNING
#endif
// Fallback for Alignment macro of MSVC (must be before the class definition)
#if !defined(_MS_ALIGN)
#define _MS_ALIGN(num) AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option")
#endif
#if defined(AZ_RESTRICTED_PLATFORM)
#define AZ_RESTRICTED_SECTION PLATFORM_H_SECTION_13
#include AZ_RESTRICTED_FILE(platform_h)
+4 -1
View File
@@ -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;
}
@@ -20,8 +20,7 @@ QPushButton:focus {
QTabBar {
background-color: transparent;
}
QTabWidget::tab-bar
{
QTabWidget::tab-bar {
left: 78px; /* make room for the logo */
}
QTabBar::tab {
@@ -32,27 +31,35 @@ QTabBar::tab {
margin-right:40px;
border-bottom: 3px solid transparent;
}
QTabBar::tab:text
{
QTabBar::tab:text {
text-align:left;
}
QTabWidget::pane {
background-color: #333333;
border:0 none;
}
QTabBar::tab:selected
{
QTabBar::tab:selected {
background-color: transparent;
border-bottom: 3px solid #1e70eb;
color: #1e70eb;
font-weight: 500;
}
QTabBar::tab:hover
{
QTabBar::tab:hover {
color: #1e70eb;
font-weight: 500;
}
QTabBar::tab:pressed
{
QTabBar::tab:pressed {
color: #0e60eb;
}
QTabBar::focus {
outline: 0px;
outline: none;
outline-style: none;
}
QTabBar::tab:focus {
background-color: #525252;
color: #4082eb;
}
/************** General (Forms) **************/
@@ -117,7 +117,7 @@ namespace O3DE::ProjectManager
gemNames.reserve(gems.size());
for (const QModelIndex& modelIndex : gems)
{
gemNames.push_back(GemModel::GetName(modelIndex));
gemNames.push_back(GemModel::GetDisplayName(modelIndex));
}
return gemNames;
}
@@ -156,7 +156,7 @@ namespace O3DE::ProjectManager
if (!result.IsSuccess())
{
QMessageBox::critical(nullptr, "Operation failed",
QString("Cannot add gem %1 to project.\n\nError:\n%2").arg(GemModel::GetName(modelIndex), result.GetError().c_str()));
QString("Cannot add gem %1 to project.\n\nError:\n%2").arg(GemModel::GetDisplayName(modelIndex), result.GetError().c_str()));
return false;
}
@@ -169,7 +169,7 @@ namespace O3DE::ProjectManager
if (!result.IsSuccess())
{
QMessageBox::critical(nullptr, "Operation failed",
QString("Cannot remove gem %1 from project.\n\nError:\n%2").arg(GemModel::GetName(modelIndex), result.GetError().c_str()));
QString("Cannot remove gem %1 from project.\n\nError:\n%2").arg(GemModel::GetDisplayName(modelIndex), result.GetError().c_str()));
return false;
}
@@ -58,7 +58,7 @@ namespace O3DE::ProjectManager
m_mainWidget->hide();
}
m_nameLabel->setText(m_model->GetName(modelIndex));
m_nameLabel->setText(m_model->GetDisplayName(modelIndex));
m_creatorLabel->setText(m_model->GetCreator(modelIndex));
m_summaryLabel->setText(m_model->GetSummary(modelIndex));
@@ -75,7 +75,7 @@ namespace O3DE::ProjectManager
}
// Gem name
QString gemName = GemModel::GetName(modelIndex);
QString gemName = GemModel::GetDisplayName(modelIndex);
QFont gemNameFont(options.font);
const int firstColumnMaxTextWidth = s_summaryStartX - 30;
gemNameFont.setPixelSize(static_cast<int>(s_gemNameFontSize));
@@ -30,6 +30,7 @@ namespace O3DE::ProjectManager
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
item->setData(gemInfo.m_name, RoleName);
item->setData(gemInfo.m_displayName, RoleDisplayName);
item->setData(gemInfo.m_creator, RoleCreator);
item->setData(gemInfo.m_gemOrigin, RoleGemOrigin);
item->setData(aznumeric_cast<int>(gemInfo.m_platforms), RolePlatforms);
@@ -64,6 +65,20 @@ namespace O3DE::ProjectManager
return modelIndex.data(RoleName).toString();
}
QString GemModel::GetDisplayName(const QModelIndex& modelIndex)
{
QString displayName = modelIndex.data(RoleDisplayName).toString();
if (displayName.isEmpty())
{
return GetName(modelIndex);
}
else
{
return displayName;
}
}
QString GemModel::GetCreator(const QModelIndex& modelIndex)
{
return modelIndex.data(RoleCreator).toString();
@@ -117,7 +132,7 @@ namespace O3DE::ProjectManager
QModelIndex modelIndex = FindIndexByNameString(dependingGemString);
if (modelIndex.isValid())
{
dependingGemString = GetName(modelIndex);
dependingGemString = GetDisplayName(modelIndex);
}
}
}
@@ -37,6 +37,7 @@ namespace O3DE::ProjectManager
QStringList GetConflictingGemNames(const QModelIndex& modelIndex);
static QString GetName(const QModelIndex& modelIndex);
static QString GetDisplayName(const QModelIndex& modelIndex);
static QString GetCreator(const QModelIndex& modelIndex);
static GemInfo::GemOrigin GetGemOrigin(const QModelIndex& modelIndex);
static GemInfo::Platforms GetPlatforms(const QModelIndex& modelIndex);
@@ -69,6 +70,7 @@ namespace O3DE::ProjectManager
enum UserRole
{
RoleName = Qt::UserRole,
RoleDisplayName,
RoleCreator,
RoleGemOrigin,
RolePlatforms,
@@ -51,7 +51,7 @@ namespace O3DE::ProjectManager
painter->fillRect(itemRect, itemBackgroundColor);
// Gem name
QString gemName = GemModel::GetName(modelIndex);
QString gemName = GemModel::GetDisplayName(modelIndex);
QFont gemNameFont(options.font);
const int firstColumnMaxTextWidth = s_summaryStartX - 30;
gemName = QFontMetrics(gemNameFont).elidedText(gemName, Qt::TextElideMode::ElideRight, firstColumnMaxTextWidth);
@@ -28,9 +28,26 @@ namespace O3DE::ProjectManager
return false;
}
if (!m_sourceModel->GetName(sourceIndex).contains(m_searchString, Qt::CaseInsensitive))
// Search Bar
if (!m_sourceModel->GetDisplayName(sourceIndex).contains(m_searchString, Qt::CaseInsensitive) &&
!m_sourceModel->GetName(sourceIndex).contains(m_searchString, Qt::CaseInsensitive) &&
!m_sourceModel->GetCreator(sourceIndex).contains(m_searchString, Qt::CaseInsensitive) &&
!m_sourceModel->GetSummary(sourceIndex).contains(m_searchString, Qt::CaseInsensitive))
{
return false;
bool foundFeature = false;
for (const QString& feature : m_sourceModel->GetFeatures(sourceIndex))
{
if (feature.contains(m_searchString, Qt::CaseInsensitive))
{
foundFeature = true;
break;
}
}
if (!foundFeature)
{
return false;
}
}
// Gem status
@@ -52,6 +52,7 @@ namespace O3DE::ProjectManager
if (projectButton)
{
projectButton->SetProjectBuilding();
projectButton->SetProjectButtonAction(tr("Cancel Build"), [this] { HandleCancel(); });
if (m_lastProgress != 0)
@@ -111,6 +112,10 @@ namespace O3DE::ProjectManager
emit Done(false);
return;
}
else
{
m_projectInfo.m_buildFailed = false;
}
emit Done(true);
}
@@ -162,22 +162,9 @@ namespace O3DE::ProjectManager
QDesktopServices::openUrl(m_logUrl);
}
ProjectButton::ProjectButton(const ProjectInfo& projectInfo, QWidget* parent, bool processing)
ProjectButton::ProjectButton(const ProjectInfo& projectInfo, QWidget* parent)
: QFrame(parent)
, m_projectInfo(projectInfo)
{
BaseSetup();
if (processing)
{
ProcessingSetup();
}
else
{
ReadySetup();
}
}
void ProjectButton::BaseSetup()
{
setObjectName("projectButton");
@@ -199,50 +186,63 @@ namespace O3DE::ProjectManager
}
m_projectImageLabel->setPixmap(QPixmap(projectPreviewPath).scaled(m_projectImageLabel->size(), Qt::KeepAspectRatioByExpanding));
m_projectFooter = new QFrame(this);
QFrame* projectFooter = new QFrame(this);
QHBoxLayout* hLayout = new QHBoxLayout();
hLayout->setContentsMargins(0, 0, 0, 0);
m_projectFooter->setLayout(hLayout);
projectFooter->setLayout(hLayout);
{
QLabel* projectNameLabel = new QLabel(m_projectInfo.GetProjectDisplayName(), this);
hLayout->addWidget(projectNameLabel);
QMenu* menu = new QMenu(this);
menu->addAction(tr("Edit Project Settings..."), this, [this]() { emit EditProject(m_projectInfo.m_path); });
menu->addAction(tr("Build"), this, [this]() { emit BuildProject(m_projectInfo); });
menu->addSeparator();
menu->addAction(tr("Open Project folder..."), this, [this]()
{
AzQtComponents::ShowFileOnDesktop(m_projectInfo.m_path);
});
menu->addSeparator();
menu->addAction(tr("Duplicate"), this, [this]() { emit CopyProject(m_projectInfo); });
menu->addSeparator();
menu->addAction(tr("Remove from O3DE"), this, [this]() { emit RemoveProject(m_projectInfo.m_path); });
menu->addAction(tr("Delete this Project"), this, [this]() { emit DeleteProject(m_projectInfo.m_path); });
m_projectMenuButton = new QPushButton(this);
m_projectMenuButton->setObjectName("projectMenuButton");
m_projectMenuButton->setMenu(menu);
hLayout->addWidget(m_projectMenuButton);
}
vLayout->addWidget(m_projectFooter);
vLayout->addWidget(projectFooter);
connect(m_projectImageLabel->GetOpenEditorButton(), &QPushButton::clicked, [this](){ emit OpenProject(m_projectInfo.m_path); });
}
void ProjectButton::ProcessingSetup()
const ProjectInfo& ProjectButton::GetProjectInfo() const
{
m_projectImageLabel->SetEnabled(false);
m_projectImageLabel->SetOverlayText(tr("Processing...\n\n"));
return m_projectInfo;
}
void ProjectButton::RestoreDefaultState()
{
m_projectImageLabel->SetEnabled(true);
m_projectImageLabel->SetOverlayText("");
m_projectMenuButton->setVisible(true);
QProgressBar* progressBar = m_projectImageLabel->GetProgressBar();
progressBar->setVisible(true);
progressBar->setVisible(false);
progressBar->setValue(0);
}
void ProjectButton::ReadySetup()
{
connect(m_projectImageLabel->GetOpenEditorButton(), &QPushButton::clicked, [this](){ emit OpenProject(m_projectInfo.m_path); });
QPushButton* projectActionButton = m_projectImageLabel->GetActionButton();
projectActionButton->setVisible(false);
if (m_actionButtonConnection)
{
disconnect(m_actionButtonConnection);
}
QMenu* menu = new QMenu(this);
menu->addAction(tr("Edit Project Settings..."), this, [this]() { emit EditProject(m_projectInfo.m_path); });
menu->addAction(tr("Build"), this, [this]() { emit BuildProject(m_projectInfo); });
menu->addSeparator();
menu->addAction(tr("Open Project folder..."), this, [this]()
{
AzQtComponents::ShowFileOnDesktop(m_projectInfo.m_path);
});
menu->addSeparator();
menu->addAction(tr("Duplicate"), this, [this]() { emit CopyProject(m_projectInfo); });
menu->addSeparator();
menu->addAction(tr("Remove from O3DE"), this, [this]() { emit RemoveProject(m_projectInfo.m_path); });
menu->addAction(tr("Delete this Project"), this, [this]() { emit DeleteProject(m_projectInfo.m_path); });
QPushButton* projectMenuButton = new QPushButton(this);
projectMenuButton->setObjectName("projectMenuButton");
projectMenuButton->setMenu(menu);
m_projectFooter->layout()->addWidget(projectMenuButton);
m_projectImageLabel->GetWarningIcon()->setVisible(false);
m_projectImageLabel->GetWarningLabel()->setVisible(false);
}
void ProjectButton::SetProjectButtonAction(const QString& text, AZStd::function<void()> lambda)
@@ -292,9 +292,15 @@ namespace O3DE::ProjectManager
SetProjectButtonAction(tr("Build Project"), [this]() { emit BuildProject(m_projectInfo); });
}
void ProjectButton::BuildThisProject()
void ProjectButton::SetProjectBuilding()
{
emit BuildProject(m_projectInfo);
m_projectImageLabel->SetEnabled(false);
m_projectImageLabel->SetOverlayText(tr("Building...\n\n"));
m_projectMenuButton->setVisible(false);
QProgressBar* progressBar = m_projectImageLabel->GetProgressBar();
progressBar->setVisible(true);
progressBar->setValue(0);
}
void ProjectButton::SetLaunchButtonEnabled(bool enabled)
@@ -56,13 +56,14 @@ namespace O3DE::ProjectManager
void OnLinkActivated(const QString& link);
private:
QVBoxLayout* m_buildOverlayLayout;
QLabel* m_overlayLabel;
QProgressBar* m_progressBar;
QPushButton* m_openEditorButton;
QPushButton* m_actionButton;
QLabel* m_warningText;
QLabel* m_warningIcon;
QVBoxLayout* m_buildOverlayLayout = nullptr;
QLabel* m_overlayLabel = nullptr;
QProgressBar* m_progressBar = nullptr;
QPushButton* m_openEditorButton = nullptr;
QPushButton* m_actionButton = nullptr;
QLabel* m_warningText = nullptr;
QLabel* m_warningIcon = nullptr;
QUrl m_logUrl;
bool m_enabled = true;
};
@@ -73,13 +74,18 @@ namespace O3DE::ProjectManager
Q_OBJECT // AUTOMOC
public:
explicit ProjectButton(const ProjectInfo& m_projectInfo, QWidget* parent = nullptr, bool processing = false);
explicit ProjectButton(const ProjectInfo& m_projectInfo, QWidget* parent = nullptr);
~ProjectButton() = default;
const ProjectInfo& GetProjectInfo() const;
void RestoreDefaultState();
void SetProjectButtonAction(const QString& text, AZStd::function<void()> lambda);
void SetProjectBuildButtonAction();
void SetBuildLogsLink(const QUrl& logUrl);
void ShowBuildFailed(bool show, const QUrl& logUrl);
void SetProjectBuilding();
void SetLaunchButtonEnabled(bool enabled);
void SetButtonOverlayText(const QString& text);
@@ -95,17 +101,14 @@ namespace O3DE::ProjectManager
void BuildProject(const ProjectInfo& projectInfo);
private:
void BaseSetup();
void ProcessingSetup();
void ReadySetup();
void enterEvent(QEvent* event) override;
void leaveEvent(QEvent* event) override;
void BuildThisProject();
ProjectInfo m_projectInfo;
LabelButton* m_projectImageLabel;
QFrame* m_projectFooter;
QLayout* m_requiresBuildLayout;
LabelButton* m_projectImageLabel = nullptr;
QPushButton* m_projectMenuButton = nullptr;
QLayout* m_requiresBuildLayout = nullptr;
QMetaObject::Connection m_actionButtonConnection;
};
@@ -68,9 +68,7 @@ namespace O3DE::ProjectManager
}
ProjectsScreen::~ProjectsScreen()
{
delete m_currentBuilder;
}
QFrame* ProjectsScreen::CreateFirstTimeContent()
@@ -114,10 +112,8 @@ namespace O3DE::ProjectManager
return frame;
}
QFrame* ProjectsScreen::CreateProjectsContent(QString buildProjectPath, ProjectButton** projectButton)
QFrame* ProjectsScreen::CreateProjectsContent()
{
RemoveInvalidProjects();
QFrame* frame = new QFrame(this);
frame->setObjectName("projectsContent");
{
@@ -126,7 +122,7 @@ namespace O3DE::ProjectManager
layout->setContentsMargins(0, 0, 0, 0);
frame->setLayout(layout);
QFrame* header = new QFrame(this);
QFrame* header = new QFrame(frame);
QHBoxLayout* headerLayout = new QHBoxLayout();
{
QLabel* titleLabel = new QLabel(tr("My Projects"), this);
@@ -150,87 +146,34 @@ namespace O3DE::ProjectManager
layout->addWidget(header);
// Get all projects and create a horizontal scrolling list of them
auto projectsResult = PythonBindingsInterface::Get()->GetProjects();
if (projectsResult.IsSuccess() && !projectsResult.GetValue().isEmpty())
{
QScrollArea* projectsScrollArea = new QScrollArea(this);
QWidget* scrollWidget = new QWidget();
QScrollArea* projectsScrollArea = new QScrollArea(this);
QWidget* scrollWidget = new QWidget();
FlowLayout* flowLayout = new FlowLayout(0, s_spacerSize, s_spacerSize);
scrollWidget->setLayout(flowLayout);
m_projectsFlowLayout = new FlowLayout(0, s_spacerSize, s_spacerSize);
scrollWidget->setLayout(m_projectsFlowLayout);
projectsScrollArea->setWidget(scrollWidget);
projectsScrollArea->setWidgetResizable(true);
projectsScrollArea->setWidget(scrollWidget);
projectsScrollArea->setWidgetResizable(true);
QVector<ProjectInfo> nonProcessingProjects;
buildProjectPath = QDir::fromNativeSeparators(buildProjectPath);
for (auto& project : projectsResult.GetValue())
{
if (projectButton && !*projectButton)
{
if (QDir::fromNativeSeparators(project.m_path) == buildProjectPath)
{
*projectButton = CreateProjectButton(project, flowLayout, true);
continue;
}
}
ResetProjectsContent();
nonProcessingProjects.append(project);
}
for (auto& project : nonProcessingProjects)
{
ProjectButton* projectButtonWidget = CreateProjectButton(project, flowLayout);
if (BuildQueueContainsProject(project.m_path))
{
projectButtonWidget->SetProjectButtonAction(tr("Cancel Queued Build"),
[this, project]
{
UnqueueBuildProject(project);
SuggestBuildProjectMsg(project, false);
});
}
else if (RequiresBuildProjectIterator(project.m_path) != m_requiresBuild.end())
{
auto buildProjectIterator = RequiresBuildProjectIterator(project.m_path);
if (buildProjectIterator != m_requiresBuild.end())
{
if (buildProjectIterator->m_buildFailed)
{
projectButtonWidget->ShowBuildFailed(true, buildProjectIterator->m_logUrl);
}
else
{
projectButtonWidget->SetProjectBuildButtonAction();
}
}
}
}
layout->addWidget(projectsScrollArea);
}
layout->addWidget(projectsScrollArea);
}
return frame;
}
ProjectButton* ProjectsScreen::CreateProjectButton(ProjectInfo& project, QLayout* flowLayout, bool processing)
ProjectButton* ProjectsScreen::CreateProjectButton(const ProjectInfo& project)
{
ProjectButton* projectButton = new ProjectButton(project, this, processing);
ProjectButton* projectButton = new ProjectButton(project, this);
m_projectButtons.insert(project.m_path, projectButton);
m_projectsFlowLayout->addWidget(projectButton);
flowLayout->addWidget(projectButton);
if (!processing)
{
connect(projectButton, &ProjectButton::OpenProject, this, &ProjectsScreen::HandleOpenProject);
connect(projectButton, &ProjectButton::EditProject, this, &ProjectsScreen::HandleEditProject);
connect(projectButton, &ProjectButton::CopyProject, this, &ProjectsScreen::HandleCopyProject);
connect(projectButton, &ProjectButton::RemoveProject, this, &ProjectsScreen::HandleRemoveProject);
connect(projectButton, &ProjectButton::DeleteProject, this, &ProjectsScreen::HandleDeleteProject);
}
connect(projectButton, &ProjectButton::OpenProject, this, &ProjectsScreen::HandleOpenProject);
connect(projectButton, &ProjectButton::EditProject, this, &ProjectsScreen::HandleEditProject);
connect(projectButton, &ProjectButton::CopyProject, this, &ProjectsScreen::HandleCopyProject);
connect(projectButton, &ProjectButton::RemoveProject, this, &ProjectsScreen::HandleRemoveProject);
connect(projectButton, &ProjectButton::DeleteProject, this, &ProjectsScreen::HandleDeleteProject);
connect(projectButton, &ProjectButton::BuildProject, this, &ProjectsScreen::QueueBuildProject);
return projectButton;
@@ -238,29 +181,128 @@ namespace O3DE::ProjectManager
void ProjectsScreen::ResetProjectsContent()
{
// refresh the projects content by re-creating it for now
if (m_projectsContent)
RemoveInvalidProjects();
// Get all projects and create a vertical scrolling list of them
// Sort building and queued projects first
auto projectsResult = PythonBindingsInterface::Get()->GetProjects();
if (projectsResult.IsSuccess() && !projectsResult.GetValue().isEmpty())
{
m_stack->removeWidget(m_projectsContent);
m_projectsContent->deleteLater();
QVector<ProjectInfo> projectsVector = projectsResult.GetValue();
// If a project path is in this set then the button for it will be kept
QSet<QString> keepProject;
for (const ProjectInfo& project : projectsVector)
{
keepProject.insert(project.m_path);
}
// Clear flow and delete buttons for removed projects
auto projectButtonsIter = m_projectButtons.begin();
while (projectButtonsIter != m_projectButtons.end())
{
m_projectsFlowLayout->removeWidget(projectButtonsIter.value());
if (!keepProject.contains(projectButtonsIter.key()))
{
projectButtonsIter = m_projectButtons.erase(projectButtonsIter);
}
else
{
++projectButtonsIter;
}
}
QString buildProjectPath = "";
if (m_currentBuilder)
{
buildProjectPath = m_currentBuilder->GetProjectInfo().m_path;
}
// Put currently building project in front, then queued projects, then sorts alphabetically
std::sort(projectsVector.begin(), projectsVector.end(), [buildProjectPath, this](const ProjectInfo& arg1, const ProjectInfo& arg2)
{
if (arg1.m_path == buildProjectPath)
{
return true;
}
else if (arg2.m_path == buildProjectPath)
{
return false;
}
bool arg1InBuildQueue = BuildQueueContainsProject(arg1.m_path);
bool arg2InBuildQueue = BuildQueueContainsProject(arg2.m_path);
if (arg1InBuildQueue && !arg2InBuildQueue)
{
return true;
}
else if (!arg1InBuildQueue && arg2InBuildQueue)
{
return false;
}
else
{
return arg1.m_displayName.toLower() < arg2.m_displayName.toLower();
}
});
// Add any missing project buttons and restore buttons to default state
for (const ProjectInfo& project : projectsVector)
{
if (!m_projectButtons.contains(project.m_path))
{
m_projectButtons.insert(project.m_path, CreateProjectButton(project));
}
else
{
auto projectButtonIter = m_projectButtons.find(project.m_path);
if (projectButtonIter != m_projectButtons.end())
{
projectButtonIter.value()->RestoreDefaultState();
m_projectsFlowLayout->addWidget(projectButtonIter.value());
}
}
}
// Setup building button again
auto buildProjectIter = m_projectButtons.find(buildProjectPath);
if (buildProjectIter != m_projectButtons.end())
{
m_currentBuilder->SetProjectButton(buildProjectIter.value());
}
for (const ProjectInfo& project : m_buildQueue)
{
auto projectIter = m_projectButtons.find(project.m_path);
if (projectIter != m_projectButtons.end())
{
projectIter.value()->SetProjectButtonAction(
tr("Cancel Queued Build"),
[this, project]
{
UnqueueBuildProject(project);
SuggestBuildProjectMsg(project, false);
});
}
}
for (const ProjectInfo& project : m_requiresBuild)
{
auto projectIter = m_projectButtons.find(project.m_path);
if (projectIter != m_projectButtons.end())
{
if (project.m_buildFailed)
{
projectIter.value()->ShowBuildFailed(true, project.m_logUrl);
}
else
{
projectIter.value()->SetProjectBuildButtonAction();
}
}
}
}
m_background.load(":/Backgrounds/DefaultBackground.jpg");
// Make sure to update builder with latest Project Button
if (m_currentBuilder)
{
ProjectButton* projectButtonPtr = nullptr;
m_projectsContent = CreateProjectsContent(m_currentBuilder->GetProjectInfo().m_path, &projectButtonPtr);
m_currentBuilder->SetProjectButton(projectButtonPtr);
}
else
{
m_projectsContent = CreateProjectsContent();
}
m_stack->addWidget(m_projectsContent);
m_stack->setCurrentWidget(m_projectsContent);
}
@@ -466,7 +508,7 @@ namespace O3DE::ProjectManager
if (m_buildQueue.empty() && !m_currentBuilder)
{
StartProjectBuild(projectInfo);
// Projects Content is already reset in fuction
// Projects Content is already reset in function
}
else
{
@@ -491,6 +533,7 @@ namespace O3DE::ProjectManager
}
else
{
m_background.load(":/Backgrounds/DefaultBackground.jpg");
ResetProjectsContent();
}
}
@@ -18,6 +18,7 @@ QT_FORWARD_DECLARE_CLASS(QPaintEvent)
QT_FORWARD_DECLARE_CLASS(QFrame)
QT_FORWARD_DECLARE_CLASS(QStackedWidget)
QT_FORWARD_DECLARE_CLASS(QLayout)
QT_FORWARD_DECLARE_CLASS(FlowLayout)
namespace O3DE::ProjectManager
{
@@ -59,8 +60,8 @@ namespace O3DE::ProjectManager
private:
QFrame* CreateFirstTimeContent();
QFrame* CreateProjectsContent(QString buildProjectPath = "", ProjectButton** projectButton = nullptr);
ProjectButton* CreateProjectButton(ProjectInfo& project, QLayout* flowLayout, bool processing = false);
QFrame* CreateProjectsContent();
ProjectButton* CreateProjectButton(const ProjectInfo& project);
void ResetProjectsContent();
bool ShouldDisplayFirstTimeContent();
bool RemoveInvalidProjects();
@@ -75,7 +76,9 @@ namespace O3DE::ProjectManager
QPixmap m_background;
QFrame* m_firstTimeContent = nullptr;
QFrame* m_projectsContent = nullptr;
FlowLayout* m_projectsFlowLayout = nullptr;
QStackedWidget* m_stack = nullptr;
QHash<QString, ProjectButton*> m_projectButtons;
QList<ProjectInfo> m_requiresBuild;
QQueue<ProjectInfo> m_buildQueue;
ProjectBuilderController* m_currentBuilder = nullptr;
@@ -30,6 +30,7 @@ namespace O3DE::ProjectManager
// add a tab widget at the bottom of the stack
m_tabWidget = new QTabWidget();
m_tabWidget->tabBar()->setFocusPolicy(Qt::TabFocus);
m_screenStack->addWidget(m_tabWidget);
connect(m_tabWidget, &QTabWidget::currentChanged, this, &ScreensCtrl::TabChanged);
}
@@ -54,6 +54,7 @@ namespace O3DE::ProjectManager
QTabWidget* tabWidget = new QTabWidget();
tabWidget->setObjectName("projectSettingsTab");
tabWidget->tabBar()->setObjectName("projectSettingsTabBar");
tabWidget->tabBar()->setFocusPolicy(Qt::TabFocus);
tabWidget->addTab(m_updateSettingsScreen, tr("General"));
QPushButton* gemsButton = new QPushButton(tr("Configure Gems"), this);
@@ -24,7 +24,12 @@ namespace AZ
: public AZ::EBusTraits
{
public:
virtual void ReportJobDependencies(JobDependencyList& jobDependencyList, const char* platformIdentifier) = 0;
//! Builders can implement this function to add job dependencies on other assets that may be used in the scene file conversion process.
virtual void ReportJobDependencies(JobDependencyList& jobDependencyList, const char* platformIdentifier) { AZ_UNUSED(jobDependencyList); AZ_UNUSED(platformIdentifier); }
//! Builders can implement this function to append to the job analysis fingerprint. This can be used to trigger rebuilds when global configuration changes.
//! See also AssetBuilderDesc::m_analysisFingerprint.
virtual void AddFingerprintInfo(AZStd::set<AZStd::string>& fingerprintInfo) { AZ_UNUSED(fingerprintInfo); }
};
using SceneBuilderDependencyBus = EBus<SceneBuilderDependencyRequests>;
} // namespace SceneAPI
@@ -62,9 +62,9 @@ namespace AZ
void BuildDrawPacketList(size_t modelLodIndex);
void SetRayTracingData();
void SetSortKey(RHI::DrawItemSortKey sortKey);
RHI::DrawItemSortKey GetSortKey();
void SetLodOverride(RPI::Cullable::LodOverride lodOverride);
RPI::Cullable::LodOverride GetLodOverride();
RHI::DrawItemSortKey GetSortKey() const;
void SetMeshLodConfiguration(RPI::Cullable::LodConfiguration meshLodConfig);
RPI::Cullable::LodConfiguration GetMeshLodConfiguration() const;
void UpdateDrawPackets(bool forceUpdate = false);
void BuildCullable();
void UpdateCullBounds(const TransformServiceFeatureProcessor* transformService);
@@ -153,10 +153,10 @@ namespace AZ
AZ::Aabb GetLocalAabb(const MeshHandle& meshHandle) const override;
void SetSortKey(const MeshHandle& meshHandle, RHI::DrawItemSortKey sortKey) override;
RHI::DrawItemSortKey GetSortKey(const MeshHandle& meshHandle) override;
RHI::DrawItemSortKey GetSortKey(const MeshHandle& meshHandle) const override;
void SetLodOverride(const MeshHandle& meshHandle, RPI::Cullable::LodOverride lodOverride) override;
RPI::Cullable::LodOverride GetLodOverride(const MeshHandle& meshHandle) override;
void SetMeshLodConfiguration(const MeshHandle& meshHandle, const RPI::Cullable::LodConfiguration& meshLodConfig) override;
RPI::Cullable::LodConfiguration GetMeshLodConfiguration(const MeshHandle& meshHandle) const override;
void SetExcludeFromReflectionCubeMaps(const MeshHandle& meshHandle, bool excludeFromReflectionCubeMaps) override;
void SetRayTracingEnabled(const MeshHandle& meshHandle, bool rayTracingEnabled) override;
@@ -93,11 +93,11 @@ namespace AZ
//! Sets the sort key for a given mesh handle.
virtual void SetSortKey(const MeshHandle& meshHandle, RHI::DrawItemSortKey sortKey) = 0;
//! Gets the sort key for a given mesh handle.
virtual RHI::DrawItemSortKey GetSortKey(const MeshHandle& meshHandle) = 0;
//! Sets an LOD override for a given mesh handle. This LOD will always be rendered instead being automatically determined.
virtual void SetLodOverride(const MeshHandle& meshHandle, RPI::Cullable::LodOverride lodOverride) = 0;
//! Gets the LOD override for a given mesh handle.
virtual RPI::Cullable::LodOverride GetLodOverride(const MeshHandle& meshHandle) = 0;
virtual RHI::DrawItemSortKey GetSortKey(const MeshHandle& meshHandle) const = 0;
//! Sets LOD mesh configurations to be used in the Mesh Feature Processor
virtual void SetMeshLodConfiguration(const MeshHandle& meshHandle, const RPI::Cullable::LodConfiguration& meshLodConfig) = 0;
//! Gets the LOD mesh configurations being used in the Mesh Feature Processor
virtual RPI::Cullable::LodConfiguration GetMeshLodConfiguration(const MeshHandle& meshHandle) const = 0;
//! Sets the option to exclude this mesh from baked reflection probe cubemaps
virtual void SetExcludeFromReflectionCubeMaps(const MeshHandle& meshHandle, bool excludeFromReflectionCubeMaps) = 0;
//! Sets the option to exclude this mesh from raytracing
@@ -32,9 +32,9 @@ namespace UnitTest
MOCK_METHOD2(SetLocalAabb, void(const MeshHandle&, const AZ::Aabb&));
MOCK_CONST_METHOD1(GetLocalAabb, AZ::Aabb(const MeshHandle&));
MOCK_METHOD2(SetSortKey, void (const MeshHandle&, AZ::RHI::DrawItemSortKey));
MOCK_METHOD1(GetSortKey, AZ::RHI::DrawItemSortKey(const MeshHandle&));
MOCK_METHOD2(SetLodOverride, void(const MeshHandle&, AZ::RPI::Cullable::LodOverride));
MOCK_METHOD1(GetLodOverride, AZ::RPI::Cullable::LodOverride(const MeshHandle&));
MOCK_CONST_METHOD1(GetSortKey, AZ::RHI::DrawItemSortKey(const MeshHandle&));
MOCK_METHOD2(SetMeshLodConfiguration, void(const MeshHandle&, const AZ::RPI::Cullable::LodConfiguration&));
MOCK_CONST_METHOD1(GetMeshLodConfiguration, AZ::RPI::Cullable::LodConfiguration(const MeshHandle&));
MOCK_METHOD2(AcquireMesh, MeshHandle (const AZ::Render::MeshHandleDescriptor&, const AZ::Render::MaterialAssignmentMap&));
MOCK_METHOD2(AcquireMesh, MeshHandle (const AZ::Render::MeshHandleDescriptor&, const AZ::Data::Instance<AZ::RPI::Material>&));
MOCK_METHOD2(SetRayTracingEnabled, void (const MeshHandle&, bool));
@@ -67,8 +67,8 @@ namespace AZ
ImGuiPass::ImGuiPass(const RPI::PassDescriptor& descriptor)
: Base(descriptor)
, AzFramework::InputChannelEventListener(AzFramework::InputChannelEventListener::GetPriorityUI())
, AzFramework::InputTextEventListener(AzFramework::InputTextEventListener::GetPriorityUI())
, AzFramework::InputChannelEventListener(AzFramework::InputChannelEventListener::GetPriorityDebugUI() - 1) // Give ImGui manager priority over the pass
, AzFramework::InputTextEventListener(AzFramework::InputTextEventListener::GetPriorityDebugUI() - 1) // Give ImGui manager priority over the pass
{
const ImGuiPassData* imguiPassData = RPI::PassUtils::GetPassData<ImGuiPassData>(descriptor);
@@ -157,11 +157,6 @@ namespace AZ
return io.WantTextInput;
}
AZ::s32 ImGuiPass::GetPriority() const
{
return AzFramework::InputChannelEventListener::GetPriorityUI();
}
bool ImGuiPass::OnInputChannelEventFiltered(const AzFramework::InputChannel& inputChannel)
{
if (!IsEnabled() || GetRenderPipeline()->GetScene() == nullptr)
@@ -84,7 +84,6 @@ namespace AZ
// AzFramework::InputChannelEventListener overrides...
bool OnInputChannelEventFiltered(const AzFramework::InputChannel& inputChannel) override;
AZ::s32 GetPriority() const override;
protected:
explicit ImGuiPass(const RPI::PassDescriptor& descriptor);
@@ -12,12 +12,26 @@
#include <AzCore/Math/Color.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Settings/SettingsRegistry.h>
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
#include <Atom/RPI.Reflect/Material/MaterialAsset.h>
namespace AZ
{
namespace Render
{
void MaterialConverterSettings::Reflect(AZ::ReflectContext* context)
{
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<MaterialConverterSettings>()
->Version(1)
->Field("Enable", &MaterialConverterSettings::m_enable)
->Field("DefaultMaterial", &MaterialConverterSettings::m_defaultMaterial);
}
}
void MaterialConverterSystemComponent::Reflect(AZ::ReflectContext* context)
{
if (auto* serialize = azrtti_cast<SerializeContext*>(context))
@@ -26,10 +40,22 @@ namespace AZ
->Version(3)
->Attribute(Edit::Attributes::SystemComponentTags, AZStd::vector<Crc32>({ AssetBuilderSDK::ComponentTags::AssetBuilder }));
}
MaterialConverterSettings::Reflect(context);
}
void MaterialConverterSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services)
{
services.emplace_back(AZ_CRC_CE("FingerprintModification"));
}
void MaterialConverterSystemComponent::Activate()
{
if (auto* settingsRegistry = AZ::SettingsRegistry::Get())
{
settingsRegistry->GetObject(m_settings, "/O3DE/SceneAPI/MaterialConverter");
}
RPI::MaterialConverterBus::Handler::BusConnect();
}
@@ -37,11 +63,21 @@ namespace AZ
{
RPI::MaterialConverterBus::Handler::BusDisconnect();
}
bool MaterialConverterSystemComponent::IsEnabled() const
{
return m_settings.m_enable;
}
bool MaterialConverterSystemComponent::ConvertMaterial(
const AZ::SceneAPI::DataTypes::IMaterialData& materialData, RPI::MaterialSourceData& sourceData)
{
using namespace AZ::RPI;
if (!m_settings.m_enable)
{
return false;
}
// The source data for generating material asset
sourceData.m_materialType = GetMaterialTypePath();
@@ -140,9 +176,20 @@ namespace AZ
return true;
}
const char* MaterialConverterSystemComponent::GetMaterialTypePath() const
AZStd::string MaterialConverterSystemComponent::GetMaterialTypePath() const
{
return "Materials/Types/StandardPBR.materialtype";
}
AZStd::string MaterialConverterSystemComponent::GetDefaultMaterialPath() const
{
if (m_settings.m_defaultMaterial.empty())
{
AZ_Error("MaterialConverterSystemComponent", m_settings.m_enable,
"Material conversion is disabled but a default material not specified in registry /O3DE/SceneAPI/MaterialConverter/DefaultMaterial");
}
return m_settings.m_defaultMaterial;
}
}
}
@@ -18,6 +18,16 @@ namespace AZ
{
namespace Render
{
struct MaterialConverterSettings
{
AZ_TYPE_INFO(MaterialConverterSettings, "{8D91601D-570A-4557-99C8-631DB4928040}");
static void Reflect(AZ::ReflectContext* context);
bool m_enable = true;
AZStd::string m_defaultMaterial;
};
//! Atom's implementation of converting SceneAPI data into Atom's default material: StandardPBR
class MaterialConverterSystemComponent final
: public AZ::Component
@@ -27,13 +37,20 @@ namespace AZ
AZ_COMPONENT(MaterialConverterSystemComponent, "{C2338D45-6456-4521-B469-B000A13F2493}");
static void Reflect(AZ::ReflectContext* context);
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services);
void Activate() override;
void Deactivate() override;
// MaterialConverterBus overrides ...
bool IsEnabled() const override;
bool ConvertMaterial(const AZ::SceneAPI::DataTypes::IMaterialData& materialData, RPI::MaterialSourceData& out) override;
const char* GetMaterialTypePath() const override;
AZStd::string GetMaterialTypePath() const override;
AZStd::string GetDefaultMaterialPath() const override;
private:
MaterialConverterSettings m_settings;
};
}
}
@@ -346,7 +346,7 @@ namespace AZ
}
}
RHI::DrawItemSortKey MeshFeatureProcessor::GetSortKey(const MeshHandle& meshHandle)
RHI::DrawItemSortKey MeshFeatureProcessor::GetSortKey(const MeshHandle& meshHandle) const
{
if (meshHandle.IsValid())
{
@@ -359,24 +359,24 @@ namespace AZ
}
}
void MeshFeatureProcessor::SetLodOverride(const MeshHandle& meshHandle, RPI::Cullable::LodOverride lodOverride)
void MeshFeatureProcessor::SetMeshLodConfiguration(const MeshHandle& meshHandle, const RPI::Cullable::LodConfiguration& meshLodConfig)
{
if (meshHandle.IsValid())
{
meshHandle->SetLodOverride(lodOverride);
meshHandle->SetMeshLodConfiguration(meshLodConfig);
}
}
RPI::Cullable::LodOverride MeshFeatureProcessor::GetLodOverride(const MeshHandle& meshHandle)
RPI::Cullable::LodConfiguration MeshFeatureProcessor::GetMeshLodConfiguration(const MeshHandle& meshHandle) const
{
if (meshHandle.IsValid())
{
return meshHandle->GetLodOverride();
return meshHandle->GetMeshLodConfiguration();
}
else
{
AZ_Assert(false, "Invalid mesh handle");
return 0;
return {RPI::Cullable::LodType::Default, 0, 0.0f, 0.0f };
}
}
@@ -968,19 +968,19 @@ namespace AZ
}
}
RHI::DrawItemSortKey MeshDataInstance::GetSortKey()
RHI::DrawItemSortKey MeshDataInstance::GetSortKey() const
{
return m_sortKey;
}
void MeshDataInstance::SetLodOverride(RPI::Cullable::LodOverride lodOverride)
void MeshDataInstance::SetMeshLodConfiguration(RPI::Cullable::LodConfiguration meshLodConfig)
{
m_cullable.m_lodData.m_lodOverride = lodOverride;
m_cullable.m_lodData.m_lodConfiguration = meshLodConfig;
}
RPI::Cullable::LodOverride MeshDataInstance::GetLodOverride()
RPI::Cullable::LodConfiguration MeshDataInstance::GetMeshLodConfiguration() const
{
return m_cullable.m_lodData.m_lodOverride;
return m_cullable.m_lodData.m_lodConfiguration;
}
void MeshDataInstance::UpdateDrawPackets(bool forceUpdate /*= false*/)
@@ -1022,9 +1022,6 @@ namespace AZ
{
//initialize the lod
RPI::Cullable::LodData::Lod& lod = lodData.m_lods[lodIndex];
//[GFX TODO][ATOM-5562] - Level of detail: override lod distances and add global lod multiplier(s)
static const float MinimumScreenCoverage = 1.0f/1080.0f; //mesh should cover at least a screen pixel at 1080p to be drawn
static const float ReductionFactor = 0.5f;
if (lodIndex == 0)
{
//first lod
@@ -1033,17 +1030,18 @@ namespace AZ
else
{
//every other lod: use the previous lod's min
lod.m_screenCoverageMax = AZStd::GetMax(lodData.m_lods[lodIndex-1].m_screenCoverageMin, MinimumScreenCoverage);
lod.m_screenCoverageMax = AZStd::GetMax(lodData.m_lods[lodIndex - 1].m_screenCoverageMin, lodData.m_lodConfiguration.m_minimumScreenCoverage);
}
if (lodIndex < lodAssets.size() - 1)
{
//first and middle lods: compute a stepdown value for the min
lod.m_screenCoverageMin = AZStd::GetMax(ReductionFactor * lod.m_screenCoverageMax, MinimumScreenCoverage);
lod.m_screenCoverageMin = AZStd::GetMax(lodData.m_lodConfiguration.m_qualityDecayRate * lod.m_screenCoverageMax, lodData.m_lodConfiguration.m_minimumScreenCoverage);
}
else
{
//last lod: use MinimumScreenCoverage for the min
lod.m_screenCoverageMin = MinimumScreenCoverage;
lod.m_screenCoverageMin = lodData.m_lodConfiguration.m_minimumScreenCoverage;
}
lod.m_drawPackets.clear();
@@ -279,28 +279,3 @@ namespace AZ
};
}
}
// Emits an error when padding is introduced into a struct.
#if defined (AZ_COMPILER_MSVC)
#define AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN \
__pragma(warning(push)) \
__pragma(warning(error : 4820))
#define AZ_ASSERT_NO_ALIGNMENT_PADDING_END \
__pragma(warning(pop))
#elif defined (AZ_COMPILER_CLANG) || defined (AZ_COMPILER_GCC)
#define AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic error \"-Wpadded\"")
#define AZ_ASSERT_NO_ALIGNMENT_PADDING_END \
_Pragma("GCC diagnostic pop")
#else
#define AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
#define AZ_ASSERT_NO_ALIGNMENT_PADDING_END
#endif
@@ -67,8 +67,6 @@ namespace AZ
BufferBindFlags GetBufferBindFlags(ScopeAttachmentUsage usage, ScopeAttachmentAccess access);
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
/**
* A buffer corresponds to a region of linear memory and used for rendering operations.
* Its lifecycle is managed by buffer pools.
@@ -103,8 +101,6 @@ namespace AZ
/// The mask of queue classes supporting shared access of this resource.
HardwareQueueClassMask m_sharedQueueMask = HardwareQueueClassMask::All;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
}
@@ -19,8 +19,6 @@ namespace AZ
namespace RHI
{
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
//! Buffer views describe how to interpret a region of memory in a buffer.
struct BufferViewDescriptor
{
@@ -85,7 +83,5 @@ namespace AZ
// manual alignment padding
char m_pad0 = 0, m_pad1 = 0, m_pad2 = 0;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
}
}
@@ -21,8 +21,6 @@ namespace AZ
{
ImageBindFlags GetImageBindFlags(ScopeAttachmentUsage usage, ScopeAttachmentAccess access);
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
/**
* Images are comprised of sub-resources corresponding to the number of mip-mip levels
* and array slices. Image data is stored as pixels in opaque swizzled formats. Images
@@ -111,8 +109,6 @@ namespace AZ
uint32_t m_isCubemap = 0;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
/// Returns whether mip 'A' is more detailed than mip 'B'.
inline bool IsMipMoreDetailedThan(uint32_t mipA, uint32_t mipB)
{
@@ -20,8 +20,6 @@ namespace AZ
namespace RHI
{
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
/**
* Image views map to a range of mips / array slices in an image.
*/
@@ -124,7 +122,5 @@ namespace AZ
/// This is needed because a texture array can have 1 layer only.
uint32_t m_isArray = 0;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
}
}
@@ -42,8 +42,6 @@ namespace AZ
AZ_DEFINE_ENUM_BITWISE_OPERATORS(AZ::RHI::IndirectCommandTiers);
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
//! Arguments when setting an indirect Vertex Buffer View command.
struct IndirectBufferViewArguments
{
@@ -84,8 +82,6 @@ namespace AZ
IndirectBufferViewArguments m_vertexBufferArgs;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
AZ_FORCE_INLINE bool operator==(const IndirectCommandDescriptor& lhs, const IndirectCommandDescriptor& rhs)
{
return
@@ -19,8 +19,6 @@ namespace AZ
namespace RHI
{
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
// Defines a custom sample position when doing Multisample rendering.
// Sample positions have the origin(0, 0) at the pixel top left.
// Each of the X and Y coordinates are unsigned values in the range 0 (top / left) to Limits::Pipeline::MultiSampleCustomLocationGridSize - 1 (bottom / right).
@@ -56,7 +54,5 @@ namespace AZ
uint16_t m_samples = 1;
uint16_t m_quality = 0;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
}
}
@@ -22,7 +22,6 @@ namespace AZ
{
namespace RHI
{
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
struct ResourceBindingInfo
{
AZ_TYPE_INFO(ResourceBindingInfo, "{2B25FA97-21C2-4567-8F01-6A64F7B9DFF6}");
@@ -45,7 +44,6 @@ namespace AZ
/// Register id of a resource.
Register m_registerId = InvalidRegister;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
/**
* This class describes binding information about the Shader Resource Group
@@ -23,7 +23,6 @@ namespace AZ
{
static const uint32_t InvalidRenderAttachmentIndex = Limits::Pipeline::RenderAttachmentCountMax;
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
//! Describes one render attachment that is part of a layout.
struct RenderAttachmentDescriptor
{
@@ -91,7 +90,6 @@ namespace AZ
//! List with the layout of each subpass.
AZStd::array<SubpassRenderAttachmentLayout, Limits::Pipeline::SubpassCountMax> m_subpassLayouts;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
//! Describes the layout of a collection of subpasses and it defines which of the subpasses this
//! configuration will be using.
@@ -82,8 +82,6 @@ namespace AZ
void ReflectRenderStateEnums(ReflectContext* context);
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
struct RasterState
{
AZ_TYPE_INFO(RasterState, "{57D4BE50-EBE2-4ABE-90A4-C99BF2EA43FB}");
@@ -216,8 +214,6 @@ namespace AZ
static constexpr int32_t RenderStates_InvalidInt = std::numeric_limits<int32_t>::max();
static constexpr float RenderStates_InvalidFloat = std::numeric_limits<float>::max();
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
//! Merges any render states in stateToMerge into the result state object.
//! The values in stateToMerge are only copied over into the result if they are
//! not invalid (see also GetInvalidState below).
@@ -70,8 +70,6 @@ namespace AZ
void ReflectSamplerStateEnums(ReflectContext* context);
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
class SamplerState
{
public:
@@ -107,8 +105,6 @@ namespace AZ
float m_mipLodBias = 0.0f;
BorderColor m_borderColor = BorderColor::TransparentBlack;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
}
AZ_TYPE_INFO_SPECIALIZE(RHI::FilterMode, "{CFAE2156-0293-4D71-87D5-68F5C9F98884}");
@@ -173,13 +173,14 @@ namespace AZ
static void Reflect(AZ::ReflectContext* context);
CpuProfilingStatisticsSerializerEntry() = default;
CpuProfilingStatisticsSerializerEntry(const RHI::CachedTimeRegion& cachedTimeRegion);
CpuProfilingStatisticsSerializerEntry(const RHI::CachedTimeRegion& cachedTimeRegion, AZStd::thread_id threadId);
Name m_groupName;
Name m_regionName;
uint16_t m_stackDepth;
AZStd::sys_time_t m_startTick;
AZStd::sys_time_t m_endTick;
size_t m_threadId;
};
AZ_TYPE_INFO(CpuProfilingStatisticsSerializer, "{D5B02946-0D27-474F-9A44-364C2706DD41}");
@@ -24,8 +24,6 @@ namespace AZ
uint32_t GetIndexFormatSize(IndexFormat indexFormat);
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
class IndexBufferView
{
public:
@@ -61,7 +59,5 @@ namespace AZ
// Padding the size so it's 8 bytes aligned
uint32_t m_pad = 0;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
}
}
@@ -17,8 +17,6 @@ namespace AZ
class Buffer;
class IndirectBufferSignature;
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
//! Provides a view into a buffer, to be used as an indirect buffer. The content of the view is a contiguous
//! list of commands sequences. It is provided to the RHI back-end at draw time.
class IndirectBufferView
@@ -62,7 +60,5 @@ namespace AZ
// Padding the size so it's 8 bytes aligned
uint32_t m_pad = 0;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
}
}
@@ -18,8 +18,6 @@ namespace AZ
class Buffer;
class InputStreamLayout;
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
/**
* Provides a view into a buffer, to be used as vertex stream. The content of the view is a contiguous
* list of input vertex data. It is provided to the RHI back-end at draw time.
@@ -68,8 +66,6 @@ namespace AZ
uint32_t m_pad = 0;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
/// Utility function for checking that the set of StreamBufferViews aligns with the InputStreamLayout
bool ValidateStreamBufferViews(const InputStreamLayout& inputStreamLayout, AZStd::array_view<StreamBufferView> streamBufferViews);
}
@@ -417,14 +417,14 @@ namespace AZ
// Create serializable entries
for (const auto& timeRegionMap : continuousData)
{
for (const auto& threadEntry : timeRegionMap)
for (const auto& [threadId, regionMap] : timeRegionMap)
{
for (const auto& cachedRegionEntry : threadEntry.second)
for (const auto& [regionName, regionVec] : regionMap)
{
m_cpuProfilingStatisticsSerializerEntries.insert(
m_cpuProfilingStatisticsSerializerEntries.end(),
cachedRegionEntry.second.begin(),
cachedRegionEntry.second.end());
for (const auto& region : regionVec)
{
m_cpuProfilingStatisticsSerializerEntries.emplace_back(region, threadId);
}
}
}
}
@@ -445,13 +445,15 @@ namespace AZ
// --- CpuProfilingStatisticsSerializerEntry ---
CpuProfilingStatisticsSerializer::CpuProfilingStatisticsSerializerEntry::CpuProfilingStatisticsSerializerEntry(const RHI::CachedTimeRegion& cachedTimeRegion)
CpuProfilingStatisticsSerializer::CpuProfilingStatisticsSerializerEntry::CpuProfilingStatisticsSerializerEntry(
const RHI::CachedTimeRegion& cachedTimeRegion, AZStd::thread_id threadId)
{
m_groupName = cachedTimeRegion.m_groupRegionName->m_groupName;
m_regionName = cachedTimeRegion.m_groupRegionName->m_regionName;
m_stackDepth = cachedTimeRegion.m_stackDepth;
m_startTick = cachedTimeRegion.m_startTick;
m_endTick = cachedTimeRegion.m_endTick;
m_threadId = AZStd::hash<AZStd::thread_id>{}(threadId);
}
void CpuProfilingStatisticsSerializer::CpuProfilingStatisticsSerializerEntry::Reflect(AZ::ReflectContext* context)
@@ -465,6 +467,7 @@ namespace AZ
->Field("stackDepth", &CpuProfilingStatisticsSerializerEntry::m_stackDepth)
->Field("startTick", &CpuProfilingStatisticsSerializerEntry::m_startTick)
->Field("endTick", &CpuProfilingStatisticsSerializerEntry::m_endTick)
->Field("threadId", &CpuProfilingStatisticsSerializerEntry::m_threadId)
;
}
}
@@ -58,7 +58,6 @@ namespace AZ
RHI::Origin m_offset;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
struct BarrierInfo
{
VkPipelineStageFlags m_srcStageMask = {};
@@ -67,7 +66,6 @@ namespace AZ
bool operator==(const BarrierInfo& other) { return ::memcmp(this, &other, sizeof(BarrierInfo)) == 0; }
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
void EmmitBarriers(CommandList& commandList, const AZStd::vector<BarrierInfo>& barriers) const;
@@ -23,7 +23,6 @@ namespace AZ
class SwapChain;
class Fence;
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
struct QueueId
{
uint32_t m_familyIndex = 0;
@@ -32,7 +31,6 @@ namespace AZ
bool operator==(const QueueId& other) const { return ::memcmp(this, &other, sizeof(other)) == 0; }
bool operator!=(const QueueId& other) const { return !(*this == other); }
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
class Queue final
: public RHI::DeviceObject
@@ -38,8 +38,6 @@ namespace AZ
~RenderPass() = default;
static RHI::Ptr<RenderPass> Create();
AZ_ASSERT_NO_ALIGNMENT_PADDING_BEGIN
enum class AttachmentType : uint32_t
{
Color, // Color render target attachment
@@ -98,8 +96,6 @@ namespace AZ
SubpassAttachment m_depthStencilAttachment;
};
AZ_ASSERT_NO_ALIGNMENT_PADDING_END
struct Descriptor
{
size_t GetHash() const;
@@ -29,10 +29,19 @@ namespace AZ
: public AZ::EBusTraits
{
public:
//! Returns true if the converion was successful
virtual bool IsEnabled() const = 0;
//! Converts data from a IMaterialData object to an Atom MaterialSourceData.
//! Only works when IsEnabled() is true.
//! @return true if the MaterialSourceData output was populated with converted material data.
virtual bool ConvertMaterial(const AZ::SceneAPI::DataTypes::IMaterialData& materialData, MaterialSourceData& out) = 0;
//! Returns the path to the .materialtype file that the materials are based on, such as StandardPBR.materialtype, etc.
virtual const char* GetMaterialTypePath() const = 0;
//! Returns the path to the .materialtype file that the converted materials are based on, such as StandardPBR.materialtype, etc.
virtual AZStd::string GetMaterialTypePath() const = 0;
//! Returns the path to a .material file to use as the default material when conversion is disabled.
virtual AZStd::string GetDefaultMaterialPath() const = 0;
};
using MaterialConverterBus = AZ::EBus<MaterialConverterRequests>;

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