Merge remote-tracking branch 'upstream/stabilization/2110' into Atom/amzn-tommy/ATOM-16289_SkyboxHotReloading

Signed-off-by: Tommy Walton <waltont@amazon.com>
This commit is contained in:
Tommy Walton
2021-11-10 13:20:47 -08:00
186 changed files with 2191 additions and 1158 deletions
@@ -31,6 +31,7 @@ namespace AZ
static constexpr const char UvGroupName[] = "uvSets";
class MaterialAsset;
class MaterialAssetCreator;
//! This is a simple data structure for serializing in/out material source files.
class MaterialSourceData final
@@ -78,15 +79,33 @@ namespace AZ
//! Creates a MaterialAsset from the MaterialSourceData content.
//! @param assetId ID for the MaterialAsset
//! @param materialSourceFilePath Indicates the path of the .material file that the MaterialSourceData represents. Used for resolving file-relative paths.
//! @param materialSourceFilePath Indicates the path of the .material file that the MaterialSourceData represents. Used for
//! resolving file-relative paths.
//! @param elevateWarnings Indicates whether to treat warnings as errors
//! @param includeMaterialPropertyNames Indicates whether to save material property names into the material asset file
Outcome<Data::Asset<MaterialAsset>> CreateMaterialAsset(
Data::AssetId assetId,
AZStd::string_view materialSourceFilePath = "",
bool elevateWarnings = true,
bool includeMaterialPropertyNames = true
) const;
bool includeMaterialPropertyNames = true) const;
//! Creates a MaterialAsset from the MaterialSourceData content.
//! @param assetId ID for the MaterialAsset
//! @param materialSourceFilePath Indicates the path of the .material file that the MaterialSourceData represents. Used for
//! resolving file-relative paths.
//! @param elevateWarnings Indicates whether to treat warnings as errors
//! @param includeMaterialPropertyNames Indicates whether to save material property names into the material asset file
//! @param sourceDependencies if not null, will be populated with a set of all of the loaded material and material type paths
Outcome<Data::Asset<MaterialAsset>> CreateMaterialAssetFromSourceData(
Data::AssetId assetId,
AZStd::string_view materialSourceFilePath = "",
bool elevateWarnings = true,
bool includeMaterialPropertyNames = true,
AZStd::unordered_set<AZStd::string>* sourceDependencies = nullptr) const;
private:
void ApplyPropertiesToAssetCreator(
AZ::RPI::MaterialAssetCreator& materialAssetCreator, const AZStd::string_view& materialSourceFilePath) const;
};
} // namespace RPI
} // namespace AZ
@@ -56,8 +56,8 @@ namespace AZ
OwnerRenderPipeline = AZ_BIT(5)
};
void SetOwenrScene(const Scene* scene);
void SetOwenrRenderPipeline(const RenderPipeline* renderPipeline);
void SetOwnerScene(const Scene* scene);
void SetOwnerRenderPipeline(const RenderPipeline* renderPipeline);
void SetPassName(Name passName);
void SetTemplateName(Name passTemplateName);
void SetPassClass(TypeId passClassTypeId);
@@ -97,8 +97,7 @@ namespace AZ
// SystemTickBus::OnTick
void OnSystemTick() override;
// Fill system time and game time information for simulation or rendering
void FillTickTimeInfo();
float GetCurrentTime();
// The set of core asset handlers registered by the system.
AZStd::vector<AZStd::unique_ptr<Data::AssetHandler>> m_assetHandlers;
@@ -124,7 +123,8 @@ namespace AZ
// The job policy used for feature processor's rendering prepare
RHI::JobPolicy m_prepareRenderJobPolicy = RHI::JobPolicy::Parallel;
TickTimeInfo m_tickTime;
ScriptTimePoint m_startTime;
float m_currentSimulationTime = 0.0f;
RPISystemDescriptor m_descriptor;
@@ -32,7 +32,6 @@ namespace AZ
namespace RPI
{
class Scene;
struct TickTimeInfo;
class ShaderResourceGroup;
class AnyAsset;
class WindowContext;
@@ -203,7 +202,7 @@ namespace AZ
void OnRemovedFromScene(Scene* scene);
// Called when this pipeline is about to be rendered
void OnStartFrame(const TickTimeInfo& tick);
void OnStartFrame(float time);
// Called when the rendering of current frame is finished.
void OnFrameEnd();
@@ -48,14 +48,6 @@ namespace AZ
// Callback function to modify values of a ShaderResourceGroup
using ShaderResourceGroupCallback = AZStd::function<void(ShaderResourceGroup*)>;
//! A structure for ticks which contains system time and game time.
struct TickTimeInfo
{
float m_currentGameTime;
float m_gameDeltaTime = 0;
};
class Scene final
: public SceneRequestBus::Handler
{
@@ -179,12 +171,14 @@ namespace AZ
// Cpu simulation which runs all active FeatureProcessor Simulate() functions.
// @param jobPolicy if it's JobPolicy::Parallel, the function will spawn a job thread for each FeatureProcessor's simulation.
void Simulate(const TickTimeInfo& tickInfo, RHI::JobPolicy jobPolicy);
// @param simulationTime the number of seconds since the application started
void Simulate(RHI::JobPolicy jobPolicy, float simulationTime);
// Collect DrawPackets from FeatureProcessors
// @param jobPolicy if it's JobPolicy::Parallel, the function will spawn a job thread for each FeatureProcessor's
// PrepareRender.
void PrepareRender(const TickTimeInfo& tickInfo, RHI::JobPolicy jobPolicy);
// @param simulationTime the number of seconds since the application started; this is the same time value that was passed to Simulate()
void PrepareRender(RHI::JobPolicy jobPolicy, float simulationTime);
// Function called when the current frame is finished rendering.
void OnFrameEnd();
@@ -267,6 +261,7 @@ namespace AZ
// Registry which allocates draw filter tag for RenderPipeline
RHI::Ptr<RHI::DrawFilterTagRegistry> m_drawFilterTagRegistry;
RHI::ShaderInputConstantIndex m_timeInputIndex;
float m_simulationTime;
};
@@ -118,7 +118,7 @@ namespace AZ
ResetIssueCounts(); // Because the asset creator can be used multiple times
m_asset = Data::AssetManager::Instance().CreateAsset<AssetDataT>(assetId, AZ::Data::AssetLoadBehavior::PreLoad);
m_asset = Data::Asset<AssetDataT>(assetId, aznew AssetDataT, AZ::Data::AssetLoadBehavior::PreLoad);
m_beginCalled = true;
if (!m_asset)
@@ -138,6 +138,7 @@ namespace AZ
}
else
{
Data::AssetManager::Instance().AssignAssetData(m_asset);
result = AZStd::move(m_asset);
success = true;
}