2
0
Эх сурвалжийг харах

Proposed changes to remove material hot reloading and related notification buses from inside material assets and classes

this change is removing the material hot reload test from the sample viewer corresponding to the buses and support being removed

Signed-off-by: gadams3 <[email protected]>
gadams3 2 жил өмнө
parent
commit
da2d52e240
24 өөрчлөгдсөн 14 нэмэгдсэн , 960 устгасан
  1. 0 608
      Gem/Code/Source/MaterialHotReloadTestComponent.cpp
  2. 0 112
      Gem/Code/Source/MaterialHotReloadTestComponent.h
  3. 0 2
      Gem/Code/Source/SampleComponentManager.cpp
  4. 3 3
      Gem/Code/Source/ShaderReloadTestComponent.cpp
  5. 0 2
      Gem/Code/atomsampleviewergem_private_files.cmake
  6. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/01_Default.png
  7. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/02_Red.png
  8. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/03_Blue.png
  9. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/04_DefaultAgain.png
  10. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/05_WavyLines.png
  11. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/06_VerticalPattern.png
  12. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/07_BlendingOn.png
  13. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/08_Variants_All.png
  14. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/09_Variants_OnlyStraightLines.png
  15. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/10_Variants_OnlyWavyLines.png
  16. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/11_Variants_None.png
  17. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/12_Variants_None_AfterUpdatingShader.png
  18. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/13_Variants_All.png
  19. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/14_HorizontalPattern.png
  20. 0 3
      Scripts/ExpectedScreenshots/MaterialHotReloadTest/15_Red_AfterShaderReload.png
  21. 0 169
      Scripts/MaterialHotReloadTest.bv.lua
  22. 0 1
      Scripts/_FullTestSuite_.bv.lua
  23. 0 1
      atomsampleviewer_asset_files.cmake
  24. 11 17
      generate_asset_cmake.bat

+ 0 - 608
Gem/Code/Source/MaterialHotReloadTestComponent.cpp

@@ -1,608 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include <MaterialHotReloadTestComponent.h>
-#include <SampleComponentManager.h>
-#include <SampleComponentConfig.h>
-#include <Automation/ScriptableImGui.h>
-#include <Automation/ScriptRunnerBus.h>
-
-#include <Atom/RPI.Reflect/Model/ModelAsset.h>
-#include <Atom/RPI.Reflect/Material/MaterialAsset.h>
-#include <Atom/RPI.Reflect/Asset/AssetUtils.h>
-#include <Atom/Feature/Material/MaterialAssignment.h>
-
-#include <AzCore/IO/Path/Path.h>
-#include <AzFramework/IO/LocalFileIO.h>
-#include <AzFramework/Asset/AssetSystemBus.h>
-#include <AzFramework/Asset/AssetProcessorMessages.h>
-#include <Atom/RPI.Public/RPISystemInterface.h>
-#include <AzCore/Utils/Utils.h>
-
-#include <RHI/BasicRHIComponent.h>
-
-namespace AtomSampleViewer
-{
-    using namespace AZ;
-    using namespace RPI;
-
-    namespace
-    {
-        namespace Sources
-        {
-            static constexpr const char MaterialFileName[] = "HotReloadTest.material";
-            static constexpr const char MaterialTypeFileName[] = "HotReloadTest.materialtype";
-            static constexpr const char ShaderFileName[] = "HotReloadTest.shader";
-            static constexpr const char AzslFileName[] = "HotReloadTest.azsl";
-            static constexpr const char ShaderVariantListFileName[] = "HotReloadTest.shadervariantlist";
-        }
-
-        namespace Products
-        {
-
-            static constexpr const char ModelFilePath[] = "objects/plane.azmodel";
-            static constexpr const char MaterialFilePath[] = "materials/hotreloadtest/temp/hotreloadtest.azmaterial";
-            static constexpr const char MaterialTypeFilePath[] = "materials/hotreloadtest/temp/hotreloadtest.azmaterialtype";
-            static constexpr const char ShaderFilePath[] = "materials/hotreloadtest/temp/hotreloadtest.azshader";
-
-            static constexpr const char ShaderVariantTreeFileName[] = "hotreloadtest.azshadervarianttree";
-
-            static AZStd::string GetShaderVariantFileName(RPI::ShaderVariantStableId stableId)
-            {
-                RPISystemInterface* rpiSystem = RPISystemInterface::Get();
-                Name apiName = rpiSystem->GetRenderApiName();
-                AZStd::string filePath = AZStd::string::format("hotreloadtest_%s_%u.azshadervariant", apiName.GetCStr(), stableId.GetIndex());
-                return filePath;
-            }
-
-            // These materials are used to communicate which shader variant is being used, for screenshot comparison tests.
-            static constexpr const char RootVariantIndicatorMaterialFilePath[] = "materials/hotreloadtest/testdata/variantselection_root.azmaterial";
-            static constexpr const char FullyBakedVariantIndicatorMaterialFilePath[] = "materials/hotreloadtest/testdata/variantselection_fullybaked.azmaterial";
-        }
-
-        namespace TestData
-        {
-            namespace MaterialFileNames
-            {
-                static constexpr const char Default[] = "Material_UseDefaults.txt";
-                static constexpr const char ChangePrimaryToRed[] = "Material_ChangePrimaryToRed.txt";
-                static constexpr const char ChangePrimaryToBlue[] = "Material_ChangePrimaryToBlue.txt";
-            }
-
-            namespace MaterialTypeFileNames
-            {
-                static constexpr const char StraightLines[] = "MaterialType_StraightLines.txt";
-                static constexpr const char WavyLines[] = "MaterialType_WavyLines.txt";
-            }
-
-            namespace ShaderFileNames
-            {
-                static constexpr const char BlendingOff[] = "Shader_BlendingOff.txt";
-                static constexpr const char BlendingOn[] = "Shader_BlendingOn.txt";
-            }
-
-            namespace AzslFileNames
-            {
-                static constexpr const char HorizontalPattern[] = "AZSL_HorizontalPattern.txt";
-                static constexpr const char VerticalPattern[] = "AZSL_VerticalPattern.txt";
-            }
-
-            namespace ShaderVariantListFileNames
-            {
-                static constexpr const char All[] = "ShaderVariantList_All.txt";
-                static constexpr const char OnlyStraightLines[] = "ShaderVariantList_OnlyStraightLines.txt";
-                static constexpr const char OnlyWavyLines[] = "ShaderVariantList_OnlyWavyLines.txt";
-            }
-        }
-    }
-
-    void MaterialHotReloadTestComponent::Reflect(ReflectContext* context)
-    {
-        if (SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context))
-        {
-            serializeContext->Class<MaterialHotReloadTestComponent, CommonSampleComponentBase>()
-                ->Version(0)
-                ;
-        }
-    }
-
-    MaterialHotReloadTestComponent::MaterialHotReloadTestComponent()
-        : m_imguiSidebar{"@user@/MaterialHotReloadTestComponent/sidebar.xml"}
-    {
-    }
-    
-    void MaterialHotReloadTestComponent::InitTestDataFolders()
-    {
-        auto io = AZ::IO::LocalFileIO::GetInstance();
-
-        auto projectPath = AZ::Utils::GetProjectPath();
-        AZStd::string mainTestFolder;
-        AzFramework::StringFunc::Path::Join(projectPath.c_str(), "Materials/HotReloadTest/", mainTestFolder);
-        AzFramework::StringFunc::Path::Join(mainTestFolder.c_str(), "TestData/", m_testDataFolder);
-        if (!io->Exists(m_testDataFolder.c_str()))
-        {
-            AZ_Error("MaterialHotReloadTestComponent", false, "Could not find source folder '%s'. This sample can only be used on dev platforms.", m_testDataFolder.c_str());
-            m_testDataFolder.clear();
-            return;
-        }
-
-        AzFramework::StringFunc::Path::Join(mainTestFolder.c_str(), "Temp/", m_tempSourceFolder);
-        if (!io->CreatePath(m_tempSourceFolder.c_str()))
-        {
-            AZ_Error("MaterialHotReloadTestComponent", false, "Could not create temp folder '%s'.", m_tempSourceFolder.c_str());
-        }
-    }
-
-    void MaterialHotReloadTestComponent::Activate()
-    {
-        m_initStatus = InitStatus::None;
-        
-        TickBus::Handler::BusConnect();
-        m_imguiSidebar.Activate();
-
-        InitTestDataFolders();
-
-        // Delete any existing temp files and wait for the assets to disappear, to ensure we have a clean slate.
-        // (If we were to just replace existing temp source files with the default ones without fully
-        //  removing them first, it would be tricky to figure out whether the assets loaded assets are the new
-        //  ones or stale ones left over from a prior instance of this sample).
-        DeleteTestFile(Sources::MaterialFileName);
-        DeleteTestFile(Sources::MaterialTypeFileName);
-        DeleteTestFile(Sources::ShaderFileName);
-        DeleteTestFile(Sources::AzslFileName);
-        DeleteTestFile(Sources::ShaderVariantListFileName);
-
-        m_initStatus = InitStatus::ClearingTestAssets;
-        m_clearAssetsTimeout = 5.0f;
-
-        // Wait until the test material is fully initialized. Use a long timeout because it can take a while for the shaders to compile.
-        ScriptRunnerRequestBus::Broadcast(&ScriptRunnerRequests::PauseScriptWithTimeout, LongTimeout);
-
-        Data::AssetId modelAssetId;
-        Data::AssetCatalogRequestBus::BroadcastResult(modelAssetId, &Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, Products::ModelFilePath, AZ::Uuid::CreateNull(), false);
-        AZ_Assert(modelAssetId.IsValid(), "Failed to get model asset id: %s", Products::ModelFilePath);
-        m_modelAsset.Create(modelAssetId);
-
-        const Transform cameraTransform = Transform::CreateFromQuaternionAndTranslation(
-            Quaternion::CreateFromAxisAngle(Vector3::CreateAxisZ(), AZ::Constants::Pi),
-            Vector3{0.0f, 2.0f, 0.0f}
-        );
-        AZ::TransformBus::Event(GetCameraEntityId(), &AZ::TransformBus::Events::SetWorldTM, cameraTransform);
-
-        m_meshFeatureProcessor = Scene::GetFeatureProcessorForEntityContextId<Render::MeshFeatureProcessorInterface>(GetEntityContextId());
-
-        // The shader variant indicator banner will appear right below the main test mesh
-        m_shaderVariantIndicatorMeshTransform = Transform::CreateIdentity();
-        m_shaderVariantIndicatorMeshTransform.SetTranslation(Vector3{0.0f, 0.0f, -0.6f});
-        m_shaderVariantIndicatorMeshNonUniformScale = Vector3(1.0f, 0.125f, 1.0f);
-        m_shaderVariantIndicatorMeshTransform.SetRotation(Quaternion::CreateFromAxisAngle(Vector3::CreateAxisX(), -AZ::Constants::HalfPi));
-
-        // Load materials that will be used to indicate which shader variant is active...
-        Data::Asset<MaterialAsset> indicatorMaterialAsset;
-        indicatorMaterialAsset = AssetUtils::LoadAssetByProductPath<MaterialAsset>(Products::RootVariantIndicatorMaterialFilePath, AssetUtils::TraceLevel::Assert);
-        m_shaderVariantIndicatorMaterial_root = Material::FindOrCreate(indicatorMaterialAsset);
-        indicatorMaterialAsset = AssetUtils::LoadAssetByProductPath<MaterialAsset>(Products::FullyBakedVariantIndicatorMaterialFilePath, AssetUtils::TraceLevel::Assert);
-        m_shaderVariantIndicatorMaterial_fullyBaked = Material::FindOrCreate(indicatorMaterialAsset);
-    }
-
-    void MaterialHotReloadTestComponent::Deactivate()
-    {
-        m_meshFeatureProcessor->ReleaseMesh(m_meshHandle);
-        m_meshFeatureProcessor->ReleaseMesh(m_shaderVariantIndicatorMeshHandle);
-        m_shaderVariantIndicatorMaterial_root.reset();
-        m_shaderVariantIndicatorMaterial_fullyBaked.reset();
-        m_shaderVariantIndicatorMaterial_current.reset();
-
-        Data::AssetBus::Handler::BusDisconnect();
-        TickBus::Handler::BusDisconnect();
-        m_imguiSidebar.Deactivate();
-        
-        m_initStatus = InitStatus::None;
-
-    }
-
-    void MaterialHotReloadTestComponent::DeleteTestFile(const char* tempSourceFile)
-    {
-        AZ::IO::Path deletePath = AZ::IO::Path(m_tempSourceFolder).Append(tempSourceFile);
-
-        if (AZ::IO::LocalFileIO::GetInstance()->Exists(deletePath.c_str()))
-        {
-            if (!AZ::IO::LocalFileIO::GetInstance()->Remove(deletePath.c_str()))
-            {
-                AZ_Error("MaterialHotReloadTestComponent", false, "Failed to delete '%s'.", deletePath.c_str());
-            }
-        }
-    }
-
-    void MaterialHotReloadTestComponent::CopyTestFile(const AZStd::string& testDataFile, const AZStd::string& tempSourceFile)
-    {
-        // Instead of copying the file using AZ::IO::LocalFileIO, we load the file and write out a new file over top
-        // the destination. This is necessary to make the AP reliably detect the changes (if we just copy the file,
-        // sometimes it recognizes the OS level copy as an updated file and sometimes not).
-
-        AZ::IO::Path copyFrom = AZ::IO::Path(m_testDataFolder).Append(testDataFile);
-        AZ::IO::Path copyTo = AZ::IO::Path(m_tempSourceFolder).Append(tempSourceFile);
-
-        auto readResult = AZ::Utils::ReadFile(copyFrom.c_str());
-        if (!readResult.IsSuccess())
-        {
-            AZ_Error("MaterialHotReloadTestComponent", false, "%s", readResult.GetError().c_str());
-            return;
-        }
-
-        auto writeResult = AZ::Utils::WriteFile(readResult.GetValue(), copyTo.c_str());
-        if (!writeResult.IsSuccess())
-        {
-            AZ_Error("MaterialHotReloadTestComponent", false, "%s", writeResult.GetError().c_str());
-            return;
-        }
-    }
-
-    const char* ToString(AzFramework::AssetSystem::AssetStatus status)
-    {
-        switch (status)
-        {
-            case AzFramework::AssetSystem::AssetStatus_Missing: return "Missing";
-            case AzFramework::AssetSystem::AssetStatus_Queued: return "Queued...";
-            case AzFramework::AssetSystem::AssetStatus_Compiling: return "Compiling...";
-            case AzFramework::AssetSystem::AssetStatus_Compiled: return "Compiled";
-            case AzFramework::AssetSystem::AssetStatus_Failed: return "Failed";
-            default: return "Unknown";
-        }
-    }
-
-    AzFramework::AssetSystem::AssetStatus MaterialHotReloadTestComponent::GetTestAssetStatus(const char* tempSourceFile) const
-    {
-        AZStd::string filePath = AZStd::string("Materials/HotReloadTest/Temp/") + tempSourceFile;
-
-        AzFramework::AssetSystem::AssetStatus status = AzFramework::AssetSystem::AssetStatus::AssetStatus_Unknown;
-        AzFramework::AssetSystemRequestBus::BroadcastResult(status, &AzFramework::AssetSystem::AssetSystemRequests::GetAssetStatusSearchType,
-            filePath.c_str(), AzFramework::AssetSystem::RequestAssetStatus::SearchType::Exact);
-
-        return status;
-    }
-
-    void MaterialHotReloadTestComponent::DrawAssetStatus(const char* tempSourceFile, bool includeFileName)
-    {
-        AzFramework::AssetSystem::AssetStatus status = GetTestAssetStatus(tempSourceFile);
-
-        if (includeFileName)
-        {
-            ImGui::Text("%s", tempSourceFile);
-            ImGui::Indent();
-        }
-
-        ImGui::Text("Status:");
-        ImGui::SameLine();
-        ImGui::Text("%s", ToString(status));
-
-        if (includeFileName)
-        {
-            ImGui::Unindent();
-        }
-    }
-
-    Data::AssetId MaterialHotReloadTestComponent::GetAssetId(const char* productFilePath)
-    {
-        Data::AssetId assetId;
-        Data::AssetCatalogRequestBus::BroadcastResult(assetId, &Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, productFilePath, AZ::Uuid::CreateNull(), false);
-        return assetId;
-    }
-
-    void MaterialHotReloadTestComponent::OnAssetReady(AZ::Data::Asset<AZ::Data::AssetData> asset)
-    {
-        if (m_initStatus == InitStatus::WaitingForDefaultMaterialToLoad && asset.GetId() == m_materialAsset.GetId())
-        {
-            m_materialAsset = asset;
-            Data::AssetBus::Handler::BusDisconnect(asset.GetId());
-            m_initStatus = InitStatus::Ready;
-
-            // Now that we finally have the material asset, we can add the model to the scene...
-
-            m_material = Material::Create(m_materialAsset);
-
-            Transform meshTransform = Transform::CreateFromQuaternion(Quaternion::CreateFromAxisAngle(Vector3::CreateAxisX(), -AZ::Constants::HalfPi));
-            m_meshHandle = m_meshFeatureProcessor->AcquireMesh(AZ::Render::MeshHandleDescriptor{ m_modelAsset }, m_material);
-            m_meshFeatureProcessor->SetTransform(m_meshHandle, meshTransform);
-
-            Data::Instance<RPI::Model> model = GetMeshFeatureProcessor()->GetModel(m_meshHandle);
-            if (model)
-            {
-                // Both the model and material are ready so scripts can continue
-                ScriptRunnerRequestBus::Broadcast(&ScriptRunnerRequests::ResumeScript);
-            }
-            else
-            {
-                // The material is ready but the model isn't ready yet; wait until it's ready before allowing scripts to continue
-                m_meshChangedHandler = AZ::Render::MeshFeatureProcessorInterface::ModelChangedEvent::Handler
-                    {
-                        [](AZ::Data::Instance<AZ::RPI::Model> model) { ScriptRunnerRequestBus::Broadcast(&ScriptRunnerRequests::ResumeScript); }
-                    };
-                GetMeshFeatureProcessor()->ConnectModelChangeEventHandler(m_meshHandle, m_meshChangedHandler);
-            }
-        }
-    }
-
-    MaterialHotReloadTestComponent::ShaderVariantStatus MaterialHotReloadTestComponent::GetShaderVariantStatus() const
-    {
-        ShaderVariantStatus shaderVariantStatus = ShaderVariantStatus::None;
-
-        if (m_material)
-        {
-            const AZ::RPI::MeshDrawPacketLods& drawPackets = GetMeshFeatureProcessor()->GetDrawPackets(m_meshHandle);
-            if (!drawPackets.empty())
-            {
-                AZ_Assert(drawPackets.size() == 1, "Expected exactly 1 LOD");
-                AZ_Assert(drawPackets[0].size() == 1, "Expected exactly 1 mesh");
-                AZ_Assert(drawPackets[0][0].GetMaterial() == m_material, "MeshDrawPacket didn't have the expected material.");
-
-                const RPI::MeshDrawPacket::ShaderList& activeShaderList = drawPackets[0][0].GetActiveShaderList();
-
-                AZ_Assert(activeShaderList.size() == 1, "Expected exactly 1 active shader");
-
-                const ShaderVariantId activeVariantId = activeShaderList[0].m_activeShaderVariantId;
-                ShaderOptionGroup activeShaderOptions{activeShaderList[0].m_shader->GetAsset()->GetShaderOptionGroupLayout(), activeVariantId};
-
-                if (activeShaderOptions.IsFullySpecified())
-                {
-                    shaderVariantStatus = ShaderVariantStatus::FullyBaked;
-                }
-                else if (activeVariantId.IsEmpty())
-                {
-                    shaderVariantStatus = ShaderVariantStatus::Root;
-                }
-                else
-                {
-                    shaderVariantStatus = ShaderVariantStatus::PartiallyBaked;
-                }
-            }
-        }
-
-        return shaderVariantStatus;
-    }
-
-    void MaterialHotReloadTestComponent::OnTick([[maybe_unused]] float deltaTime, ScriptTimePoint /*scriptTime*/)
-    {
-        if (m_initStatus == InitStatus::ClearingTestAssets)
-        {
-            m_clearAssetsTimeout -= deltaTime;
-
-            Data::AssetId materialAssetId = GetAssetId(Products::MaterialFilePath);
-            Data::AssetId materialTypeAssetId = GetAssetId(Products::MaterialTypeFilePath);
-            Data::AssetId shaderAssetId = GetAssetId(Products::ShaderFilePath);
-
-            bool proceed = !materialAssetId.IsValid() && !materialTypeAssetId.IsValid() && !shaderAssetId.IsValid();
-
-            if (!proceed && m_clearAssetsTimeout < 0)
-            {
-                // There was a specific bug in the Asset Processor where deleting a source file does not always remove the corresponding product
-                // from the cache and from the asset database.
-                AZ_Error("MaterialHotReloadTestComponent", false, "Timed out while waiting for test assets to be removed.");
-                proceed = true;
-            }
-
-            if (proceed)
-            {
-                // [GFX TODO] [ATOM-5899] Once this ticket is addressed, This block can call all required CopyTestFile() at once,
-                //            and the states InitStatus::CopyingDefault***TestFile won't be needed.
-                // Any stale assets have been cleared, now we can create the new ones.
-                // Copy a default set files into the temp folder.
-                CopyTestFile(TestData::AzslFileNames::HorizontalPattern, Sources::AzslFileName);
-                CopyTestFile(TestData::ShaderFileNames::BlendingOff, Sources::ShaderFileName);
-                m_initStatus = InitStatus::CopyingDefaultShaderTestFile;
-            }
-        }
-
-        if (m_initStatus == InitStatus::CopyingDefaultShaderTestFile)
-        {
-            AzFramework::AssetSystem::AssetStatus status = GetTestAssetStatus(Sources::ShaderFileName);
-            if (status == AzFramework::AssetSystem::AssetStatus::AssetStatus_Compiled)
-            {
-                CopyTestFile(TestData::MaterialTypeFileNames::StraightLines, Sources::MaterialTypeFileName);
-                m_initStatus = InitStatus::CopyingDefaultMaterialTypeTestFile;
-            }
-        }
-        else if (m_initStatus == InitStatus::CopyingDefaultMaterialTypeTestFile)
-        {
-            AzFramework::AssetSystem::AssetStatus status = GetTestAssetStatus(Sources::MaterialTypeFileName);
-            if (status == AzFramework::AssetSystem::AssetStatus::AssetStatus_Compiled)
-            {
-                CopyTestFile(TestData::MaterialFileNames::Default, Sources::MaterialFileName);
-                m_initStatus = InitStatus::WaitingForDefaultMaterialToRegister;
-            }
-        }
-
-        if (m_initStatus == InitStatus::WaitingForDefaultMaterialToRegister)
-        {
-            Data::AssetId materialAssetId = GetAssetId(Products::MaterialFilePath);
-            if (materialAssetId.IsValid())
-            {
-                m_initStatus = InitStatus::WaitingForDefaultMaterialToLoad;
-                Data::AssetBus::Handler::BusConnect(materialAssetId);
-                m_materialAsset.Create(materialAssetId, true);
-            }
-        }
-
-        auto shaderVariantStatus = GetShaderVariantStatus();
-        if (shaderVariantStatus == ShaderVariantStatus::None)
-        {
-            m_meshFeatureProcessor->ReleaseMesh(m_shaderVariantIndicatorMeshHandle);
-            m_shaderVariantIndicatorMaterial_current.reset();
-        }
-        else
-        {
-            bool updateIndicatorMesh = false;
-            if (shaderVariantStatus == ShaderVariantStatus::Root)
-            {
-                if (m_shaderVariantIndicatorMaterial_current != m_shaderVariantIndicatorMaterial_root)
-                {
-                    m_shaderVariantIndicatorMaterial_current = m_shaderVariantIndicatorMaterial_root;
-                    updateIndicatorMesh = true;
-                }
-            }
-            else if(shaderVariantStatus == ShaderVariantStatus::FullyBaked)
-            {
-                if (m_shaderVariantIndicatorMaterial_current != m_shaderVariantIndicatorMaterial_fullyBaked)
-                {
-                    m_shaderVariantIndicatorMaterial_current = m_shaderVariantIndicatorMaterial_fullyBaked;
-                    updateIndicatorMesh = true;
-                }
-            }
-            else
-            {
-                AZ_Assert(false, "Unsupported ShaderVariantStatus");
-            }
-
-            if (updateIndicatorMesh)
-            {
-                m_meshFeatureProcessor->ReleaseMesh(m_shaderVariantIndicatorMeshHandle);
-                m_shaderVariantIndicatorMeshHandle = m_meshFeatureProcessor->AcquireMesh(Render::MeshHandleDescriptor{ m_modelAsset }, m_shaderVariantIndicatorMaterial_current);
-                m_meshFeatureProcessor->SetTransform(m_shaderVariantIndicatorMeshHandle, m_shaderVariantIndicatorMeshTransform,
-                    m_shaderVariantIndicatorMeshNonUniformScale);
-            }
-        }
-
-        if (m_imguiSidebar.Begin())
-        {
-            if (m_initStatus != InitStatus::Ready)
-            {
-                ImGui::Text("Waiting for assets...");
-                ImGui::Separator();
-            }
-
-            ImGui::Text(Sources::MaterialFileName);
-            ImGui::Indent();
-            {
-                DrawAssetStatus(Sources::MaterialFileName);
-
-                if (m_initStatus == InitStatus::Ready)
-                {
-                    if (ScriptableImGui::Button("Default Colors"))
-                    {
-                        CopyTestFile(TestData::MaterialFileNames::Default, Sources::MaterialFileName);
-                    }
-
-                    if (ScriptableImGui::Button("ColorA = Red"))
-                    {
-                        CopyTestFile(TestData::MaterialFileNames::ChangePrimaryToRed, Sources::MaterialFileName);
-                    }
-
-                    if (ScriptableImGui::Button("ColorA = Blue"))
-                    {
-                        CopyTestFile(TestData::MaterialFileNames::ChangePrimaryToBlue, Sources::MaterialFileName);
-                    }
-                }
-            }
-            ImGui::Unindent();
-
-            ImGui::Text(Sources::MaterialTypeFileName);
-            ImGui::Indent();
-            {
-                DrawAssetStatus(Sources::MaterialTypeFileName);
-
-                if (m_initStatus == InitStatus::Ready)
-                {
-                    if (ScriptableImGui::Button("Straight Lines"))
-                    {
-                        CopyTestFile(TestData::MaterialTypeFileNames::StraightLines, Sources::MaterialTypeFileName);
-                    }
-
-                    if (ScriptableImGui::Button("Wavy Lines"))
-                    {
-                        CopyTestFile(TestData::MaterialTypeFileNames::WavyLines, Sources::MaterialTypeFileName);
-                    }
-                }
-            }
-            ImGui::Unindent();
-
-            ImGui::Text(Sources::ShaderFileName);
-            ImGui::Indent();
-            {
-                DrawAssetStatus(Sources::ShaderFileName);
-
-                if (m_initStatus == InitStatus::Ready)
-                {
-                    if (ScriptableImGui::Button("Blending Off"))
-                    {
-                        CopyTestFile(TestData::ShaderFileNames::BlendingOff, Sources::ShaderFileName);
-                    }
-
-                    if (ScriptableImGui::Button("Blending On"))
-                    {
-                        CopyTestFile(TestData::ShaderFileNames::BlendingOn, Sources::ShaderFileName);
-                    }
-                }
-            }
-            ImGui::Unindent();
-
-            ImGui::Text(Sources::AzslFileName);
-            ImGui::Indent();
-            {
-                // The AZSL file is a source dependency of the .shader file, so display the same asset status
-                DrawAssetStatus(Sources::AzslFileName);
-
-                if (m_initStatus == InitStatus::Ready)
-                {
-                    if (ScriptableImGui::Button("Horizontal Pattern"))
-                    {
-                        CopyTestFile(TestData::AzslFileNames::HorizontalPattern, Sources::AzslFileName);
-                    }
-
-                    if (ScriptableImGui::Button("Vertical Pattern"))
-                    {
-                        CopyTestFile(TestData::AzslFileNames::VerticalPattern, Sources::AzslFileName);
-                    }
-                }
-            }
-            ImGui::Unindent();
-
-            ImGui::Text(Sources::ShaderVariantListFileName);
-            ImGui::Indent();
-            {
-                // The AZSL file is a source dependency of the .shader file, so display the same asset status
-                DrawAssetStatus(Sources::ShaderVariantListFileName, false);
-                DrawAssetStatus(Products::ShaderVariantTreeFileName, true);
-                DrawAssetStatus(Products::GetShaderVariantFileName(ShaderVariantStableId{0}).c_str(), true);
-                DrawAssetStatus(Products::GetShaderVariantFileName(ShaderVariantStableId{1}).c_str(), true);
-                DrawAssetStatus(Products::GetShaderVariantFileName(ShaderVariantStableId{2}).c_str(), true);
-
-                if (m_initStatus == InitStatus::Ready)
-                {
-                    ScriptableImGui::PushNameContext("ShaderVariantList");
-
-                    if (ScriptableImGui::Button("None"))
-                    {
-                        DeleteTestFile(Sources::ShaderVariantListFileName);
-                    }
-
-                    if (ScriptableImGui::Button("All"))
-                    {
-                        CopyTestFile(TestData::ShaderVariantListFileNames::All, Sources::ShaderVariantListFileName);
-                    }
-
-                    if (ScriptableImGui::Button("Only Wavy Lines"))
-                    {
-                        CopyTestFile(TestData::ShaderVariantListFileNames::OnlyWavyLines, Sources::ShaderVariantListFileName);
-                    }
-
-                    if (ScriptableImGui::Button("Only Straight Lines"))
-                    {
-                        CopyTestFile(TestData::ShaderVariantListFileNames::OnlyStraightLines, Sources::ShaderVariantListFileName);
-                    }
-
-                    ScriptableImGui::PopNameContext();
-                }
-            }
-            ImGui::Unindent();
-
-            m_imguiSidebar.End();
-        }
-
-    }
-
-} // namespace AtomSampleViewer

+ 0 - 112
Gem/Code/Source/MaterialHotReloadTestComponent.h

@@ -1,112 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#pragma once
-
-#include <CommonSampleComponentBase.h>
-#include <Utils/ImGuiSidebar.h>
-#include <AzCore/Component/TickBus.h>
-#include <Atom/RPI.Reflect/Material/MaterialAsset.h>
-#include <Atom/RPI.Reflect/Model/ModelAsset.h>
-#include <AzFramework/Asset/AssetSystemTypes.h>
-
-namespace AtomSampleViewer
-{
-    //! This test renders a simple material and exposes controls that can update the source data for that material and its shaders
-    //! to demonstrate and test hot-reloading. It works by copying entire files from a test data folder into a material source folder
-    //! and waiting for the Asset Processor to build the updates files.
-    class MaterialHotReloadTestComponent final
-        : public CommonSampleComponentBase
-        , public AZ::TickBus::Handler
-        , public AZ::Data::AssetBus::Handler
-    {
-    public:
-        AZ_COMPONENT(MaterialHotReloadTestComponent, "{EA684B21-9E39-4210-A640-AFBC28B2E683}", CommonSampleComponentBase);
-        MaterialHotReloadTestComponent();
-
-        static void Reflect(AZ::ReflectContext* context);
-
-        // AZ::Component overrides...
-        void Activate() override;
-        void Deactivate() override;
-
-    private:
-
-        AZ_DISABLE_COPY_MOVE(MaterialHotReloadTestComponent);
-
-        // AZ::TickBus::Handler overrides...
-        void OnTick(float deltaTime, AZ::ScriptTimePoint scriptTime) override;
-        
-        // Finds the paths m_testDataFolder and m_tempSourceFolder
-        void InitTestDataFolders();
-
-        // Deletes a file from m_tempSourceFolder
-        void DeleteTestFile(const char* tempSourceFile);
-
-        // Copies a file from m_testDataFolder to m_tempSourceFolder
-        void CopyTestFile(const AZStd::string& testDataFile, const AZStd::string& tempSourceFile);
-
-        // Returns the AssetStatus of a file in m_tempSourceFolder 
-        AzFramework::AssetSystem::AssetStatus GetTestAssetStatus(const char* tempSourceFile) const;
-
-        // Draws ImGui indicating the Asset Processor status of a file in m_tempSourceFolder 
-        void DrawAssetStatus(const char* tempSourceFile, bool includeFileName = false);
-
-        AZ::Data::AssetId GetAssetId(const char* productFilePath);
-
-        void OnAssetReady(AZ::Data::Asset<AZ::Data::AssetData> asset) override;
-
-        enum class ShaderVariantStatus
-        {
-            None,
-            Root,
-            PartiallyBaked,
-            FullyBaked
-        };
-
-        ShaderVariantStatus GetShaderVariantStatus() const;
-
-        static constexpr float LongTimeout = 30.0f;
-
-        // Tracks initialization that starts when the component is activated
-        enum class InitStatus
-        {
-            None,
-            ClearingTestAssets,
-            CopyingDefaultShaderTestFile,
-            CopyingDefaultMaterialTypeTestFile,
-            WaitingForDefaultMaterialToRegister,
-            WaitingForDefaultMaterialToLoad,
-            Ready
-        };
-        InitStatus m_initStatus = InitStatus::None;
-
-        AZStd::string m_testDataFolder;   //< Stores several txt files with contents to be copied over various source asset files.
-        AZStd::string m_tempSourceFolder; //< Folder for temp source asset files. These are what the sample edits and reloads.
-
-        ImGuiSidebar m_imguiSidebar;
-
-        AZ::Render::MeshFeatureProcessorInterface* m_meshFeatureProcessor = nullptr;
-
-        AZ::Data::Asset<AZ::RPI::MaterialAsset> m_materialAsset;
-        AZ::Data::Instance<AZ::RPI::Material> m_material;
-        AZ::Data::Asset<AZ::RPI::ModelAsset> m_modelAsset;
-        AZ::Render::MeshFeatureProcessorInterface::MeshHandle m_meshHandle;
-        AZ::Render::MeshFeatureProcessorInterface::ModelChangedEvent::Handler m_meshChangedHandler;
-
-        // These are used to render a secondary mesh that indicates which shader variant is being used to render the primary mesh
-        AZ::Transform m_shaderVariantIndicatorMeshTransform;
-        AZ::Vector3 m_shaderVariantIndicatorMeshNonUniformScale = AZ::Vector3::CreateOne();
-        AZ::Render::MeshFeatureProcessorInterface::MeshHandle m_shaderVariantIndicatorMeshHandle;
-        AZ::Data::Instance<AZ::RPI::Material> m_shaderVariantIndicatorMaterial_root;
-        AZ::Data::Instance<AZ::RPI::Material> m_shaderVariantIndicatorMaterial_fullyBaked;
-        AZ::Data::Instance<AZ::RPI::Material>  m_shaderVariantIndicatorMaterial_current;
-
-        float m_clearAssetsTimeout = 0.0f;
-    };
-} // namespace AtomSampleViewer

+ 0 - 2
Gem/Code/Source/SampleComponentManager.cpp

@@ -80,7 +80,6 @@
 #include <DepthOfFieldExampleComponent.h>
 #include <DynamicDrawExampleComponent.h>
 #include <DynamicMaterialTestComponent.h>
-#include <MaterialHotReloadTestComponent.h>
 #include <ExposureExampleComponent.h>
 #include <EyeMaterialExampleComponent.h>
 #include <SceneReloadSoakTestComponent.h>
@@ -311,7 +310,6 @@ namespace AtomSampleViewer
             NewRPISample<DecalExampleComponent>("Decals"),
             NewRPISample<DynamicDrawExampleComponent>("DynamicDraw"),
             NewRPISample<DynamicMaterialTestComponent>("DynamicMaterialTest"),
-            NewRPISample<MaterialHotReloadTestComponent>("MaterialHotReloadTest"),
             NewRPISample<MeshExampleComponent>("Mesh"),
             NewRPISample<MSAA_RPI_ExampleComponent>("MSAA"),
             NewRPISample<MultiRenderPipelineExampleComponent>("MultiRenderPipeline"),

+ 3 - 3
Gem/Code/Source/ShaderReloadTestComponent.cpp

@@ -94,14 +94,14 @@ namespace AtomSampleViewer
         auto readResult = AZ::Utils::ReadFile(copyFrom.c_str());
         if (!readResult.IsSuccess())
         {
-            AZ_Error("MaterialHotReloadTestComponent", false, "%s", readResult.GetError().c_str());
+            AZ_Error("ShaderReloadTestComponent", false, "%s", readResult.GetError().c_str());
             return;
         }
 
         auto writeResult = AZ::Utils::WriteFile(readResult.GetValue(), copyTo.c_str());
         if (!writeResult.IsSuccess())
         {
-            AZ_Error("MaterialHotReloadTestComponent", false, "%s", writeResult.GetError().c_str());
+            AZ_Error("ShaderReloadTestComponent", false, "%s", writeResult.GetError().c_str());
             return;
         }
     }
@@ -114,7 +114,7 @@ namespace AtomSampleViewer
         {
             if (!AZ::IO::LocalFileIO::GetInstance()->Remove(deletePath.c_str()))
             {
-                AZ_Error("MaterialHotReloadTestComponent", false, "Failed to delete '%s'.", deletePath.c_str());
+                AZ_Error("ShaderReloadTestComponent", false, "Failed to delete '%s'.", deletePath.c_str());
             }
         }
     }

+ 0 - 2
Gem/Code/atomsampleviewergem_private_files.cmake

@@ -133,8 +133,6 @@ set(FILES
     Source/EyeMaterialExampleComponent.cpp
     Source/LightCullingExampleComponent.cpp
     Source/LightCullingExampleComponent.h
-    Source/MaterialHotReloadTestComponent.cpp
-    Source/MaterialHotReloadTestComponent.h
     Source/MeshExampleComponent.cpp
     Source/MeshExampleComponent.h
     Source/MSAA_RPI_ExampleComponent.cpp

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/01_Default.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0fc2400b5d26eb92a2633463cc94afbdf7623e846f253c4ab65ef4ec1ffc2382
-size 12194

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/02_Red.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:f6543ce8e9ffe7fb9d167a0953b303781191910ea4a3fd2d7b0d50c5da6e96fb
-size 12126

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/03_Blue.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9e8894cb60800339127731a9a5ff381e0cfc529dc0b04033d953a878fcde1da8
-size 12114

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/04_DefaultAgain.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0fc2400b5d26eb92a2633463cc94afbdf7623e846f253c4ab65ef4ec1ffc2382
-size 12194

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/05_WavyLines.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:fe736dd5e21bf1d6967c6542934f6df018e72dcfb64f2752d9648a1214f33a71
-size 18447

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/06_VerticalPattern.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:f01083e2a5adeb064665c66cdefd4a2ef1227c14aea47e019d099fd9b56fcd05
-size 15738

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/07_BlendingOn.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6c81fabadbfc285e07de372efa78633dcf0ef1653d9e6c18fd753af2f3d20b9d
-size 15739

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/08_Variants_All.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2936f41e297f505dcae1edba29e098f5441ca1b89406118a0c54f730901cd0ec
-size 17225

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/09_Variants_OnlyStraightLines.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6c81fabadbfc285e07de372efa78633dcf0ef1653d9e6c18fd753af2f3d20b9d
-size 15739

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/10_Variants_OnlyWavyLines.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2936f41e297f505dcae1edba29e098f5441ca1b89406118a0c54f730901cd0ec
-size 17225

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/11_Variants_None.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2936f41e297f505dcae1edba29e098f5441ca1b89406118a0c54f730901cd0ec
-size 17225

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/12_Variants_None_AfterUpdatingShader.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5f16a5cf994adae261fbd3fefd38870a490febcd71bf5c75f0417bb2c765a254
-size 10355

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/13_Variants_All.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a1993ef787907bc525b561c6ac211af26d8890ab1f4989a01944a0587a2612c6
-size 17224

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/14_HorizontalPattern.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b87cf0095420510868a5711d5aaa2ebb620ae6859701d4b90c728243f8d4f34f
-size 19916

+ 0 - 3
Scripts/ExpectedScreenshots/MaterialHotReloadTest/15_Red_AfterShaderReload.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7542f2852cbbed133f0d22b55d62b3e87ef54a3b38ec1680b5813b41655b58bf
-size 19911

+ 0 - 169
Scripts/MaterialHotReloadTest.bv.lua

@@ -1,169 +0,0 @@
-----------------------------------------------------------------------------------------------------
---
--- Copyright (c) Contributors to the Open 3D Engine Project.
--- For complete copyright and license terms please see the LICENSE at the root of this distribution.
---
--- SPDX-License-Identifier: Apache-2.0 OR MIT
---
---
---
-----------------------------------------------------------------------------------------------------
-
-RunScript("scripts/TestEnvironment.luac")
-
-g_testCaseFolder = 'MaterialHotReloadTest'
-Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder .. g_testCaseFolder))
-
-g_assetFolder = "materials/hotreloadtest/temp/";
-
-OpenSample('RPI/MaterialHotReloadTest')
-ResizeViewport(500, 500)
-
-SelectImageComparisonToleranceLevel("Level E")
-
--- The default ShaderVariantAsyncLoader service loop delay is too long and would require this
--- test script to use too long in IdleSeconds()
-ExecuteConsoleCommand("r_ShaderVariantAsyncLoader_ServiceLoopDelayOverride_ms 10")
-
-function IdleForReload()
-    -- Idle for a bit to give time for assets to reload
-    IdleSeconds(0.25)
-    -- Just in case the above IdleSeconds were consumed by one long frame, idle for a couple more frames, since the full reload
-    -- process can often span multiple frames.
-    IdleFrames(3)
-end
-
-function SetColorRed()
-    AssetTracking_Start()
-    AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.material")
-    SetImguiValue('ColorA = Red', true)
-    AssetTracking_IdleUntilExpectedAssetsFinish(10)
-    IdleForReload()
-end
-
-function SetBlendingOn()
-    AssetTracking_Start()
-    SetImguiValue('Blending On', true)
-    AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype")
-    AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader")
-    AssetTracking_IdleUntilExpectedAssetsFinish(10)
-    IdleForReload()
-end
-
-function SetBlendingOff()
-    AssetTracking_Start()
-    SetImguiValue('Blending Off', true)
-    AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype")
-    AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader")
-    AssetTracking_IdleUntilExpectedAssetsFinish(10)
-    IdleForReload()
-end
-
-CaptureScreenshot(g_testCaseFolder .. '/01_Default.png')
-
-SetColorRed()
-CaptureScreenshot(g_testCaseFolder .. '/02_Red.png')
-
-AssetTracking_Start()
-SetImguiValue('ColorA = Blue', true)
-AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.material")
-AssetTracking_IdleUntilExpectedAssetsFinish(10)
-IdleForReload()
-CaptureScreenshot(g_testCaseFolder .. '/03_Blue.png')
-
-AssetTracking_Start()
-SetImguiValue('Default Colors', true)
-AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.material")
-AssetTracking_IdleUntilExpectedAssetsFinish(10)
-IdleForReload()
-CaptureScreenshot(g_testCaseFolder .. '/04_DefaultAgain.png')
-
-AssetTracking_Start()
-SetImguiValue('Wavy Lines', true)
-AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype")
-AssetTracking_IdleUntilExpectedAssetsFinish(10)
-IdleForReload()
-CaptureScreenshot(g_testCaseFolder .. '/05_WavyLines.png')
-
-AssetTracking_Start()
-SetImguiValue('Vertical Pattern', true)
-AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype")
-AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader")
-AssetTracking_IdleUntilExpectedAssetsFinish(10)
-IdleForReload()
-CaptureScreenshot(g_testCaseFolder .. '/06_VerticalPattern.png')
-
-SetBlendingOn()
-CaptureScreenshot(g_testCaseFolder .. '/07_BlendingOn.png')
-
--- This will switch to showing the "Shader Variant: Fully Baked" message
-AssetTracking_Start()
-SetImguiValue('ShaderVariantList/All', true)
-AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 3) -- Waiting for 3 products, the list asset and two variant assets
-AssetTracking_IdleUntilExpectedAssetsFinish(10)
-IdleForReload()
-CaptureScreenshot(g_testCaseFolder .. '/08_Variants_All.png')
-
--- This will switch to showing the "Shader Variant: Root" message
-AssetTracking_Start()
-SetImguiValue('ShaderVariantList/Only Straight Lines', true)
-AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 2) -- Waiting for 2 products, the list asset and one variant assets
-AssetTracking_IdleUntilExpectedAssetsFinish(10)
-IdleForReload()
-CaptureScreenshot(g_testCaseFolder .. '/09_Variants_OnlyStraightLines.png')
-
--- This will switch to showing the "Shader Variant: Fully Baked" message again
-AssetTracking_Start()
-SetImguiValue('ShaderVariantList/Only Wavy Lines', true)
-AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 2) -- Waiting for 2 products, the list asset and one variant assets
-AssetTracking_IdleUntilExpectedAssetsFinish(10)
-IdleForReload()
-CaptureScreenshot(g_testCaseFolder .. '/10_Variants_OnlyWavyLines.png')
-
--- This screenshot will be identical to the one above because the variants
--- are still loaded in memory even though they have been removed from disk
-AssetTracking_Start()
-SetImguiValue('ShaderVariantList/None', true)
-IdleSeconds(1.0) -- Idle for a bit to give time for the assets to disappear
-IdleForReload()
-CaptureScreenshot(g_testCaseFolder .. '/11_Variants_None.png')
-
--- Now, changing the .shader file will force the shader to reload and will not find
--- any baked variants, since we switched to "None" above, and so this screenshot will 
--- switch back to showing the "Shader Variant: Root" message.
-SetBlendingOff()
---[GFX TODO] This test is consistently failing due to an Asset Processor bug. Re-enable this test once that is fixed.
---CaptureScreenshot(g_testCaseFolder .. '/12_Variants_None_AfterUpdatingShader.png')
-
--- Here we prepare to test a specific edge case. First, the material should be using a full baked shader variant, so we set up that precondition and verify with a screenshot.
-AssetTracking_Start()
-SetImguiValue('ShaderVariantList/All', true)
-AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 3) -- Waiting for 3 products, the list asset and two variant assets
-AssetTracking_IdleUntilExpectedAssetsFinish(10)
-IdleSeconds(3.0)
-IdleForReload()
-CaptureScreenshot(g_testCaseFolder .. '/13_Variants_All.png')
--- Now that the material is using a fully-baked variant, modify the .azsl file to force *everything* to rebuild. In the failure case, the runtime
--- holds onto the old fully-baked variant even though a new root variant is available. In the correct case, the root variant should take priority
--- over the fully-baked variant because it is more recent.
-AssetTracking_Start()
-SetImguiValue('Horizontal Pattern', true)
-AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype")
-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)
-IdleSeconds(4.0)
-IdleForReload()
-CaptureScreenshot(g_testCaseFolder .. '/14_HorizontalPattern.png')
-
--- Test a specific scenario that was failing, where color changes fail to reload after making a shader change.
-SetBlendingOn()
-IdleForReload()
-SetBlendingOff()
-IdleForReload()
-SetColorRed()
-IdleForReload()
-CaptureScreenshot(g_testCaseFolder .. '/15_Red_AfterShaderReload.png')
-
--- Clear the service loop override back to the default delay
-ExecuteConsoleCommand("r_ShaderVariantAsyncLoader_ServiceLoopDelayOverride_ms 0")

+ 0 - 1
Scripts/_FullTestSuite_.bv.lua

@@ -48,7 +48,6 @@ tests= {
     RunScriptWrapper('scripts/dynamicmaterialtest.bv.luac'),
     RunScriptWrapper('scripts/EyeMaterialTest.bv.luac'),
     RunScriptWrapper('scripts/materialscreenshottests.bv.luac'),
-    RunScriptWrapper('scripts/materialhotreloadtest.bv.luac'),
     RunScriptWrapper('scripts/msaa_rpi_test.bv.luac'),
     RunScriptWrapper('scripts/cullingandlod.bv.luac'),
     RunScriptWrapper('scripts/multirenderpipeline.bv.luac'),

+ 0 - 1
atomsampleviewer_asset_files.cmake

@@ -40,7 +40,6 @@ set(FILES
     Scripts/ExposureTest.bv.lua
     Scripts/EyeMaterialTest.bv.lua
     Scripts/LightCulling.bv.lua
-    Scripts/MaterialHotReloadTest.bv.lua
     Scripts/MaterialScreenshotTests.bv.lua
     Scripts/MSAA_RPI_Test.bv.lua
     Scripts/MultiRenderPipeline.bv.lua

+ 11 - 17
generate_asset_cmake.bat

@@ -40,25 +40,19 @@ echo set(FILES>> %OUTPUT_FILE%
 
         :: Turns "\my\asset\folder" into "/my/asset/folder" for cmake
         set relativeFilePath=!relativeFilePath:\=/!
-        
-        
-        :: Filter out files in Materials/HotReloadTest. materialHotReloadPath is the first 23 characters of the relative file path 
-        set materialHotReloadPath=!relativeFilePath:~0,23!
-        if not !materialHotReloadPath! == Materials/HotReloadTest (
-
-            :: Filter out files in Cache/. cachePath is the first 6 characters of the relative file path 
-            set cachePath=!relativeFilePath:~0,6!
-            if not !cachePath! == Cache/ (
 
-                :: Filter only relevant file types
-                if !relativeFilePath:~-4!  == .lua          echo %TAB%!relativeFilePath!
-                if !relativeFilePath:~-5!  == .pass         echo %TAB%!relativeFilePath!
-                if !relativeFilePath:~-5!  == .azsl         echo %TAB%!relativeFilePath!
-                if !relativeFilePath:~-6!  == .azsli        echo %TAB%!relativeFilePath!
-                if !relativeFilePath:~-7!  == .shader       echo %TAB%!relativeFilePath!
-                if !relativeFilePath:~-13! == .materialtype echo %TAB%!relativeFilePath!
+        :: Filter out files in Cache/. cachePath is the first 6 characters of the relative file path 
+        set cachePath=!relativeFilePath:~0,6!
+        if not !cachePath! == Cache/ (
+
+            :: Filter only relevant file types
+            if !relativeFilePath:~-4!  == .lua          echo %TAB%!relativeFilePath!
+            if !relativeFilePath:~-5!  == .pass         echo %TAB%!relativeFilePath!
+            if !relativeFilePath:~-5!  == .azsl         echo %TAB%!relativeFilePath!
+            if !relativeFilePath:~-6!  == .azsli        echo %TAB%!relativeFilePath!
+            if !relativeFilePath:~-7!  == .shader       echo %TAB%!relativeFilePath!
+            if !relativeFilePath:~-13! == .materialtype echo %TAB%!relativeFilePath!
             
-            )
         )
     )
 ) >> %OUTPUT_FILE%