Forráskód Böngészése

Merge pull request #48 from aws-lumberyard-dev/ATOM/tonypeng/ATOM-15367

Atom/tonypeng/atom-15367
AMZN-tpeng 4 éve
szülő
commit
d15a2b9518

+ 14 - 0
Gem/Code/Source/Platform/Android/SceneReloadSoakTestComponent_Traits_Platform.h

@@ -0,0 +1,14 @@
+/*
+* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
+* its licensors.
+*
+* For complete copyright and license terms please see the LICENSE at the root of this
+* distribution (the "License"). All use of this software is governed by the License,
+* or, if provided, by the license below or the license accompanying this file. Do not
+* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*
+*/
+
+// [ATOM-15367] On more limited devices the large lattice size would run into out of memory error, specifically "device lost" error
+#define ATOMSAMPLEVIEWER_TRAIT_SCENE_RELOAD_SOAK_TEST_COMPONENT_LATTICE_SIZE       2

+ 1 - 0
Gem/Code/Source/Platform/Android/atomsampleviewer_android_files.cmake

@@ -12,6 +12,7 @@
 set(FILES
     AtomSampleViewerOptions_Android.cpp
     MultiThreadComponent_Traits_Platform.h
+    SceneReloadSoakTestComponent_Traits_Platform.h
     SSRExampleComponent_Traits_Platform.h
     TriangleConstantBufferExampleComponent_Traits_Platform.h
     SampleComponentManager_Android.cpp

+ 13 - 0
Gem/Code/Source/Platform/Linux/SceneReloadSoakTestComponent_Traits_Platform.h

@@ -0,0 +1,13 @@
+/*
+* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
+* its licensors.
+*
+* For complete copyright and license terms please see the LICENSE at the root of this
+* distribution (the "License"). All use of this software is governed by the License,
+* or, if provided, by the license below or the license accompanying this file. Do not
+* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*
+*/
+
+#define ATOMSAMPLEVIEWER_TRAIT_SCENE_RELOAD_SOAK_TEST_COMPONENT_LATTICE_SIZE       5

+ 1 - 0
Gem/Code/Source/Platform/Linux/atomsampleviewer_linux_files.cmake

@@ -12,6 +12,7 @@
 set(FILES
     AtomSampleViewerOptions_Linux.cpp
     MultiThreadComponent_Traits_Platform.h
+    SceneReloadSoakTestComponent_Traits_Platform.h
     SSRExampleComponent_Traits_Platform.h
     TriangleConstantBufferExampleComponent_Traits_Platform.h
     SampleComponentManager_Linux.cpp

+ 13 - 0
Gem/Code/Source/Platform/Mac/SceneReloadSoakTestComponent_Traits_Platform.h

@@ -0,0 +1,13 @@
+/*
+* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
+* its licensors.
+*
+* For complete copyright and license terms please see the LICENSE at the root of this
+* distribution (the "License"). All use of this software is governed by the License,
+* or, if provided, by the license below or the license accompanying this file. Do not
+* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*
+*/
+
+#define ATOMSAMPLEVIEWER_TRAIT_SCENE_RELOAD_SOAK_TEST_COMPONENT_LATTICE_SIZE       5

+ 1 - 0
Gem/Code/Source/Platform/Mac/atomsampleviewer_mac_files.cmake

@@ -13,6 +13,7 @@ set(FILES
     ../../../../Resources/MacLauncher/Info.plist
     AtomSampleViewerOptions_Mac.cpp
     MultiThreadComponent_Traits_Platform.h
+    SceneReloadSoakTestComponent_Traits_Platform.h
     SSRExampleComponent_Traits_Platform.h
     TriangleConstantBufferExampleComponent_Traits_Platform.h
     SampleComponentManager_Mac.cpp

+ 13 - 0
Gem/Code/Source/Platform/Windows/SceneReloadSoakTestComponent_Traits_Platform.h

@@ -0,0 +1,13 @@
+/*
+* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
+* its licensors.
+*
+* For complete copyright and license terms please see the LICENSE at the root of this
+* distribution (the "License"). All use of this software is governed by the License,
+* or, if provided, by the license below or the license accompanying this file. Do not
+* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*
+*/
+
+#define ATOMSAMPLEVIEWER_TRAIT_SCENE_RELOAD_SOAK_TEST_COMPONENT_LATTICE_SIZE       5

+ 1 - 0
Gem/Code/Source/Platform/Windows/atomsampleviewer_windows_files.cmake

@@ -12,6 +12,7 @@
 set(FILES
     AtomSampleViewerOptions_Windows.cpp
     MultiThreadComponent_Traits_Platform.h
+    SceneReloadSoakTestComponent_Traits_Platform.h
     SSRExampleComponent_Traits_Platform.h
     TriangleConstantBufferExampleComponent_Traits_Platform.h
     SampleComponentManager_Windows.cpp

+ 13 - 0
Gem/Code/Source/Platform/iOS/SceneReloadSoakTestComponent_Traits_Platform.h

@@ -0,0 +1,13 @@
+/*
+* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
+* its licensors.
+*
+* For complete copyright and license terms please see the LICENSE at the root of this
+* distribution (the "License"). All use of this software is governed by the License,
+* or, if provided, by the license below or the license accompanying this file. Do not
+* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*
+*/
+
+#define ATOMSAMPLEVIEWER_TRAIT_SCENE_RELOAD_SOAK_TEST_COMPONENT_LATTICE_SIZE       5

+ 1 - 0
Gem/Code/Source/Platform/iOS/atomsampleviewer_ios_files.cmake

@@ -13,6 +13,7 @@ set(FILES
     ../../../../Resources/IOSLauncher/Info.plist
     AtomSampleViewerOptions_iOS.cpp
     MultiThreadComponent_Traits_Platform.h
+    SceneReloadSoakTestComponent_Traits_Platform.h
     SSRExampleComponent_Traits_Platform.h
     TriangleConstantBufferExampleComponent_Traits_Platform.h
     SampleComponentManager_iOS.cpp

+ 3 - 1
Gem/Code/Source/SceneReloadSoakTestComponent.cpp

@@ -23,6 +23,8 @@
 
 #include <RHI/BasicRHIComponent.h>
 
+#include <SceneReloadSoakTestComponent_Traits_Platform.h>
+
 namespace AtomSampleViewer
 {
     using namespace AZ;
@@ -52,7 +54,7 @@ namespace AtomSampleViewer
         m_currentCount = 0;
         m_totalResetCount = 0;
 
-        SetLatticeDimensions(5, 5, 5);
+        SetLatticeDimensions(ATOMSAMPLEVIEWER_TRAIT_SCENE_RELOAD_SOAK_TEST_COMPONENT_LATTICE_SIZE, ATOMSAMPLEVIEWER_TRAIT_SCENE_RELOAD_SOAK_TEST_COMPONENT_LATTICE_SIZE, ATOMSAMPLEVIEWER_TRAIT_SCENE_RELOAD_SOAK_TEST_COMPONENT_LATTICE_SIZE);
         Base::Activate();
 
         TickBus::Handler::BusConnect();

+ 4 - 2
Shaders/StaticMesh.azsl

@@ -133,7 +133,9 @@ PixelOutput MainPS(VertexOutput input)
             debugInfo);
     }
     
-    output.m_diffuse = float4(diffuse.rgb, saturate(baseColor.a));
-    output.m_specular = float4(specular.rgb, saturate(baseColor.a));
+    float clampedAlpha = saturate(baseColor.a);
+    output.m_diffuse = float4(diffuse.rgb, clampedAlpha);
+    output.m_specular = float4(specular.rgb, clampedAlpha);
+
     return output;
 }