Parcourir la source

[ATOM][RHI][Vulkan][Android]
Address concerns:
-Get rid of duplicate shaders
-Comments with jira links

Peng il y a 4 ans
Parent
commit
d3b67cf532
32 fichiers modifiés avec 26 ajouts et 452 suppressions
  1. 2 4
      Gem/Code/Source/DynamicDrawExampleComponent.cpp
  2. 0 13
      Gem/Code/Source/Platform/Android/BindlessExampleComponent_Traits_Platform.h
  3. 0 13
      Gem/Code/Source/Platform/Android/DynamicDrawExampleComponent_Traits_Platform.h
  4. 2 0
      Gem/Code/Source/Platform/Android/SSRExampleComponent_Traits_Platform.h
  5. 3 2
      Gem/Code/Source/Platform/Android/TriangleConstantBufferExampleComponent_Traits_Platform.h
  6. 0 2
      Gem/Code/Source/Platform/Android/atomsampleviewer_android_files.cmake
  7. 0 13
      Gem/Code/Source/Platform/Linux/BindlessExampleComponent_Traits_Platform.h
  8. 0 13
      Gem/Code/Source/Platform/Linux/DynamicDrawExampleComponent_Traits_Platform.h
  9. 1 3
      Gem/Code/Source/Platform/Linux/TriangleConstantBufferExampleComponent_Traits_Platform.h
  10. 0 2
      Gem/Code/Source/Platform/Linux/atomsampleviewer_linux_files.cmake
  11. 0 13
      Gem/Code/Source/Platform/Mac/BindlessExampleComponent_Traits_Platform.h
  12. 0 13
      Gem/Code/Source/Platform/Mac/DynamicDrawExampleComponent_Traits_Platform.h
  13. 0 2
      Gem/Code/Source/Platform/Mac/TriangleConstantBufferExampleComponent_Traits_Platform.h
  14. 0 2
      Gem/Code/Source/Platform/Mac/atomsampleviewer_mac_files.cmake
  15. 0 13
      Gem/Code/Source/Platform/Windows/BindlessExampleComponent_Traits_Platform.h
  16. 0 13
      Gem/Code/Source/Platform/Windows/DynamicDrawExampleComponent_Traits_Platform.h
  17. 0 2
      Gem/Code/Source/Platform/Windows/TriangleConstantBufferExampleComponent_Traits_Platform.h
  18. 0 2
      Gem/Code/Source/Platform/Windows/atomsampleviewer_windows_files.cmake
  19. 0 13
      Gem/Code/Source/Platform/iOS/BindlessExampleComponent_Traits_Platform.h
  20. 0 13
      Gem/Code/Source/Platform/iOS/DynamicDrawExampleComponent_Traits_Platform.h
  21. 0 2
      Gem/Code/Source/Platform/iOS/TriangleConstantBufferExampleComponent_Traits_Platform.h
  22. 0 2
      Gem/Code/Source/Platform/iOS/atomsampleviewer_ios_files.cmake
  23. 1 3
      Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp
  24. 1 1
      Gem/Code/Source/RHI/TrianglesConstantBufferExampleComponent.cpp
  25. 3 1
      Gem/Code/Source/SSRExampleComponent.cpp
  26. 1 1
      Shaders/DynamicDraw/DynamicDrawExample.shader
  27. 2 2
      Shaders/RHI/BindlessPrototype.azsl
  28. 0 168
      Shaders/RHI/BindlessPrototypeMobile.azsl
  29. 0 24
      Shaders/RHI/BindlessPrototypeMobile.shader
  30. 10 0
      Shaders/RHI/TrianglesConstantBuffer.azsl
  31. 0 73
      Shaders/RHI/TrianglesConstantBufferMobile.azsl
  32. 0 24
      Shaders/RHI/TrianglesConstantBufferMobile.shader

+ 2 - 4
Gem/Code/Source/DynamicDrawExampleComponent.cpp

@@ -22,8 +22,6 @@
 #include <Atom/RPI.Public/DynamicDraw/DynamicDrawInterface.h>
 #include <Atom/RPI.Public/RPIUtils.h>
 
-#include <DynamicDrawExampleComponent_Traits_Platform.h>
-
 namespace AtomSampleViewer
 {
     void DynamicDrawExampleComponent::Reflect(AZ::ReflectContext* context)
@@ -47,7 +45,7 @@ namespace AtomSampleViewer
 
         // List of all assets this example needs.
         AZStd::vector<AZ::AssetCollectionAsyncLoader::AssetToLoadInfo> assetList = {
-            {ATOMSAMPLEVIEWER_TRAIT_DYNAMIC_DRAW_SAMPLE_SHADER_NAME, azrtti_typeid<AZ::RPI::ShaderAsset>()},
+            {"Shaders/dynamicdraw/dynamicdrawexample.azshader", azrtti_typeid<AZ::RPI::ShaderAsset>()},
         };
 
         ScriptRunnerRequestBus::Broadcast(&ScriptRunnerRequests::PauseScript);
@@ -73,7 +71,7 @@ namespace AtomSampleViewer
         // Create and initialize dynamic draw context
         m_dynamicDraw = RPI::DynamicDrawInterface::Get()->CreateDynamicDrawContext(RPI::RPISystemInterface::Get()->GetDefaultScene().get());
         
-        const char* shaderFilepath = ATOMSAMPLEVIEWER_TRAIT_DYNAMIC_DRAW_SAMPLE_SHADER_NAME;
+        const char* shaderFilepath = "Shaders/dynamicdraw/dynamicdrawexample.azshader";
         Data::Asset<RPI::ShaderAsset> shaderAsset = m_assetLoadManager.GetAsset<RPI::ShaderAsset>(shaderFilepath);
         m_dynamicDraw->InitShader(shaderAsset);
         m_dynamicDraw->InitVertexFormat(

+ 0 - 13
Gem/Code/Source/Platform/Android/BindlessExampleComponent_Traits_Platform.h

@@ -1,13 +0,0 @@
-/*
-* 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_BINDLESS_SAMPLE_SHADER_NAME                       "shaders/rhi/bindlessprototypemobile.azshader"

+ 0 - 13
Gem/Code/Source/Platform/Android/DynamicDrawExampleComponent_Traits_Platform.h

@@ -1,13 +0,0 @@
-/*
-* 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_DYNAMIC_DRAW_SAMPLE_SHADER_NAME                       "Shaders/dynamicdraw/dynamicdrawexamplemobile.azshader"

+ 2 - 0
Gem/Code/Source/Platform/Android/SSRExampleComponent_Traits_Platform.h

@@ -10,4 +10,6 @@
 *
 */
 
+// TODO: figure out the which limitations of android devices causing the error of loading the high poly model
+// https://jira.agscollab.com/browse/ATOM-14947
 #define ATOMSAMPLEVIEWER_TRAIT_SSR_SAMPLE_LUCY_MODEL_NAME                       "objects/lucy/lucy_low.azmodel"

+ 3 - 2
Gem/Code/Source/Platform/Android/TriangleConstantBufferExampleComponent_Traits_Platform.h

@@ -10,6 +10,7 @@
 *
 */
 
+// https://jira.agscollab.com/browse/ATOM-14949
+// The number need to be within the uniform limitations of android devices with lower specs where 15 total would be the lower bound on the devices.
 #define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_SINGLE_CONSTANT_BUFFER_SIZE       6u  
-#define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_MULTIPLE_CONSTANT_BUFFER_SIZE     6u
-#define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_SHADER_NAME                       "Shaders/RHI/TrianglesConstantBufferMobile.azshader"
+#define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_MULTIPLE_CONSTANT_BUFFER_SIZE     6u

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

@@ -11,8 +11,6 @@
 
 set(FILES
     AtomSampleViewerOptions_Android.cpp
-    BindlessExampleComponent_Traits_Platform.h
-    DynamicDrawExampleComponent_Traits_Platform.h
     MultiThreadComponent_Traits_Platform.h
     SSRExampleComponent_Traits_Platform.h
     TriangleConstantBufferExampleComponent_Traits_Platform.h

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

@@ -1,13 +0,0 @@
-/*
-* 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_BINDLESS_SAMPLE_SHADER_NAME                       "shaders/rhi/bindlessprototype.azshader"

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

@@ -1,13 +0,0 @@
-/*
-* 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_DYNAMIC_DRAW_SAMPLE_SHADER_NAME                       "Shaders/dynamicdraw/dynamicdrawexample.azshader"

+ 1 - 3
Gem/Code/Source/Platform/Linux/TriangleConstantBufferExampleComponent_Traits_Platform.h

@@ -11,6 +11,4 @@
 */
 
 #define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_SINGLE_CONSTANT_BUFFER_SIZE       15u  
-#define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_MULTIPLE_CONSTANT_BUFFER_SIZE     15u
-#define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_SHADER_NAME                       "Shaders/RHI/TrianglesConstantBuffer.azshader"
-    
+#define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_MULTIPLE_CONSTANT_BUFFER_SIZE     15u    

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

@@ -11,8 +11,6 @@
 
 set(FILES
     AtomSampleViewerOptions_Linux.cpp
-    BindlessExampleComponent_Traits_Platform.h
-    DynamicDrawExampleComponent_Traits_Platform.h
     MultiThreadComponent_Traits_Platform.h
     SSRExampleComponent_Traits_Platform.h
     TriangleConstantBufferExampleComponent_Traits_Platform.h

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

@@ -1,13 +0,0 @@
-/*
-* 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_BINDLESS_SAMPLE_SHADER_NAME                       "shaders/rhi/bindlessprototype.azshader"

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

@@ -1,13 +0,0 @@
-/*
-* 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_DYNAMIC_DRAW_SAMPLE_SHADER_NAME                       "Shaders/dynamicdraw/dynamicdrawexample.azshader"

+ 0 - 2
Gem/Code/Source/Platform/Mac/TriangleConstantBufferExampleComponent_Traits_Platform.h

@@ -12,5 +12,3 @@
 
 #define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_SINGLE_CONSTANT_BUFFER_SIZE       15u  
 #define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_MULTIPLE_CONSTANT_BUFFER_SIZE     15u
-#define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_SHADER_NAME                       "Shaders/RHI/TrianglesConstantBuffer.azshader"
-    

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

@@ -12,8 +12,6 @@
 set(FILES
     ../../../../Resources/MacLauncher/Info.plist
     AtomSampleViewerOptions_Mac.cpp
-    BindlessExampleComponent_Traits_Platform.h
-    DynamicDrawExampleComponent_Traits_Platform.h
     MultiThreadComponent_Traits_Platform.h
     SSRExampleComponent_Traits_Platform.h
     TriangleConstantBufferExampleComponent_Traits_Platform.h

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

@@ -1,13 +0,0 @@
-/*
-* 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_BINDLESS_SAMPLE_SHADER_NAME                       "shaders/rhi/bindlessprototype.azshader"

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

@@ -1,13 +0,0 @@
-/*
-* 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_DYNAMIC_DRAW_SAMPLE_SHADER_NAME                       "Shaders/dynamicdraw/dynamicdrawexample.azshader"

+ 0 - 2
Gem/Code/Source/Platform/Windows/TriangleConstantBufferExampleComponent_Traits_Platform.h

@@ -12,5 +12,3 @@
 
 #define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_SINGLE_CONSTANT_BUFFER_SIZE       15u  
 #define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_MULTIPLE_CONSTANT_BUFFER_SIZE     15u
-#define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_SHADER_NAME                       "Shaders/RHI/TrianglesConstantBuffer.azshader"
-    

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

@@ -11,8 +11,6 @@
 
 set(FILES
     AtomSampleViewerOptions_Windows.cpp
-    BindlessExampleComponent_Traits_Platform.h
-    DynamicDrawExampleComponent_Traits_Platform.h
     MultiThreadComponent_Traits_Platform.h
     SSRExampleComponent_Traits_Platform.h
     TriangleConstantBufferExampleComponent_Traits_Platform.h

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

@@ -1,13 +0,0 @@
-/*
-* 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_BINDLESS_SAMPLE_SHADER_NAME                       "shaders/rhi/bindlessprototype.azshader"

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

@@ -1,13 +0,0 @@
-/*
-* 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_DYNAMIC_DRAW_SAMPLE_SHADER_NAME                       "Shaders/dynamicdraw/dynamicdrawexample.azshader"

+ 0 - 2
Gem/Code/Source/Platform/iOS/TriangleConstantBufferExampleComponent_Traits_Platform.h

@@ -12,5 +12,3 @@
 
 #define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_SINGLE_CONSTANT_BUFFER_SIZE       15u  
 #define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_MULTIPLE_CONSTANT_BUFFER_SIZE     15u
-#define ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_SHADER_NAME                       "Shaders/RHI/TrianglesConstantBuffer.azshader"
-    

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

@@ -12,8 +12,6 @@
 set(FILES
     ../../../../Resources/IOSLauncher/Info.plist
     AtomSampleViewerOptions_iOS.cpp
-    BindlessExampleComponent_Traits_Platform.h
-    DynamicDrawExampleComponent_Traits_Platform.h
     MultiThreadComponent_Traits_Platform.h
     SSRExampleComponent_Traits_Platform.h
     TriangleConstantBufferExampleComponent_Traits_Platform.h

+ 1 - 3
Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp

@@ -33,8 +33,6 @@
 
 #include <Utils/Utils.h>
 
-#include <BindlessExampleComponent_Traits_Platform.h>
-
 namespace AtomSampleViewer
 {
     using namespace AZ;
@@ -353,7 +351,7 @@ namespace AtomSampleViewer
 
         // Load the shader
         {
-            const char* BindlessPrototypeShader = ATOMSAMPLEVIEWER_TRAIT_BINDLESS_SAMPLE_SHADER_NAME;
+            const char* BindlessPrototypeShader = "shaders/rhi/bindlessprototype.azshader";
 
             m_shader = AtomSampleViewer::BasicRHIComponent::LoadShader(BindlessPrototypeShader, InternalBP::SampleName);
             AZ_Assert(m_shader, "Shader isn't loaded correctly");

+ 1 - 1
Gem/Code/Source/RHI/TrianglesConstantBufferExampleComponent.cpp

@@ -296,7 +296,7 @@ namespace AtomSampleViewer
 
         // Load the Shader and obtain the Pipeline state and its SRG
         {
-            const char* triangeShaderFilePath = ATOMSAMPLEVIEWER_TRAIT_TRIANGLE_CONSTANT_BUFFER_SAMPLE_SHADER_NAME;
+            const char* triangeShaderFilePath = "Shaders/RHI/TrianglesConstantBuffer.azshader";
             auto shader = LoadShader(triangeShaderFilePath, s_trianglesConstantBufferExampleName);
             if (shader == nullptr)
                 return;

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

@@ -22,6 +22,8 @@
 #include <Automation/ScriptRunnerBus.h>
 #include <Utils/Utils.h>
 
+#include <SSRExampleComponent_Traits_Platform.h>
+
 namespace AtomSampleViewer
 {
     void SSRExampleComponent::Reflect(AZ::ReflectContext* context)
@@ -93,7 +95,7 @@ namespace AtomSampleViewer
         // statue
         {
             AZ::Data::Asset<AZ::RPI::MaterialAsset> materialAsset = AZ::RPI::AssetUtils::GetAssetByProductPath<AZ::RPI::MaterialAsset>("objects/lucy/lucy_stone.azmaterial", AZ::RPI::AssetUtils::TraceLevel::Assert);
-            AZ::Data::Asset<AZ::RPI::ModelAsset> modelAsset = AZ::RPI::AssetUtils::GetAssetByProductPath<AZ::RPI::ModelAsset>("objects/lucy/lucy_high.azmodel", AZ::RPI::AssetUtils::TraceLevel::Assert);
+            AZ::Data::Asset<AZ::RPI::ModelAsset> modelAsset = AZ::RPI::AssetUtils::GetAssetByProductPath<AZ::RPI::ModelAsset>(ATOMSAMPLEVIEWER_TRAIT_SSR_SAMPLE_LUCY_MODEL_NAME, AZ::RPI::AssetUtils::TraceLevel::Assert);
             AZ::Transform transform = AZ::Transform::CreateIdentity();
             transform *= AZ::Transform::CreateRotationZ(AZ::Constants::Pi);
             transform.SetTranslation(0.0f, 0.0f, -0.05f);

+ 1 - 1
Shaders/DynamicDraw/DynamicDrawExample.shader

@@ -9,7 +9,7 @@
     },
 
     "RasterState" : {
-        "DepthClipEnable" : false,
+        "DepthClipEnable" : true,
         "CullMode" : "None"
     },
 

+ 2 - 2
Shaders/RHI/BindlessPrototype.azsl

@@ -136,7 +136,7 @@ PixelOutput MainPS(VertexOutput psInput)
         SetFloat4(bindlessMaterial1.m_diffuseColor, HandleSrg::m_materialHandle, offset);
         SetUint(bindlessMaterial1.m_diffuseTextureIndex, HandleSrg::m_materialHandle, offset);
 
-        Texture2D texture = ImageSrg::m_textureArray[bindlessMaterial1.m_diffuseTextureIndex];
+        Texture2D texture = ImageSrg::m_textureArray[bindlessMaterial1.m_diffuseTextureIndex % 8]; // % 8 for wrap-around texture index as specified in ImageSrg.m_textureArray
         OUT.m_color = texture.Sample(ImageSrg::m_sampler, psInput.m_uv);
     }
     else if(materialIndex.x == 2) // Shaded material
@@ -148,7 +148,7 @@ PixelOutput MainPS(VertexOutput psInput)
         SetUint(bindlessMaterial2.m_normalTextureIndex, HandleSrg::m_materialHandle, offset);
         SetUint(bindlessMaterial2.m_specularTextureIndex, HandleSrg::m_materialHandle, offset);
 
-        Texture2D texture = ImageSrg::m_textureArray[bindlessMaterial2.m_diffuseTextureIndex];
+        Texture2D texture = ImageSrg::m_textureArray[bindlessMaterial2.m_diffuseTextureIndex & 8]; // % 8 for wrap-around texture index as specified in ImageSrg.m_textureArray
         color = texture.Sample(ImageSrg::m_sampler, psInput.m_uv);
 
         float3 lightDir;

+ 0 - 168
Shaders/RHI/BindlessPrototypeMobile.azsl

@@ -1,168 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.coFrequencyExperimentalm, 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.
-*
-*/
-
-// GlobalSrg::m_floatBuffer
-// PerSceneSrg::m_textureArray
-// PerSceneSrg::m_sampler
-#include "../../../Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/ShaderResourceGroups/BindlessPrototypeSrg.azsli"
-
-struct BindlessMaterial0
-{
-    uint4 materialIndex;
-
-    float4 m_diffuseColor;
-};
-
-struct BindlessMaterial1
-{
-    uint4 materialIndex;
-
-    float4 m_diffuseColor;
-    uint m_diffuseTextureIndex;
-};
-
-struct BindlessMaterial2
-{
-    uint4 materialIndex;
-
-    float4 m_diffuseColor;
-    uint m_diffuseTextureIndex;
-    uint m_normalTextureIndex;
-    uint m_specularTextureIndex;
-};
-
-struct PerObject
-{
-    float4x4 m_localToWorldMatrix;
-    float4 rotation;
-};
-
-ShaderResourceGroupSemantic PerSubMesh
-{
-    FrequencyId = 1;
-};
-
-// [TODO ATOM-2769] When the inline feature is complete, use InlineConstant instead of sending the data
-// via ConstantBuffer.
-ShaderResourceGroup HandleSrg : PerSubMesh
-{
-    uint m_perViewHandle;
-    uint m_perObjectHandle;
-    uint m_materialHandle;
-    uint m_lightHandle;
-};
-
-struct VertexInput
-{
-    float3 m_position : POSITION;
-    float3 m_normal : NORMAL;
-    float3 m_tangent : TANGENT;
-    float3 m_bitangent : BITANGENT;
-    float2 m_uv : UV0;
-};
-
-struct VertexOutput
-{
-    float4 m_position : SV_Position;
-    float3 m_normal : NORMAL;
-    float3 m_tangent : TANGENT;
-    float3 m_bitangent : BITANGENT;
-    float2 m_uv : UV0;
-};
-
-VertexOutput MainVS(VertexInput vsInput)
-{
-    VertexOutput OUT;
-
-    // Read the PerObject data from the FloatBuffer
-    uint offset = 0;
-    PerObject perObject;
-    {
-        SetFloat4x4(perObject.m_localToWorldMatrix, HandleSrg::m_perObjectHandle, offset);
-        SetFloat4(perObject.rotation, HandleSrg::m_perObjectHandle, offset);
-    }
-
-    // Read the world matrix from the FloatBuffer
-    float4x4 worldToClipMatrix;
-    offset = 0;
-    {
-        SetFloat4x4(worldToClipMatrix, HandleSrg::m_perViewHandle, offset);
-    }
-
-    const float4 worldPosition = mul(perObject.m_localToWorldMatrix,  float4(vsInput.m_position, 1.0));
-    OUT.m_position = mul(worldToClipMatrix, worldPosition);
-    OUT.m_uv = vsInput.m_uv;
-    OUT.m_normal = normalize(vsInput.m_normal);
-
-    return OUT;
-}
-
-struct PixelOutput
-{
-    float4 m_color : SV_Target0;
-};
-
-PixelOutput MainPS(VertexOutput psInput)
-{
-    PixelOutput OUT;
-    uint offset = 0;
-    
-    // Read the material index to identify the material type
-    uint4 materialIndex;
-    {
-        SetUint4(materialIndex, HandleSrg::m_materialHandle, offset);
-    }
-    
-    // Read the material data from the FloatBuffer depending ont he material index
-    if(materialIndex.x == 0) // Albedo material
-    {
-        BindlessMaterial0 bindlessMaterial0; 
-        SetFloat4(bindlessMaterial0.m_diffuseColor, HandleSrg::m_materialHandle, offset);
-        
-        OUT.m_color = float4(bindlessMaterial0.m_diffuseColor.xyz, 1.0);
-    }
-    else if(materialIndex.x == 1) // Texture sample material
-    {
-        BindlessMaterial1 bindlessMaterial1; 
-        SetFloat4(bindlessMaterial1.m_diffuseColor, HandleSrg::m_materialHandle, offset);
-        SetUint(bindlessMaterial1.m_diffuseTextureIndex, HandleSrg::m_materialHandle, offset);
-
-        Texture2D texture = ImageSrg::m_textureArray[bindlessMaterial1.m_diffuseTextureIndex % 8];  // mod 8 for wrap-around texture index as specified in ImageSrg.m_textureArray
-        OUT.m_color = texture.Sample(ImageSrg::m_sampler, psInput.m_uv);
-    }
-    else if(materialIndex.x == 2) // Shaded material
-    {
-        float4 color;
-        BindlessMaterial2 bindlessMaterial2; 
-        SetFloat4(bindlessMaterial2.m_diffuseColor, HandleSrg::m_materialHandle, offset);
-        SetUint(bindlessMaterial2.m_diffuseTextureIndex, HandleSrg::m_materialHandle, offset);
-        SetUint(bindlessMaterial2.m_normalTextureIndex, HandleSrg::m_materialHandle, offset);
-        SetUint(bindlessMaterial2.m_specularTextureIndex, HandleSrg::m_materialHandle, offset);
-
-        Texture2D texture = ImageSrg::m_textureArray[bindlessMaterial2.m_diffuseTextureIndex % 8]; // mod 8 for wrap-around texture index as specified in ImageSrg.m_textureArray
-        color = texture.Sample(ImageSrg::m_sampler, psInput.m_uv);
-
-        float3 lightDir;
-        uint lightOffset = 0;
-        SetFloat3(lightDir, HandleSrg::m_lightHandle, lightOffset); 
-        lightDir = normalize(-lightDir);
-
-        color *= dot(lightDir, psInput.m_normal) * 8.0;
-        OUT.m_color = color;
-    }
-    else
-    {
-        OUT.m_color = float4(1.0, 1.0, 1.0, 1.0);
-    }
-
-    return OUT;
-}

+ 0 - 24
Shaders/RHI/BindlessPrototypeMobile.shader

@@ -1,24 +0,0 @@
-{
-    "Source" : "BindlessPrototypeMobile",
-
-    "DepthStencilState" : { 
-        "Depth" : { "Enable" : false, "CompareFunc" : "GreaterEqual" }
-    },
-
-    "DrawList" : "forward",
-
-    "ProgramSettings":
-    {
-      "EntryPoints":
-      [
-        {
-          "name": "MainVS",
-          "type": "Vertex"
-        },
-        {
-          "name": "MainPS",
-          "type": "Fragment"
-        }
-      ]
-    }
-}

+ 10 - 0
Shaders/RHI/TrianglesConstantBuffer.azsl

@@ -13,8 +13,18 @@
  #include <Atom/Features/SrgSemantics.azsli>
 
 // Number of triangles that will be rendered on screen
+// Uniform limitation need to be taken into consideration for mobile devices
+// https://jira.agscollab.com/browse/ATOM-14949
+#if AZ_TRAIT_CONSTANT_BUFFER_LIMITATIONS
+
+#define MAX_NUMBER_OF_INSTANCES 12
+
+#else
+
 #define MAX_NUMBER_OF_INSTANCES 30
 
+#endif
+
 struct InstanceInfo
 {
     column_major float4x4 m_matrix;

+ 0 - 73
Shaders/RHI/TrianglesConstantBufferMobile.azsl

@@ -1,73 +0,0 @@
-/*
- * 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.
- *
- */
-
- #include <Atom/Features/SrgSemantics.azsli>
-
-// Number of triangles that will be rendered on screen
-#define MAX_NUMBER_OF_INSTANCES 12
-
-struct InstanceInfo
-{
-    column_major float4x4 m_matrix;
-    float4 m_colorMultiplier;
-    // NOTE: This actually shouldn't be required, but the current validation will give a false positive
-    // when the stride isn't the same size as the stride defined on the applicaiton side.
-    // This assumes 256 alignment, which is standard for DX12, but is variable in Vulkan
-    float padding0[44]; 
-};
-
-struct InstanceData
-{
-    InstanceInfo m_instancesInfo;
-};
-
-ShaderResourceGroup TriangleSrg : SRG_PerObject
-{
-    ConstantBuffer<InstanceData> m_trianglesCB[MAX_NUMBER_OF_INSTANCES];
-}
-
-struct VSInput
-{
-    float3 m_position : POSITION;
-    float4 m_color : COLOR0;
-    uint m_instanceIndex : SV_InstanceID;
-};
-
-struct VSOutput
-{
-    float4 m_position : SV_Position;
-    float4 m_color : COLOR0;
-};
-
-VSOutput MainVS(VSInput vsInput)
-{
-    VSOutput OUT;
-    
-    InstanceInfo triangleInstanceInfo = TriangleSrg::m_trianglesCB[vsInput.m_instanceIndex].m_instancesInfo;
-    
-    OUT.m_position = mul(float4(vsInput.m_position, 1.0f),triangleInstanceInfo.m_matrix);
-    OUT.m_color = vsInput.m_color * triangleInstanceInfo.m_colorMultiplier;
-    
-    return OUT;
-}
-
-struct PSOutput
-{
-    float4 m_color : SV_Target0;
-};
-
-PSOutput MainPS(VSOutput vsOutput)
-{
-    PSOutput OUT;
-    OUT.m_color = vsOutput.m_color;
-    return OUT;
-}

+ 0 - 24
Shaders/RHI/TrianglesConstantBufferMobile.shader

@@ -1,24 +0,0 @@
-{
-    "Source" : "TrianglesConstantBufferMobile",
-
-    "DepthStencilState" : { 
-        "Depth" : { "Enable" : false, "CompareFunc" : "GreaterEqual" }
-    },
-
-    "DrawList" : "forward",
-
-    "ProgramSettings":
-    {
-      "EntryPoints":
-      [
-        {
-          "name": "MainVS",
-          "type": "Vertex"
-        },
-        {
-          "name": "MainPS",
-          "type": "Fragment"
-        }
-      ]
-    }
-}