Shaders changes require two or more change cycles before updating (#5142)
* Shaders changes require two or more change cycles before updating This fixes the problem described in the title. Consolidated the responsibility to update the root shader variant asset into the Shader() class. It was unnecessarily spread across Shader(), ShaderVariant() and ShaderAsset(). In particular OnAssetReloaded now makes a temporary copy of the root ShaderVariantAsset and updates the ShaderAsset with such reference only when OnAssetReloaded() is called on behalf of the ShaderAsset. Signed-off-by: galibzon <66021303+galibzon@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -196,7 +196,7 @@ namespace AZ
|
||||
{
|
||||
// bake is complete, update configuration with the new baked texture asset
|
||||
AzToolsFramework::ScopedUndoBatch undoBatch("DiffuseProbeGrid Texture Bake");
|
||||
configurationAsset = { textureAsset.GetAs<RPI::StreamingImageAsset>(), AZ::Data::AssetLoadBehavior::PreLoad };
|
||||
configurationAsset = textureAsset;
|
||||
SetDirty();
|
||||
|
||||
if (m_controller.m_configuration.m_bakedIrradianceTextureAsset.IsReady() &&
|
||||
|
||||
+1
-1
@@ -178,7 +178,7 @@ namespace AZ
|
||||
if (notificationType == CubeMapAssetNotificationType::Ready)
|
||||
{
|
||||
// bake is complete, update configuration with the new baked cubemap asset
|
||||
m_controller.m_configuration.m_bakedCubeMapAsset = { cubeMapAsset.GetAs<RPI::StreamingImageAsset>(), AZ::Data::AssetLoadBehavior::PreLoad };
|
||||
m_controller.m_configuration.m_bakedCubeMapAsset = cubeMapAsset;
|
||||
|
||||
// refresh the currently rendered cubemap
|
||||
m_controller.UpdateCubeMap();
|
||||
|
||||
Reference in New Issue
Block a user