Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge stabilization/2210 into main #534

Merged
merged 128 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
b039c41
removing WARP suite
smurly Apr 11, 2022
5f44742
Update screenshot after fix Hermanubis_thickness's image building pre…
VickyAtAZ Apr 12, 2022
5670a37
fix reference to removed warp lua script
smurly Apr 12, 2022
9b46107
Merge pull request #410 from aws-lumberyard-dev/warp_deprecation
jromnoa Apr 13, 2022
1342656
Restored old lattice size limits for AssetLoadTest and DynamicMateria…
santorac Apr 13, 2022
dba1285
Merge remote-tracking branch 'upstream/development' into Atom/santora…
santorac Apr 13, 2022
595ad6f
Add Eye material sample and test
santipaprika Apr 15, 2022
3f1af19
Added new screenshot tests that focus on exposing depth-test artifact…
santorac Apr 21, 2022
753a738
Mark Linux as supporting viewport resize for the ASV scripting interf…
rgba16f Apr 21, 2022
b60969a
Added the new ParallaxDepthArtifacts test script to the full test suite.
santorac Apr 21, 2022
3494fe1
Made sure any IBL is cleared when closing a sample. There were some c…
santorac Apr 21, 2022
0fadfb8
Remove GridMate from AtomSampleViewer
AMZN-puvvadar Apr 21, 2022
004e4cd
Remove another GridMate include
AMZN-puvvadar Apr 21, 2022
c89a2e4
Merge pull request #422 from aws-lumberyard-dev/gridmate_removal
AMZN-puvvadar Apr 21, 2022
b099124
Merge remote-tracking branch 'upstream/development' into Atom/santora…
santorac Apr 22, 2022
a96cdd9
Merge pull request #419 from aws-lumberyard-dev/Atom/santorac/Restore…
santorac Apr 25, 2022
d59213a
Increased screenshot tolerance for some benign failing tests.
santorac Apr 25, 2022
4c252ec
Updated method names in calls to the ReflectionProbeFeatureProcessor
dmcdiarmid-ly Apr 25, 2022
c1ce96f
Merge pull request #425 from aws-lumberyard-dev/Atom/santorac/Integra…
santorac Apr 25, 2022
1c8e8da
Fixed code comment
santorac Apr 25, 2022
4b8bb33
Merge pull request #423 from aws-lumberyard-dev/Atom/santorac/FixingP…
santorac Apr 26, 2022
7118193
Merge pull request #426 from aws-lumberyard-dev/Atom/dmcdiar/ATOM-17467
dmcdiarmid-ly Apr 27, 2022
12e3654
Merge pull request #421 from santipaprika/eye-sample
santorac Apr 27, 2022
b837d5b
Make ProceduralSkinnedMeshUtils use model buffers directly for skinne…
amzn-tommy Apr 27, 2022
be4859e
Update ASV to use the new handle interface for the SkinnedMeshFeature…
amzn-tommy Apr 28, 2022
d0f711d
Updated parallax test screenshots to match latest behavior.
santorac Apr 29, 2022
8554d8c
Updated another screenshot that had changed shadows.
santorac Apr 29, 2022
f7af53b
Updated screenshots related to shadows on parallax surfaces. In these…
santorac Apr 29, 2022
efd6abe
Updated 002_parallaxpdo.png again after adjusting shadow factor setti…
santorac Apr 30, 2022
42e596f
Merge branch 'Atom/santorac/PdoShadowBias' into Atom/santorac/Screens…
santorac May 2, 2022
f499df3
Merge pull request #433 from aws-lumberyard-dev/Atom/santorac/PdoShad…
santorac May 2, 2022
068c1be
Updated various baseline screenshots that show minor lighting differe…
santorac May 2, 2022
c726a51
Updated some baseline screenshots that were minorly impacted by norma…
santorac May 4, 2022
a806caf
Update script manager with new interface from the ScriptAsset class
amzn-tommy May 4, 2022
36915ae
Use ScriptSystemRequestBus::Load event to execute the script instead …
amzn-tommy May 5, 2022
80217fa
Merge pull request #439 from aws-lumberyard-dev/Atom/amzn-tommy/ASV_F…
gadams3 May 5, 2022
ea85ff0
Merge pull request #438 from aws-lumberyard-dev/Atom/santorac/Screens…
santorac May 5, 2022
1e57837
Copy the script fix from o3de
rgba16f May 6, 2022
0a57565
Merge pull request #441 from aws-lumberyard-dev/rgba16f/ScriptManager…
rgba16f May 6, 2022
f69eccc
adding a 'c' to the script command line argument so the luac is loaded
smurly May 9, 2022
d35edd9
Merge pull request #443 from aws-lumberyard-dev/Atom/scottmur/script_…
jromnoa May 10, 2022
0c9cc3c
Fix buffer overrun and update bone transform code to us RPI function …
amzn-tommy May 12, 2022
edc2dae
Fixes for compile issue in the release config
rgba16f May 12, 2022
ad2186e
Fixes for compile issue in the release config
rgba16f May 12, 2022
f0a9ce8
Updated the MaterialHotReloadTest sample to report the actual shader …
santorac May 14, 2022
797bb79
Fixed an issue where ImGuiMaterialDetails wasn't showing the root var…
santorac May 14, 2022
0299257
Added support for sorting results according to diff score against the…
santorac May 14, 2022
3478a0b
Updated MaterialHotReloadTest to configure a shorter delay for the Sh…
santorac May 14, 2022
95dc687
Updated the MaterialHotReloadTest "14_HorizontalPattern.png" step to …
santorac May 14, 2022
2b01ff9
Depth Of Field screenshot test
smurly May 16, 2022
ad17c86
adding end of file newline to script
smurly May 16, 2022
7001fa2
merging AtomSampleViewer stabilization/2205
antonmic May 16, 2022
e76fa67
Added AZ::IO::Streamer's profiler.
Infurael Apr 2, 2022
7b0bfc9
Merge pull request #448 from aws-lumberyard-dev/Atom/scottmur/depth_o…
jromnoa May 17, 2022
4bc8b07
updating ASV materials for fullscreen shadow changes
antonmic May 18, 2022
49cb23e
merging latest dev
antonmic May 18, 2022
2a7fd7e
Merge branch 'development' into Streamer/Profiler
Infurael May 18, 2022
07dcb5a
Merge pull request #449 from aws-lumberyard-dev/antonmic/gitflow_2205…
antonmic May 18, 2022
82c2ffd
bumping the timout for the test run
smurly May 18, 2022
0bc0c43
Merge pull request #451 from aws-lumberyard-dev/Atom/scottmur/timeout…
jromnoa May 18, 2022
d123490
Added a new screenshot test for skinned meshes and fixed a crash that…
amzn-tommy May 19, 2022
3942619
Merge pull request #450 from aws-lumberyard-dev/Streamer/Profiler
Infurael May 23, 2022
8cdca6e
Merge pull request #447 from aws-lumberyard-dev/Atom/santorac/ShaderD…
santorac May 24, 2022
91301a0
ASV update for Fullscreen Shadows
antonmic May 25, 2022
080fce8
merging latest dev
antonmic May 25, 2022
1baf4ac
adding Exposure sample screenshot compare test
smurly May 25, 2022
cba09f3
Merge pull request #453 from aws-lumberyard-dev/Atom/scottmur/exposur…
jromnoa May 26, 2022
3494711
updated non-failing screenshots and updated shadow example components…
antonmic May 27, 2022
39a9cbe
adding links to github issues for commented out tests
antonmic May 27, 2022
0e39663
Merge pull request #452 from aws-lumberyard-dev/antonmic/fullscreenSh…
antonmic May 27, 2022
7d894cb
forcing both RHI and RPI scene reset on sample change
antonmic Jun 2, 2022
13b1199
Merge pull request #457 from aws-lumberyard-dev/Atom/antonmic/AsvSamp…
antonmic Jun 3, 2022
a37f004
Fixed a timing issue in MaterialHotReloadTest. When there were many A…
santorac Jun 6, 2022
9bdf44e
Merge pull request #459 from aws-lumberyard-dev/Atom/santorac/HotRelo…
santorac Jun 20, 2022
ca30117
Re-enabling Readback test in ASV now that TDR is resolved
antonmic Jun 22, 2022
9bc2ed7
merging latest dev
antonmic Jun 22, 2022
1d92a6f
Merge pull request #467 from aws-lumberyard-dev/Atom/antonmic/reEnabl…
antonmic Jun 23, 2022
a69b9a2
Add missing platform projects, necessary for Android. (#470)
moraaar Jun 28, 2022
ad0efe8
fixes for ASV screenshot tests
antonmic Jun 29, 2022
249f6cf
Updates to handle api changes for multiple active screen captures and…
rgba16f Jun 14, 2022
59fa2ae
Fix render to texture camera to start matching the screen viewport an…
rgba16f Jun 28, 2022
c8db7c0
Remove the MultiRenderToTextureExampleComponent
rgba16f Jun 29, 2022
99d9fd9
Cleanup code commented out for debug
rgba16f Jun 29, 2022
7821544
Merge pull request #471 from aws-lumberyard-dev/Atom/antonmic/reEnabl…
antonmic Jun 29, 2022
f2c593e
Removing SwapChainOutput uses in favor of more generic PipelineOutput
antonmic Jun 30, 2022
73f2bb9
SwapChainOutput -> PipelineOutput
antonmic Jun 30, 2022
47823f5
ASV updates to match the FrameCapture changes
rgba16f Jun 30, 2022
8fb8e0a
Merge pull request #474 from aws-lumberyard-dev/Atom/antonmic/Unified…
antonmic Jun 30, 2022
ae1c4fd
Updated samples to use the submit range from the FrameGraphExecuteCon…
dmcdiarmid-ly Jul 1, 2022
e23e86d
Removing unused passes
antonmic Jul 2, 2022
a078636
Removed commented code
dmcdiarmid-ly Jul 2, 2022
65993cf
Merge pull request #476 from aws-lumberyard-dev/Atom/antonmic/Removin…
antonmic Jul 7, 2022
9a49b27
Merge branch 'development' into Atom/dmcdiar/ATOM-17713
dmcdiarmid-ly Jul 9, 2022
dbeb75b
Added photosensitive seizure warnings.
santorac Jul 9, 2022
53c1e2c
Merge pull request #475 from aws-lumberyard-dev/Atom/dmcdiar/ATOM-17713
dmcdiarmid-ly Jul 12, 2022
7a4e207
Fix PassTree automation script failing to screen capture, also update…
rgba16f Jul 16, 2022
80f6738
Fix PassTree automation script failing to screen capture
rgba16f Jul 18, 2022
4512f80
Fixed error counter issue that can occur when a screenshot file doesn…
santorac Jul 18, 2022
b2efa12
Merge branch 'development' into Atom/santorac/SeizureWarning
santorac Jul 18, 2022
8b2668d
Made the --sample command line option also show the content warnings.
santorac Jul 19, 2022
bfa6b8c
Made the content warning dialog's title configurable as well.
santorac Jul 20, 2022
395bd15
Merge pull request #478 from aws-lumberyard-dev/Atom/santorac/Seizure…
santorac Jul 20, 2022
11e80af
Updating the ScriptReporter.cpp to no longer use the zero parameter p…
lemonade-dm Jul 22, 2022
770fbfb
More accurate FrameTime stats (#454)
rgba16f Jul 22, 2022
c9f6ae4
Changed the DiffuseGI sample to use the new DiffuseProbeGrid gem, and…
dmcdiarmid-ly Jul 27, 2022
cd524e9
Merge branch 'development' into Atom/dmcdiar/ATOM-17749
dmcdiarmid-ly Jul 27, 2022
5f21857
Moved the submit index to a separate parameter in CommandList::Submit
dmcdiarmid-ly Jul 28, 2022
eef03a8
Matching pass name to name used for ImGui lookup, which fixes imgui f…
antonmic Jul 28, 2022
847babb
Merge pull request #481 from aws-lumberyard-dev/Atom/dmcdiar/ATOM-17749
dmcdiarmid-ly Aug 8, 2022
4952eb2
Update ASV material versions so warnings should be gone (#484)
jiaweig-amzn Aug 8, 2022
e8eca39
Merge pull request #483 from aws-lumberyard-dev/Atom/dmcdiar/ATOM-17804
dmcdiarmid-ly Aug 8, 2022
5811bb7
Scene reset and multiscene fixes
invertednormal Aug 10, 2022
58c8201
Fix aux geom feature processor in rhi samples.
invertednormal Aug 11, 2022
0a97e27
add settings registry query functionality to asv lua (#489)
rgba16f Aug 11, 2022
99963ed
Fix target blend state name
Bindless-Chicken Jun 16, 2022
11b1292
Merge pull request #482 from aws-lumberyard-dev/Atom/antonmic/FixShad…
antonmic Aug 15, 2022
6dbfd3d
Changed the construction of divider string for the ImGuiShaderUtils. …
lemonade-dm Aug 16, 2022
73bbb3b
Merge pull request #463 from Bindless-Chicken/expose-full-blend-state
thefranke Aug 16, 2022
e7f176a
Remove shader metrics menu for ASV (#494)
VickyAtAZ Aug 16, 2022
518fc6d
Fix the 15th screenshot having root variant instead of fully baked (#…
jiaweig-amzn Aug 17, 2022
ed962c5
Removing include paths to ImguiShaderMetrics which was removed. (#495)
invertednormal Aug 17, 2022
8ad71ac
Fixed a unused variable compilation error. (#472)
jhmueller-huawei Aug 22, 2022
0ac7058
adjusting the timeout duration of the ASV suite job which has consist…
smurly Aug 23, 2022
65027d8
Merge pull request #497 from aws-lumberyard-dev/adjust_timout
smurly Aug 23, 2022
91f9667
time-out 1500 appears to be the limit
smurly Aug 23, 2022
00edc0e
Merge pull request #498 from aws-lumberyard-dev/ASV_timeout
smurly Aug 23, 2022
6634711
Screenshots stored from nightly Jenkins ASV "Test GPU Profile" only c…
jiaweig-amzn Aug 26, 2022
6e9e09c
Add `Debug::Tracer tracer` stack variable to main so that TraceMessag…
rgba16f Sep 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gem/Code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ ly_add_target(
Gem::Atom_Component_DebugCamera.Static
Gem::AtomSampleViewer.Lib.Static
Gem::Profiler.Static
Gem::DiffuseProbeGrid.Static
)

ly_add_target(
Expand Down
10 changes: 10 additions & 0 deletions Gem/Code/Source/AssetLoadTestComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ namespace AtomSampleViewer

m_modelBrowser.ResetPinnedAssetsToDefault();
}

// 25 was the original max before some changes that increased ENTITY_LATTEST_TEST_COMPONENT_MAX to 100.
// AssetLoadTest was crashing (out of descriptors) at 50x50x42 so we put the limit back to 25^3.
// Note that limiting to 40^3 will avoid the crash, but the sample doesn't work well at that scale, the UI
// doesn't even show up because of a combination of low frame rate, the reload timers, and the time it takes
// to load the models, and the fact that the UI is hidden while the models are loading.
// So it would be good if we could work on increasing this limit.
// (It would also be good if we could improve the design of this sample to make the UI persistent and more
// responsive while the assets keep reloading).
Base::SetLatticeMaxDimension(25);

Base::Activate();
}
Expand Down
14 changes: 14 additions & 0 deletions Gem/Code/Source/AtomSampleComponent.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* 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 <AtomSampleComponent.h>

namespace AtomSampleViewer
{

}
36 changes: 36 additions & 0 deletions Gem/Code/Source/AtomSampleComponent.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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 <AzCore/Component/Component.h>

namespace AtomSampleViewer
{
class AtomSampleComponent
: public AZ::Component
{
public:
AZ_RTTI(AtomSampleComponent, "{2318DFD6-BC6B-4335-9F25-8E270A10CA81}", AZ::Component);

AtomSampleComponent() = default;
~AtomSampleComponent() override = default;

// Redefine this string in the sample component subclass to provide a sample-specific warning message.
// Any non-empty string will automatically cause a warning message to be displayed before opening the sample.
static constexpr const char* ContentWarning = "";

// If the above ContentWarning is overridden with a non-empty value, this string will be used as the message box's title.
// Redefine this string in the sample component subclass to provide a custom title.
static constexpr const char* ContentWarningTitle = "Content Warning";

// This is a common photosensitive/seizure warning that could be used for the above ContentWarning in specific samples as needed.
static constexpr const char CommonPhotosensitiveWarning[] = "This sample includes flashing images that could cause seizures or other adverse effects in photosensitive individuals.";
static constexpr const char CommonPhotosensitiveWarningTitle[] = "Photosensitive Seizure Warning";
};
} // namespace AtomSampleViewer
1 change: 0 additions & 1 deletion Gem/Code/Source/AtomSampleViewerSystemComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include <Atom/RHI/Factory.h>
#include <Atom/RPI.Public/RPISystemInterface.h>
#include <Atom/RPI.Public/Shader/Metrics/ShaderMetricsSystem.h>

#include <ISystem.h>
#include <IConsole.h>
Expand Down
70 changes: 55 additions & 15 deletions Gem/Code/Source/Automation/ScriptManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <Atom/RHI/Factory.h>

#include <AzCore/Component/Entity.h>
#include <AzCore/Settings/SettingsRegistryScriptUtils.h>
#include <AzCore/Script/ScriptContext.h>
#include <AzCore/Script/ScriptSystemBus.h>
#include <AzCore/Script/ScriptAsset.h>
Expand Down Expand Up @@ -966,7 +967,8 @@ namespace AtomSampleViewer

s_instance->m_executingScripts.insert(scriptAsset.GetId());

if (!s_instance->m_scriptContext->Execute(scriptAsset->GetScriptBuffer().data(), scriptFilePath.c_str(), scriptAsset->GetScriptBuffer().size()))
auto& scriptData = scriptAsset->m_data;
if (!s_instance->m_scriptContext->Execute(scriptData.GetScriptBuffer().data(), scriptFilePath.c_str(), scriptData.GetScriptBuffer().size()))
{
// Push an error operation on the back of the queue instead of reporting it immediately so it doesn't get lost
// in front of a bunch of queued m_scriptOperations.
Expand Down Expand Up @@ -1057,6 +1059,7 @@ namespace AtomSampleViewer
void ScriptManager::ReflectScriptContext(AZ::BehaviorContext* behaviorContext)
{
AZ::MathReflect(behaviorContext);
AZ::SettingsRegistryScriptUtils::ReflectSettingsRegistryToBehaviorContext(*behaviorContext);

// Utilities...
behaviorContext->Method("RunScript", &Script_RunScript);
Expand Down Expand Up @@ -1086,6 +1089,7 @@ namespace AtomSampleViewer
behaviorContext->Method("ShowTool", &Script_ShowTool);

// Screenshots...
behaviorContext->Method("SetTestEnvPath", &Script_SetTestEnvPath);
behaviorContext->Method("SelectImageComparisonToleranceLevel", &Script_SelectImageComparisonToleranceLevel);
behaviorContext->Method("CaptureScreenshot", &Script_CaptureScreenshot);
behaviorContext->Method("CaptureScreenshotWithImGui", &Script_CaptureScreenshotWithImGui);
Expand Down Expand Up @@ -1140,14 +1144,16 @@ namespace AtomSampleViewer
s_instance->m_scriptOperations.push(AZStd::move(func));
}

void ScriptManager::Script_Print(const AZStd::string& message)
void ScriptManager::Script_Print(const AZStd::string& message [[maybe_unused]])
{
#ifndef RELEASE // AZ_TracePrintf is a no-op in release builds
auto func = [message]()
{
AZ_TracePrintf("Automation", "Script: %s\n", message.c_str());
};

s_instance->m_scriptOperations.push(AZStd::move(func));
#endif
}

AZStd::string ScriptManager::Script_ResolvePath(const AZStd::string& path)
Expand Down Expand Up @@ -1370,7 +1376,7 @@ namespace AtomSampleViewer
{
auto operation = [command]()
{
AzFramework::ConsoleRequestBus::Broadcast(&AzFramework::ConsoleRequests::ExecuteConsoleCommand, command.c_str());
AZ::Interface<AZ::IConsole>::Get()->PerformCommand(command.c_str());
};

s_instance->m_scriptOperations.push(AZStd::move(operation));
Expand Down Expand Up @@ -1400,9 +1406,8 @@ namespace AtomSampleViewer
s_instance->m_scriptOperations.push(AZStd::move(operation));
}

bool ScriptManager::PrepareForScreenCapture(const AZStd::string& path)
bool ScriptManager::PrepareForScreenCapture(const AZStd::string& path, const AZStd::string& envPath)
{

if (!Utils::IsFileUnderFolder(Utils::ResolvePath(path), ScreenshotPaths::GetScreenshotsFolder(true)))
{
// The main reason we require screenshots to be in a specific folder is to ensure we don't delete or replace some other important file.
Expand All @@ -1420,7 +1425,7 @@ namespace AtomSampleViewer
return false;
}

s_instance->m_scriptReporter.AddScreenshotTest(path);
s_instance->m_scriptReporter.AddScreenshotTest(path, envPath);

s_instance->m_isCapturePending = true;
s_instance->AZ::Render::FrameCaptureNotificationBus::Handler::BusConnect();
Expand All @@ -1429,6 +1434,11 @@ namespace AtomSampleViewer
return true;
}

void ScriptManager::Script_SetTestEnvPath(const AZStd::string& envPath)
{
s_instance->m_envPath = envPath;
}

void ScriptManager::Script_SelectImageComparisonToleranceLevel(const AZStd::string& presetName)
{
auto operation = [presetName]()
Expand All @@ -1446,9 +1456,15 @@ namespace AtomSampleViewer
auto operation = [filePath]()
{
// Note this will pause the script until the capture is complete
if (PrepareForScreenCapture(filePath))
if (PrepareForScreenCapture(filePath, s_instance->m_envPath))
{
AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshot, filePath);
AZ_Assert(s_instance->m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId, "Attempting to start a capture while one is in progress");
uint32_t frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId;
AZ::Render::FrameCaptureRequestBus::BroadcastResult(frameCaptureId, &AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshot, filePath);
if (frameCaptureId != AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId)
{
s_instance->m_frameCaptureId = frameCaptureId;
}
}
};

Expand All @@ -1473,9 +1489,15 @@ namespace AtomSampleViewer
auto operation = [filePath]()
{
// Note this will pause the script until the capture is complete
if (PrepareForScreenCapture(filePath))
if (PrepareForScreenCapture(filePath, s_instance->m_envPath))
{
AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshot, filePath);
AZ_Assert(s_instance->m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId, "Attempting to start a capture while one is in progress");
uint32_t frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId;
AZ::Render::FrameCaptureRequestBus::BroadcastResult(frameCaptureId, &AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshot, filePath);
if (frameCaptureId != AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId)
{
s_instance->m_frameCaptureId = frameCaptureId;
}
}
};

Expand All @@ -1497,9 +1519,15 @@ namespace AtomSampleViewer
auto operation = [filePath]()
{
// Note this will pause the script until the capture is complete
if (PrepareForScreenCapture(filePath))
if (PrepareForScreenCapture(filePath, s_instance->m_envPath))
{
AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshotWithPreview, filePath);
AZ_Assert(s_instance->m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId, "Attempting to start a capture while one is in progress");
uint32_t frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId;
AZ::Render::FrameCaptureRequestBus::BroadcastResult(frameCaptureId, &AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshotWithPreview, filePath);
if (frameCaptureId != AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId)
{
s_instance->m_frameCaptureId = frameCaptureId;
}
}
};

Expand Down Expand Up @@ -1588,9 +1616,15 @@ namespace AtomSampleViewer
auto operation = [passHierarchy, slot, outputFilePath, readbackOption]()
{
// Note this will pause the script until the capture is complete
if (PrepareForScreenCapture(outputFilePath))
if (PrepareForScreenCapture(outputFilePath, s_instance->m_envPath))
{
AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, passHierarchy, slot, outputFilePath, readbackOption);
AZ_Assert(s_instance->m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId, "Attempting to start a capture while one is in progress");
uint32_t frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId;
AZ::Render::FrameCaptureRequestBus::BroadcastResult(frameCaptureId, &AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, passHierarchy, slot, outputFilePath, readbackOption);
if (frameCaptureId != AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId)
{
s_instance->m_frameCaptureId = frameCaptureId;
}
}
};

Expand All @@ -1601,9 +1635,15 @@ namespace AtomSampleViewer
});
}

void ScriptManager::OnCaptureFinished(AZ::Render::FrameCaptureResult result, const AZStd::string &info)
void ScriptManager::OnCaptureFinished(uint32_t frameCaptureId, AZ::Render::FrameCaptureResult result, const AZStd::string &info)
{
// ignore captures that are not triggered by the script manager
if (m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId || frameCaptureId != m_frameCaptureId)
{
return;
}
m_isCapturePending = false;
m_frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId;
AZ::Render::FrameCaptureNotificationBus::Handler::BusDisconnect();
ResumeScript();

Expand Down
9 changes: 7 additions & 2 deletions Gem/Code/Source/Automation/ScriptManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ namespace AtomSampleViewer
static void Script_ShowTool(const AZStd::string& toolName, bool enable);

// Screenshots...
// Store the test environment path of the screenshots. It will be used to figure out the baseline path.
static void Script_SetTestEnvPath(const AZStd::string& envPath);

// Call this function before capturing screenshots to indicate which comparison tolerance level should be used.
// The list of available tolerance levels can be found in "AtomSampleViewer/Config/ImageComparisonToleranceLevels.azasset".
Expand Down Expand Up @@ -217,7 +219,7 @@ namespace AtomSampleViewer
void OnCameraMoveEnded(AZ::TypeId controllerTypeId, uint32_t channels) override;

// FrameCaptureNotificationBus overrides...
void OnCaptureFinished(AZ::Render::FrameCaptureResult result, const AZStd::string& info) override;
void OnCaptureFinished(uint32_t frameCaptureId, AZ::Render::FrameCaptureResult result, const AZStd::string& info) override;

// ProfilingCaptureNotificationBus overrides...
void OnCaptureQueryTimestampFinished(bool result, const AZStd::string& info) override;
Expand All @@ -233,7 +235,7 @@ namespace AtomSampleViewer
// Validates the ScriptDataContext for ProfilingCapture script requests
static bool ValidateProfilingCaptureScripContexts(AZ::ScriptDataContext& dc, AZStd::string& outputFilePath);

static bool PrepareForScreenCapture(const AZStd::string& path);
static bool PrepareForScreenCapture(const AZStd::string& path, const AZStd::string& envPath);

// show/hide imgui
void SetShowImGui(bool show);
Expand All @@ -249,6 +251,8 @@ namespace AtomSampleViewer

TestSuiteExecutionConfig m_testSuiteRunConfig;

AZStd::string m_envPath = "";

static constexpr float DefaultPauseTimeout = 5.0f;

int m_scriptIdleFrames = 0;
Expand Down Expand Up @@ -338,6 +342,7 @@ namespace AtomSampleViewer
bool m_showPrecommitWizard = false;
PrecommitWizardSettings m_wizardSettings;

uint32_t m_frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId;
bool m_showScriptRunnerDialog = false;
bool m_isCapturePending = false;
bool m_frameTimeIsLocked = false;
Expand Down
Loading