Browse Source

Updated the MaterialHotReloadTest "14_HorizontalPattern.png" step to wait for the .shadervariantlist to finish processing. This fixes an intermittent failure (8/30) where sometimes it would have the root variant and sometimes the baked variant. Now it consistently has the baked variant. There was note in the script (originally written by me) about trying to hit a specific time window to test that the new shader was used as soon as possible. This test case was originally used to validate the ShaderAsset m_buildTimestamp check, but even when I commented out that check the test still passed. So considering that the original edge case is no longer enforced by this check (I guess some other improvement is also addressing the edge case), I decided it wasn't worth the intermittent failures. The main aspect of the test case (making sure we see the horizontal pattern rather than the vertical one) is still intact.

Signed-off-by: santorac <[email protected]>
santorac 3 years ago
parent
commit
95dc68753d
1 changed files with 1 additions and 6 deletions
  1. 1 6
      Scripts/MaterialHotReloadTest.bv.lua

+ 1 - 6
Scripts/MaterialHotReloadTest.bv.lua

@@ -136,15 +136,10 @@ CaptureScreenshot(g_screenshotOutputFolder .. '/13_Variants_All.png')
 -- over the fully-baked variant because it is more recent.
 -- over the fully-baked variant because it is more recent.
 AssetTracking_Start()
 AssetTracking_Start()
 SetImguiValue('Horizontal Pattern', true)
 SetImguiValue('Horizontal Pattern', true)
--- Note that here we explicitly do NOT wait for HotReloadTest.shadervariantlist even though the ShaderVariantAssets will be rebuild here too; 
--- part of this test is to ensure the updated shader code is used as soon as the root variant is available.
 AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype")
 AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype")
 AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader")
 AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader")
+AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 3) -- Waiting for 3 products, the list asset and two variant assets
 AssetTracking_IdleUntilExpectedAssetsFinish(10)
 AssetTracking_IdleUntilExpectedAssetsFinish(10)
--- We want this idle to be short enough that the ShaderVariantAssets don't have time to finish building before we take the screenshot, as part
--- of the validation that the root variant gets applied asap. But it also needs to be long enough to account for some delay between the
--- AssetTracking utility and the asset system triggering the reload. We should avoid increasing this if possible (but maybe we'll have no 
--- choice ... we'll see)
 IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload
 IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload
 CaptureScreenshot(g_screenshotOutputFolder .. '/14_HorizontalPattern.png')
 CaptureScreenshot(g_screenshotOutputFolder .. '/14_HorizontalPattern.png')