Merge remote-tracking branch 'upstream/main' into Atom/santorac/MaterialTypeCleanup

This commit is contained in:
Chris Santora
2021-05-26 21:39:28 -07:00
383 changed files with 5109 additions and 2147 deletions
@@ -87,6 +87,14 @@ namespace AZ
//! Finalize and validate initialization. Any initialization functions should be called before EndInit is called.
void EndInit();
//! Set up the DynamicDrawContext for the input Scene.
//! This should be called after the last frame is done and before any draw calls.
void SetScene(Scene* scene);
//! Set up the DynamicDrawContext for the input RenderPipeline.
//! This should be called after the last frame is done and before any draw calls.
void SetRenderPipeline(RenderPipeline* pipeline);
//! Return if this DynamicDrawContext is ready to add draw calls
bool IsReady();
@@ -26,9 +26,9 @@ namespace AZ
class ViewportContextManager;
//! ViewportContext wraps a native window and represents a minimal viewport
//! in which a scene is rendered on-screen
//! in which a scene is rendered on-screen.
//! ViewportContexts are registered on creation to allow consumers to listen to notifications
//! and manage the view stack for a given viewport
//! and manage the view stack for a given viewport.
class ViewportContext
: public SceneNotificationBus::Handler
, public AzFramework::WindowNotificationBus::Handler
@@ -61,11 +61,11 @@ namespace AZ
//! Gets the current name of this ViewportContext.
//! This name is used to tie this ViewportContext to its View stack, and ViewportContexts may be
//! renamed via AZ::Interface<ViewportContextRequestsInterface>::Get()->RenameViewportContext.
//! renamed via AZ::RPI::ViewportContextRequests::Get()->RenameViewportContext(...).
AZ::Name GetName() const;
//! Gets the default view associated with this ViewportContext.
//! Alternatively, use AZ::Interface<ViewportContextRequestsInterface>::Get()->GetCurrentView.
//! Alternatively, use AZ::RPI::ViewportContextRequests::Get()->GetCurrentView().
ViewPtr GetDefaultView();
ConstViewPtr GetDefaultView() const;
@@ -99,6 +99,18 @@ namespace AZ
//! Notifies consumers when the render scene has changed.
void ConnectSceneChangedHandler(SceneChangedEvent::Handler& handler);
using PipelineChangedEvent = AZ::Event<RenderPipelinePtr>;
//! Notifies consumers when the current pipeline associated with our window has changed.
void ConnectCurrentPipelineChangedHandler(PipelineChangedEvent::Handler& handler);
using ViewChangedEvent = AZ::Event<ViewPtr>;
//! Notifies consumers when the default view has changed.
void ConnectDefaultViewChangedHandler(ViewChangedEvent::Handler& handler);
using ViewportIdEvent = AZ::Event<AzFramework::ViewportId>;
//! Notifies consumers when this ViewportContext is about to be destroyed.
void ConnectAboutToBeDestroyedHandler(ViewportIdEvent::Handler& handler);
// ViewportRequestBus interface
//! Gets the current camera's view matrix.
const AZ::Matrix4x4& GetCameraViewMatrix() const override;
@@ -123,12 +135,17 @@ namespace AZ
WindowContextSharedPtr m_windowContext;
ViewPtr m_defaultView;
AzFramework::WindowSize m_viewportSize;
SizeChangedEvent m_sizeChangedEvent;
MatrixChangedEvent m_viewMatrixChangedEvent;
MatrixChangedEvent::Handler m_onViewMatrixChangedHandler;
MatrixChangedEvent m_projectionMatrixChangedEvent;
MatrixChangedEvent::Handler m_onProjectionMatrixChangedHandler;
SceneChangedEvent m_sceneChangedEvent;
PipelineChangedEvent m_currentPipelineChangedEvent;
ViewChangedEvent m_defaultViewChangedEvent;
ViewportIdEvent m_aboutToBeDestroyedEvent;
ViewportContextManager* m_manager;
RenderPipelinePtr m_currentPipeline;
Name m_name;