Skip to content

Commit 7970d64

Browse files
Merge pull request #624 from o3de/stabilization/2305
Merge Stabilization/2305 to main
2 parents 9bcf25a + 2e7c153 commit 7970d64

File tree

696 files changed

+7680
-9163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

696 files changed

+7680
-9163
lines changed

.clang-format

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
Language: Cpp
2+
3+
AccessModifierOffset: -4
4+
AlignAfterOpenBracket: AlwaysBreak
5+
AlignConsecutiveAssignments: false
6+
AlignConsecutiveDeclarations: false
7+
AlignEscapedNewlines: Right
8+
AlignOperands: false
9+
AlignTrailingComments: false
10+
AllowAllArgumentsOnNextLine: true
11+
AllowAllParametersOfDeclarationOnNextLine: true
12+
AllowShortFunctionsOnASingleLine: None
13+
AllowShortLambdasOnASingleLine: None
14+
AlwaysBreakAfterReturnType: None
15+
AlwaysBreakTemplateDeclarations: true
16+
BinPackParameters: false
17+
BreakBeforeBraces: Custom
18+
BraceWrapping:
19+
AfterClass: true
20+
AfterControlStatement: true
21+
AfterEnum: true
22+
AfterFunction: true
23+
AfterNamespace: true
24+
BeforeLambdaBody: true
25+
AfterStruct: true
26+
BeforeElse: true
27+
SplitEmptyFunction: true
28+
BreakBeforeTernaryOperators: true
29+
BreakConstructorInitializers: BeforeComma
30+
BreakInheritanceList: BeforeComma
31+
ColumnLimit: 140
32+
ConstructorInitializerIndentWidth: 4
33+
ContinuationIndentWidth: 4
34+
Cpp11BracedListStyle: false
35+
FixNamespaceComments: true
36+
IncludeBlocks: Preserve
37+
IndentCaseBlocks: true
38+
IndentCaseLabels: false
39+
IndentPPDirectives: None
40+
IndentWidth: 4
41+
KeepEmptyLinesAtTheStartOfBlocks: false
42+
MaxEmptyLinesToKeep: 1
43+
NamespaceIndentation: All
44+
PenaltyReturnTypeOnItsOwnLine: 1000
45+
PointerAlignment: Left
46+
SortIncludes: true
47+
SpaceAfterLogicalNot: false
48+
SpaceAfterTemplateKeyword: false
49+
SpaceBeforeAssignmentOperators: true
50+
SpaceBeforeCpp11BracedList: false
51+
SpaceBeforeCtorInitializerColon: true
52+
SpaceBeforeInheritanceColon: true
53+
SpaceBeforeParens: ControlStatements
54+
SpaceBeforeRangeBasedForLoopColon: true
55+
SpaceInEmptyParentheses: false
56+
SpacesInAngles: false
57+
SpacesInCStyleCastParentheses: false
58+
SpacesInParentheses: false
59+
Standard: c++17
60+
UseTab: Never

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ AssetProcessorTemp/**
88
[Cc]ache/
99
[Uu]ser/
1010
.DS_Store
11+
CMakeUserPresets.json

CMakeLists.txt

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,41 @@
66
#
77
#
88

9+
910
if(NOT PROJECT_NAME)
10-
cmake_minimum_required(VERSION 3.19)
11+
cmake_minimum_required(VERSION 3.22)
12+
13+
# Utility function to look for an optional 'engine_finder_cmake_path'setting
14+
function(get_engine_finder_cmake_path project_json_file_path path_value)
15+
if(NOT ${path_value} AND EXISTS "${project_json_file_path}")
16+
file(READ "${project_json_file_path}" project_json_data)
17+
string(JSON engine_finder_cmake_value ERROR_VARIABLE json_error GET ${project_json_data} "engine_finder_cmake_path")
18+
cmake_path(APPEND CMAKE_CURRENT_SOURCE_DIR "${engine_finder_cmake_value}" engine_finder_cmake_value)
19+
if(NOT json_error AND EXISTS "${engine_finder_cmake_value}")
20+
set(${path_value} "${engine_finder_cmake_value}" PARENT_SCOPE)
21+
elseif(json_error AND ${engine_finder_cmake_value} STREQUAL "NOTFOUND")
22+
# When the error value is just NOTFOUND that means there is a JSON
23+
# parsing error, and not simply a missing key
24+
message(WARNING "Unable to read 'engine_finder_cmake_path'.\nError: ${json_error} ${engine_finder_cmake_value}")
25+
endif()
26+
endif()
27+
endfunction()
28+
29+
# Check for optional 'engine_finder_cmake_path' in order of preference
30+
# We support per-project customization to make it easier to upgrade
31+
# or revert to a custom EngineFinder.cmake
32+
get_engine_finder_cmake_path("${CMAKE_CURRENT_SOURCE_DIR}/user/project.json" engine_finder_cmake_path)
33+
get_engine_finder_cmake_path("${CMAKE_CURRENT_SOURCE_DIR}/project.json" engine_finder_cmake_path)
34+
if(NOT engine_finder_cmake_path)
35+
set(engine_finder_cmake_path cmake/EngineFinder.cmake)
36+
endif()
37+
1138
include(cmake/CompilerSettings.cmake)
1239
project(AtomSampleViewer
1340
LANGUAGES C CXX
1441
VERSION 1.0.0.0
1542
)
16-
include(cmake/EngineFinder.cmake OPTIONAL)
43+
include(${engine_finder_cmake_path} OPTIONAL)
1744
find_package(o3de REQUIRED)
1845
o3de_initialize()
19-
else()
20-
# Add the project_name to global LY_PROJECTS_TARGET_NAME property
21-
file(READ "${CMAKE_CURRENT_LIST_DIR}/project.json" project_json)
22-
23-
string(JSON project_target_name ERROR_VARIABLE json_error GET ${project_json} "project_name")
24-
if(json_error)
25-
message(FATAL_ERROR "Unable to read key 'project_name' from 'project.json'")
26-
endif()
27-
28-
set_property(GLOBAL APPEND PROPERTY LY_PROJECTS_TARGET_NAME ${project_target_name})
29-
30-
add_subdirectory(Gem)
31-
add_subdirectory(Standalone)
3246
endif()

Gem/Code/CMakeLists.txt

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,7 @@
66
#
77
#
88

9-
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME})
10-
11-
ly_add_target(
12-
NAME AtomSampleViewer.Lib.Static STATIC
13-
NAMESPACE Gem
14-
FILES_CMAKE
15-
atomsampleviewergem_lib_files.cmake
16-
INCLUDE_DIRECTORIES
17-
PUBLIC
18-
Lib
19-
BUILD_DEPENDENCIES
20-
PUBLIC
21-
AZ::AzGameFramework
22-
Gem::Atom_AtomBridge.Static
23-
Gem::Atom_RPI.Public
24-
Gem::Atom_Utils.Static
25-
)
9+
o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}")
2610

2711
ly_add_target(
2812
NAME AtomSampleViewer.Private.Static STATIC
@@ -43,7 +27,6 @@ ly_add_target(
4327
Gem::Atom_AtomBridge.Static
4428
Gem::Atom_Feature_Common.Static
4529
Gem::Atom_Component_DebugCamera.Static
46-
Gem::AtomSampleViewer.Lib.Static
4730
Gem::Profiler.Static
4831
Gem::DiffuseProbeGrid.Static
4932
)
@@ -67,6 +50,7 @@ ly_add_target(
6750
# if enabled, AtomSampleViewer is used by the Client and ServerLauncher
6851
ly_create_alias(NAME AtomSampleViewer.Clients NAMESPACE Gem TARGETS Gem::AtomSampleViewer)
6952
ly_create_alias(NAME AtomSampleViewer.Servers NAMESPACE Gem TARGETS Gem::AtomSampleViewer)
53+
ly_create_alias(NAME AtomSampleViewer.Unified NAMESPACE Gem TARGETS Gem::AtomSampleViewer)
7054

7155
if(PAL_TRAIT_BUILD_HOST_TOOLS)
7256

@@ -83,7 +67,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
8367
PRIVATE
8468
AZ::AzGameFramework
8569
Gem::Atom_AtomBridge.Static
86-
Gem::AtomSampleViewer.Lib.Static
8770
PUBLIC
8871
Gem::Atom_RPI.Edit
8972
)
@@ -139,12 +122,6 @@ if(PAL_TRAIT_BUILD_SUPPORTS_TESTS)
139122
endif()
140123

141124

142-
################################################################################
143-
# Gem dependencies
144-
################################################################################
145-
146-
ly_enable_gems(PROJECT_NAME AtomSampleViewer GEM_FILE enabled_gems.cmake)
147-
148125
# If we build a server, then apply the gems to the server
149126
if(PAL_TRAIT_BUILD_SERVER_SUPPORTED)
150127
set_property(GLOBAL APPEND PROPERTY LY_LAUNCHER_SERVER_PROJECTS AtomSampleViewer)

Gem/Code/Lib/MaterialFunctors/StacksShaderCollectionFunctor.cpp

Lines changed: 0 additions & 44 deletions
This file was deleted.

Gem/Code/Lib/MaterialFunctors/StacksShaderCollectionFunctor.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

Gem/Code/Lib/MaterialFunctors/StacksShaderInputFunctor.cpp

Lines changed: 0 additions & 41 deletions
This file was deleted.

Gem/Code/Lib/MaterialFunctors/StacksShaderInputFunctor.h

Lines changed: 0 additions & 41 deletions
This file was deleted.

Gem/Code/Source/AreaLightExampleComponent.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <Atom/Component/DebugCamera/NoClipControllerComponent.h>
2727

2828
#include <imgui/imgui.h>
29-
#include <Atom/Feature/Material/MaterialAssignment.h>
3029

3130
#include <RHI/BasicRHIComponent.h>
3231

Gem/Code/Source/AssetLoadTestComponent.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,27 +173,25 @@ namespace AtomSampleViewer
173173

174174
void AssetLoadTestComponent::OnAllAssetsReadyActivate()
175175
{
176-
AZ::Render::MaterialAssignmentMap materials;
177176
for (ModelInstanceData& instanceData : m_modelInstanceData)
178177
{
179-
AZ::Render::MaterialAssignment& defaultAssignment = materials[AZ::Render::DefaultMaterialAssignmentId];
180-
defaultAssignment = {};
181-
178+
AZ::Data::Instance<AZ::RPI::Material> materialInstance;
182179
if (instanceData.m_materialAssetId.IsValid())
183180
{
184-
defaultAssignment.m_materialAsset.Create(instanceData.m_materialAssetId);
185-
defaultAssignment.m_materialInstance = AZ::RPI::Material::FindOrCreate(defaultAssignment.m_materialAsset);
181+
AZ::Data::Asset<RPI::MaterialAsset> materialAsset;
182+
materialAsset.Create(instanceData.m_materialAssetId);
183+
materialInstance = AZ::RPI::Material::FindOrCreate(materialAsset);
186184

187185
// cache the material when its loaded
188-
m_cachedMaterials.insert(defaultAssignment.m_materialAsset);
186+
m_cachedMaterials.insert(materialAsset);
189187
}
190188

191189
if (instanceData.m_modelAssetId.IsValid())
192190
{
193191
AZ::Data::Asset<AZ::RPI::ModelAsset> modelAsset;
194192
modelAsset.Create(instanceData.m_modelAssetId);
195193

196-
instanceData.m_meshHandle = GetMeshFeatureProcessor()->AcquireMesh(AZ::Render::MeshHandleDescriptor{ modelAsset }, materials);
194+
instanceData.m_meshHandle = GetMeshFeatureProcessor()->AcquireMesh(AZ::Render::MeshHandleDescriptor{ modelAsset }, materialInstance);
197195
GetMeshFeatureProcessor()->SetTransform(instanceData.m_meshHandle, instanceData.m_transform);
198196
}
199197
}

0 commit comments

Comments
 (0)