Browse Source

Merge remote-tracking branch 'upstream/stabilization/2106' into cgalvan/gitflow_210712_main

Signed-off-by: Chris Galvan <[email protected]>
Chris Galvan 4 years ago
parent
commit
85552dc8b8
20 changed files with 76 additions and 61 deletions
  1. 1 1
      Gem/Code/Source/AreaLightExampleComponent.cpp
  2. 21 4
      Gem/Code/Source/Automation/ScriptManager.cpp
  3. 2 1
      Gem/Code/Source/TonemappingExampleComponent.cpp
  4. 2 2
      Scripts/ExpectedScreenshots/AreaLights/quad_approx_vary_metal.png
  5. 2 2
      Scripts/ExpectedScreenshots/AreaLights/quad_approx_vary_rough_metal.png
  6. 2 2
      Scripts/ExpectedScreenshots/AreaLights/quad_approx_vary_rough_nonmetal.png
  7. 2 2
      Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_approx_vary_metal.png
  8. 2 2
      Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_approx_vary_rough_metal.png
  9. 2 2
      Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_approx_vary_rough_nonmetal.png
  10. 2 2
      Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_vary_metal.png
  11. 2 2
      Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_vary_rough_metal.png
  12. 2 2
      Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_vary_rough_nonmetal.png
  13. 2 2
      Scripts/ExpectedScreenshots/AreaLights/quad_vary_metal.png
  14. 2 2
      Scripts/ExpectedScreenshots/AreaLights/quad_vary_rough_metal.png
  15. 2 2
      Scripts/ExpectedScreenshots/AreaLights/quad_vary_rough_nonmetal.png
  16. 13 25
      Scripts/build/Jenkins/Jenkinsfile
  17. 5 2
      Standalone/PythonTests/Automated/test_AtomSampleViewer_main_suite.py
  18. 4 1
      Standalone/PythonTests/Automated/test_AtomSampleViewer_periodic_suite.py
  19. 5 2
      Standalone/PythonTests/Automated/test_AtomSampleViewer_warp_suite.py
  20. 1 1
      Standalone/PythonTests/CMakeLists.txt

+ 1 - 1
Gem/Code/Source/AreaLightExampleComponent.cpp

@@ -815,7 +815,7 @@ namespace AtomSampleViewer
             case Quad:
             {
                 AZ::Transform transform = AZ::Transform::CreateIdentity();
-                transform.SetRotation(AZ::ConvertEulerRadiansToQuaternion(AZ::Vector3(m_config.m_rotations[0], -m_config.m_rotations[1], m_config.m_rotations[2])));
+                transform.SetRotation(AZ::ConvertEulerRadiansToQuaternion(AZ::Vector3(m_config.m_rotations[0], -m_config.m_rotations[1], -m_config.m_rotations[2])));
                 transform.SetTranslation(lightPos);
                 transform *= AZ::Transform::CreateFromQuaternion(AZ::ConvertEulerRadiansToQuaternion(AZ::Vector3(AZ::Constants::Pi * 0.5f, 0.0f, 0.0f)));
                 m_auxGeom->DrawQuad(m_config.m_quadSize[0], m_config.m_quadSize[1], AZ::Matrix3x4::CreateFromTransform(transform), nitsColor, drawStyle);

+ 21 - 4
Gem/Code/Source/Automation/ScriptManager.cpp

@@ -1163,9 +1163,9 @@ namespace AtomSampleViewer
 
     void ScriptManager::Script_CapturePassAttachment(AZ::ScriptDataContext& dc)
     {
-        if (dc.GetNumArguments() != 3)
+        if (dc.GetNumArguments() != 3 && dc.GetNumArguments() != 4)
         {
-            ReportScriptError("CapturePassAttachment needs three arguments");
+            ReportScriptError("CapturePassAttachment needs three or four arguments");
             return;
         }
 
@@ -1181,6 +1181,12 @@ namespace AtomSampleViewer
             return;
         }
 
+        if (dc.GetNumArguments() == 4 && !dc.IsString(3))
+        {
+            ReportScriptError("CapturePassAttachment's forth argument must be a string 'Input' or 'Output'");
+            return;
+        }
+
         const char* stringValue = nullptr;
 
         AZStd::vector<AZStd::string> passHierarchy;
@@ -1193,6 +1199,17 @@ namespace AtomSampleViewer
         dc.ReadArg(2, stringValue);
         outputFilePath = AZStd::string(stringValue);
 
+        AZ::RPI::PassAttachmentReadbackOption readbackOption = AZ::RPI::PassAttachmentReadbackOption::Output;
+        if (dc.GetNumArguments() == 4)
+        {
+            AZStd::string option;
+            dc.ReadArg(3, option);
+            if (option == "Input")
+            {
+                readbackOption = AZ::RPI::PassAttachmentReadbackOption::Input;
+            }
+        }
+
         // read pass hierarchy
         AZ::ScriptDataContext stringtable;
         dc.InspectTable(0, stringtable);
@@ -1219,12 +1236,12 @@ namespace AtomSampleViewer
             }
         }
 
-        auto operation = [passHierarchy, slot, outputFilePath]()
+        auto operation = [passHierarchy, slot, outputFilePath, readbackOption]()
         {
             // Note this will pause the script until the capture is complete
             if (PrepareForScreenCapture(outputFilePath))
             {
-                AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, passHierarchy, slot, outputFilePath);
+                AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, passHierarchy, slot, outputFilePath, readbackOption);
             }
         };
 

+ 2 - 1
Gem/Code/Source/TonemappingExampleComponent.cpp

@@ -315,7 +315,8 @@ namespace AtomSampleViewer
     {
         AZStd::string filePath = m_imguiFrameCaptureSaver.GetSaveFilePath();
         AZStd::string slot = "Output";
-        AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, m_capturePassHierarchy, slot, filePath);
+        AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, m_capturePassHierarchy, slot, filePath,
+            AZ::RPI::PassAttachmentReadbackOption::Output);
     }
 
     RPI::ColorSpaceId TonemappingExampleComponent::GetColorSpaceIdForIndex(uint8_t colorSpaceIndex) const

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_approx_vary_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:ac464f29ef56ece9a0c949437240a58e9995d07e363806fc6e81af7eb1ebadbd
-size 33823
+oid sha256:994b7fcf71cca98290441401f43522cb29c381d65702ac8509e298ae3ac4a4d1
+size 32479

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_approx_vary_rough_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:c509bdc0bbada54db4df598a8910481f8effb21a3dd97afa26aba38e43129ac9
-size 17038
+oid sha256:afaea6525026e6675dbac2cfd392b46d5c49e793eb8a46de7394b2f086b08a3c
+size 26667

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_approx_vary_rough_nonmetal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:fa6600f5591d81a7d5ae4f8f60060c3522cec32d08df4bd57d04207ac046f481
-size 22333
+oid sha256:6e8024dc7d3702ae4ab3c4ae5ff0b2382ef79789ae716c6ea68c4c2bd847c639
+size 33102

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_approx_vary_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:30476cd28e92da1807ea5293cd02f7862e683210e0313c5109f258b1f51138d7
-size 40583
+oid sha256:512fef3561863ba1e62bd3cadcea8a70996eb194530483c564979125bac3349e
+size 40436

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_approx_vary_rough_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:34f37e668238066c98a58d593596527e2c2dd07554630245bdd1bd5b9fa949d6
-size 24119
+oid sha256:9fd3c5d3ca7145698d4ff8b750ecf909f7dfe76ab2d1b369c63e7303e65493c3
+size 35240

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_approx_vary_rough_nonmetal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:b01239967fb2238c9699d2e5bd85bd617ddbc9d9bdd6c5597083cb06faf705a0
-size 43015
+oid sha256:5f7a586cd5886cfb8a20f976865792257554c708b8146712e7e9f13a57ad97e0
+size 42886

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_vary_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:32cd6cadf769f9ff807b46df673b2d85ec6b3ad4b05b050a0efee1d70456669b
-size 33097
+oid sha256:374f70f2ea84466e8c6e30ff99bb9e4309211f9e1789dd90fed4d10a8aed3124
+size 44139

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_vary_rough_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:b5d7984fb15edd2068aeacc62f8bf9cb43d53241cb99cb7fdfcb67cf2688a2a8
-size 27833
+oid sha256:d8bed9219855223755d203c861fa656ce6d3c9bb6c3849f542e777dcdaeeb161
+size 38163

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_vary_rough_nonmetal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:c8f9c901d676b8b3eda665ebbc7d071c6354de7db2c0bf51f490d166b448a3c8
-size 32751
+oid sha256:d1d3c3ce1be26bdab9f6cc3121dea7420ae9b394a0a44d66af306c0dfd722c87
+size 42997

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_vary_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:5e0755c8d7f6ef3555e141729c95b4da38349c46059b2907dd3271665cbf48d1
-size 24243
+oid sha256:f48b4157a0ffef8551c392c1cd3d26b391f0d0d7b9e9f07f992acb26d6dbf569
+size 34895

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_vary_rough_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:ba16209ad6108b065ab5489066fed446a55e8513acabcb45062f1ea1a489cc05
-size 19188
+oid sha256:1c883fd3f2c539b05d3e4133b6a4eed802510cb7d31194fb7507a6aee86f99aa
+size 28806

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_vary_rough_nonmetal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:20e059806e6c8371f4732c6795586fba711581e982cc54f3da65bdef00acd8cc
-size 22167
+oid sha256:cd61f117a479e349990317815c7a58547cf7966991c2e3a08951815101ae5bb8
+size 32943

+ 13 - 25
Scripts/build/Jenkins/Jenkinsfile

@@ -15,8 +15,7 @@ PROJECT_REPOSITORY_NAME = 'o3de-atom-sampleviewer'
 PROJECT_ORGANIZATION_NAME = 'aws-lumberyard'
 ENGINE_REPOSITORY_NAME = 'o3de'
 ENGINE_ORGANIZATION_NAME = 'aws-lumberyard'
-ENGINE_BRANCH_DEFAULT = 'stabilization/2106'
-ENGINE_REFSPEC_DEFAULT = 'origin/stabilization/2106'
+ENGINE_BRANCH_DEFAULT = "${env.BRANCH_DEFAULT}" ?: 'development'
 
 def pipelineProperties = []
 
@@ -27,8 +26,7 @@ def pipelineParameters = [
     booleanParam(defaultValue: false, description: 'Deletes the contents of the output directories of the AssetProcessor before building.', name: 'CLEAN_ASSETS'),
     booleanParam(defaultValue: false, description: 'Deletes the contents of the workspace and forces a complete pull.', name: 'CLEAN_WORKSPACE'),
     booleanParam(defaultValue: false, description: 'Recreates the volume used for the workspace. The volume will be created out of a snapshot taken from main.', name: 'RECREATE_VOLUME'),
-    stringParam(defaultValue: "${ENGINE_BRANCH_DEFAULT}", description: 'Sets a different branch from o3de engine repo to use or use commit id. Default is mainline', trim: true, name: 'ENGINE_BRANCH'),
-    stringParam(defaultValue: "${ENGINE_REFSPEC_DEFAULT}", description: 'Sets a refspec for the mainline branch. Default is head of main', trim: true, name: 'ENGINE_REFSPEC')
+    stringParam(defaultValue: "${ENGINE_BRANCH_DEFAULT}", description: 'Sets a different branch from o3de engine repo to use or use commit id. Default is mainline', trim: true, name: 'ENGINE_BRANCH')
 ]
 
 def palSh(cmd, lbl = '', winSlashReplacement = true) {
@@ -186,25 +184,12 @@ def GetEnvStringList(Map envVarMap) {
     return strList
 }
 
-def GetLfsConfig(cmd, lbl = '') {
-    if (env.IS_UNIX) {
-        sh label: lbl,
-           script: cmd,
-           returnStdout: true
-    } else {
-        powershell label: lbl, // Powershell is used due to bat output returning the prompt as well
-           script: cmd,
-           returnStdout: true
-    }
-}
-
 def getEngineRemoteConfig(remoteConfigs) {
     def refSpec = "${params.ENGINE_REFSPEC}" ?: "${ENGINE_REFSPEC_DEFAULT}"
     def engineRemoteConfigs = [name: "${ENGINE_REPOSITORY_NAME}",
         url: remoteConfigs.url[0]
             .replace("${PROJECT_REPOSITORY_NAME}", "${ENGINE_REPOSITORY_NAME}")
             .replace("/${PROJECT_ORGANIZATION_NAME}/", "/${ENGINE_ORGANIZATION_NAME}/"),
-        refspec: "+refs/heads/main:refs/remotes/${refSpec}",
         credentialsId: remoteConfigs.credentialsId[0]
         ]
     return engineRemoteConfigs
@@ -281,7 +266,7 @@ def CheckoutRepo(boolean disableSubmodules = false) {
                     userRemoteConfigs: [projectAndUrl.value]
                 ]
                 if(fileExists(".lfsconfig")) {
-                    def localLfsUrl = GetLfsConfig("git config -f .lfsconfig --get lfs.url", "Getting LFS URL").replace("https://","").trim() // Read the lfs file instead of relying on env var
+                    def localLfsUrl = sh(script: "git config -f .lfsconfig --get lfs.url", label: "Getting LFS URL", returnStdout: true).replace("https://","").trim() // Read the lfs file instead of relying on env var
                     withCredentials([usernamePassword(credentialsId: "${env.GITHUB_USER}", passwordVariable: 'accesstoken', usernameVariable: 'username')]) {
                         palSh("git config -f .lfsconfig lfs.url https://${username}:${accesstoken}@${localLfsUrl}", 'Set credentials', false)
                     }
@@ -376,19 +361,22 @@ def Build(Map options, String platform, String type, String workspace) {
     // In both cases, the scripts are in the engine, is just what the current dir is and how we get to the scripts
     def currentDir = "${workspace}/${ENGINE_REPOSITORY_NAME}"
     def pathToEngine = ""
+    def scriptExt = ""
+    if (env.IS_UNIX) {
+        scriptExt = ".sh"
+    }
     if (env.EXECUTE_FROM_PROJECT?.toBoolean()) {
         currentDir = "${workspace}/${PROJECT_REPOSITORY_NAME}"
         pathToEngine = "../${ENGINE_REPOSITORY_NAME}/"
     }
+    else {
+        dir("${currentDir}") {
+            palSh("scripts/o3de${scriptExt} register --project-path ${workspace}/${PROJECT_REPOSITORY_NAME}", "Registering project ${PROJECT_REPOSITORY_NAME}") // o3de.sh will work under Windows in a Cygwin environment
+        }
+    }
     def command = "${pathToEngine}${options.BUILD_ENTRY_POINT} --platform ${platform} --type ${type}"
     dir("${currentDir}") {
-        if (env.IS_UNIX) {
-            sh label: "Running ${platform} ${type}",
-               script: "${pathToEngine}${options.PYTHON_DIR}/python.sh -u ${command}"
-        } else {
-            bat label: "Running ${platform} ${type}",
-                script: "${pathToEngine}${options.PYTHON_DIR}/python.cmd -u ${command}".replace('/','\\')
-        }
+        palSh("${pathToEngine}${options.PYTHON_DIR}/python${scriptExt} -u ${command}", "Running ${platform} ${type}")
     }
 }
 

+ 5 - 2
Standalone/PythonTests/Automated/test_AtomSampleViewer_main_suite.py

@@ -46,9 +46,12 @@ class TestAutomationMainSuite:
         # Execute test.
         process_utils.safe_check_call(cmd, stderr=subprocess.STDOUT, encoding='UTF-8', shell=True)
         try:
-            unexpected_lines = ["Script: Screenshot check failed. Diff score"]  # "Diff score" ensures legit failure.
+            unexpected_lines = ["Script: Screenshot check failed. Diff score",  # "Diff score" ensures legit failure.
+                                "Trace::Error",
+                                "Trace::Assert",
+                                "Traceback (most recent call last):"]
             atomsampleviewer_log_monitor.monitor_log_for_lines(
-                unexpected_lines=unexpected_lines, halt_on_unexpected=True, timeout=200)
+                unexpected_lines=unexpected_lines, halt_on_unexpected=True, timeout=240)
         except ly_test_tools.log.log_monitor.LogMonitorException as e:
             expected_screenshots_path = os.path.join(
                 workspace.paths.project(), "Scripts", "ExpectedScreenshots")

+ 4 - 1
Standalone/PythonTests/Automated/test_AtomSampleViewer_periodic_suite.py

@@ -46,7 +46,10 @@ class TestAutomationPeriodicSuite:
         # Execute test.
         process_utils.safe_check_call(cmd, stderr=subprocess.STDOUT, encoding='UTF-8', shell=True)
         try:
-            unexpected_lines = ["Script: Screenshot check failed. Diff score"]  # "Diff score" ensures legit failure.
+            unexpected_lines = ["Script: Screenshot check failed. Diff score",  # "Diff score" ensures legit failure.
+                                "Trace::Error",
+                                "Trace::Assert",
+                                "Traceback (most recent call last):"]
             atomsampleviewer_log_monitor.monitor_log_for_lines(
                 unexpected_lines=unexpected_lines, halt_on_unexpected=True, timeout=600)
         except ly_test_tools.log.log_monitor.LogMonitorException as e:

+ 5 - 2
Standalone/PythonTests/Automated/test_AtomSampleViewer_warp_suite.py

@@ -47,9 +47,12 @@ class TestAutomationWarpSuite:
         # Execute test.
         process_utils.safe_check_call(cmd, stderr=subprocess.STDOUT, encoding='UTF-8', shell=True)
         try:
-            unexpected_lines = ["Script: Screenshot check failed. Diff score"]  # "Diff score" ensures legit failure.
+            unexpected_lines = ["Script: Screenshot check failed. Diff score",  # "Diff score" ensures legit failure.
+                                "Trace::Error",
+                                "Trace::Assert",
+                                "Traceback (most recent call last):"]
             atomsampleviewer_log_monitor.monitor_log_for_lines(
-                unexpected_lines=unexpected_lines, halt_on_unexpected=True, timeout=200)
+                unexpected_lines=unexpected_lines, halt_on_unexpected=True, timeout=50)
         except ly_test_tools.log.log_monitor.LogMonitorException as e:
             expected_screenshots_path = os.path.join(
                 workspace.paths.project(), "Scripts", "ExpectedScreenshots")

+ 1 - 1
Standalone/PythonTests/CMakeLists.txt

@@ -16,7 +16,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED)
         TEST_REQUIRES gpu
         TEST_SUITE main
         TEST_SERIAL
-        TIMEOUT 300
+        TIMEOUT 600
         RUNTIME_DEPENDENCIES
             AssetProcessor
             AssetProcessorBatch