From 1d4c483e73797418ae4fc3e6bf5c20007d5b2016 Mon Sep 17 00:00:00 2001 From: bosnichd Date: Fri, 30 Apr 2021 07:31:42 -0600 Subject: [PATCH] Red code legacy renderer (#383) - Remove some references to gEnv->pRenderer/GetIEditor()->GetRenderer() that is now always null. - Restore the debug console to existence. - Stop building the following in preparation for their removal: Code/CryEngine/Cry3DEngine/* Code/CryEngine/RenderDll/* Code/Tools/CryFXC/* Code/Tools/HLSLCrossCompiler/* Code/Tools/HLSLCrossCompilerMETAL/* Code/Tools/RC/* Code/Tools/ShaderCacheGen/* Tools/CrySCompileServer/* --- .../Gem/PythonTests/CMakeLists.txt | 11 - Code/CryEngine/CMakeLists.txt | 2 - Code/CryEngine/CryCommon/CREGeomCache.h | 2 +- Code/CryEngine/CryCommon/CRESky.h | 2 +- Code/CryEngine/CryCommon/IIndexedMesh.h | 2 +- Code/CryEngine/CryCommon/IShader.h | 2 +- Code/CryEngine/CryCommon/Vertex.h | 1093 +++++++++++++++++ Code/CryEngine/CrySystem/CMakeLists.txt | 2 - .../CrySystem/Platform/Mac/platform_mac.cmake | 11 - Code/CryEngine/CrySystem/SystemRender.cpp | 71 -- .../Android/launcher_project_android.cmake | 8 - .../Linux/launcher_project_linux.cmake | 12 - .../Platform/Mac/launcher_project_mac.cmake | 6 - .../Windows/launcher_project_windows.cmake | 5 - .../Platform/iOS/launcher_project_ios.cmake | 7 - Code/LauncherUnified/launcher_generator.cmake | 8 - Code/Sandbox/Editor/CustomResolutionDlg.cpp | 10 +- Code/Sandbox/Editor/EnvironmentPanel.cpp | 13 - .../Platform/Windows/editor_windows.cmake | 5 - Code/Sandbox/Editor/RenderViewport.cpp | 2 - Code/Sandbox/Editor/TimeOfDayDialog.cpp | 18 - .../EditorCommon/Cry_LegacyPhysUtils.h | 704 +++++++++++ .../Plugins/EditorCommon/CurveEditor.cpp | 2 +- .../Plugins/EditorCommon/CurveEditor_38.cpp | 2 +- Code/Tools/AssetProcessor/CMakeLists.txt | 1 - Code/Tools/CMakeLists.txt | 4 - Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt | 1 - .../Code/Source/AssetMemoryAnalyzer.cpp | 50 +- .../Code/Source/AssetMemoryAnalyzer.h | 8 - .../AssetMemoryAnalyzerSystemComponent.cpp | 5 +- .../Code/Source/ExportJSON.cpp | 1 - .../Code/Source/ImguiAtomSystemComponent.h | 1 + .../EMotionFX/Pipeline/RCExt/ExportContexts.h | 11 +- .../Code/Source/Shape/PolygonPrismShape.cpp | 5 + Gems/PhysX/Code/CMakeLists.txt | 1 - .../TangentPreExportComponent.h | 1 - Tools/LyTestTools/tests/CMakeLists.txt | 2 - .../ly_remote_console/tests/CMakeLists.txt | 1 - cmake/LYTestWrappers.cmake | 1 - 39 files changed, 1826 insertions(+), 267 deletions(-) create mode 100644 Code/CryEngine/CryCommon/Vertex.h create mode 100644 Code/Sandbox/Plugins/EditorCommon/Cry_LegacyPhysUtils.h diff --git a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt index 4e5dadb13c..6d3727195e 100644 --- a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt @@ -28,7 +28,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor - Legacy::CryRenderNULL AZ::AssetProcessor AutomatedTesting.Assets COMPONENT @@ -42,7 +41,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor - Legacy::CryRenderNULL AZ::AssetProcessor AutomatedTesting.Assets COMPONENT @@ -56,7 +54,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TIMEOUT 3600 RUNTIME_DEPENDENCIES Legacy::Editor - Legacy::CryRenderNULL AZ::AssetProcessor AutomatedTesting.Assets COMPONENT @@ -74,7 +71,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor - Legacy::CryRenderNULL AZ::AssetProcessor AutomatedTesting.Assets COMPONENT @@ -88,7 +84,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor - Legacy::CryRenderNULL AZ::AssetProcessor AutomatedTesting.Assets ) @@ -104,7 +99,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor - Legacy::CryRenderNULL AZ::AssetProcessor AutomatedTesting.Assets COMPONENT @@ -123,7 +117,6 @@ endif() # TIMEOUT 1500 # RUNTIME_DEPENDENCIES # Legacy::Editor -# Legacy::CryRenderNULL # AZ::AssetProcessor # AutomatedTesting.Assets # ) @@ -139,7 +132,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor - Legacy::CryRenderNULL AZ::AssetProcessor AutomatedTesting.Assets Gem::EditorPythonBindings.Editor @@ -157,7 +149,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor - Legacy::CryRenderNULL AZ::AssetProcessor AutomatedTesting.Assets Gem::EditorPythonBindings.Editor @@ -295,7 +286,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor - Legacy::CryRenderNULL AZ::AssetProcessor AutomatedTesting.Assets COMPONENT @@ -314,7 +304,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) # AZ::AssetProcessor # AZ::AssetProcessorBatch # AutomatedTesting.GameLauncher - # Legacy::CryRenderNULL #) endif() diff --git a/Code/CryEngine/CMakeLists.txt b/Code/CryEngine/CMakeLists.txt index 1735224146..38fcbf4a27 100644 --- a/Code/CryEngine/CMakeLists.txt +++ b/Code/CryEngine/CMakeLists.txt @@ -9,8 +9,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -add_subdirectory(Cry3DEngine) add_subdirectory(CryCommon) add_subdirectory(CryFont) add_subdirectory(CrySystem) -add_subdirectory(RenderDll) diff --git a/Code/CryEngine/CryCommon/CREGeomCache.h b/Code/CryEngine/CryCommon/CREGeomCache.h index 089915988e..6911b8486e 100644 --- a/Code/CryEngine/CryCommon/CREGeomCache.h +++ b/Code/CryEngine/CryCommon/CREGeomCache.h @@ -19,7 +19,7 @@ #if defined(USE_GEOM_CACHES) -#include "../RenderDll/Common/Shaders/Vertex.h" +#include #include class CREGeomCache diff --git a/Code/CryEngine/CryCommon/CRESky.h b/Code/CryEngine/CryCommon/CRESky.h index e1ef7bcaa8..3dfc7d184f 100644 --- a/Code/CryEngine/CryCommon/CRESky.h +++ b/Code/CryEngine/CryCommon/CRESky.h @@ -17,7 +17,7 @@ //============================================================= #include "VertexFormats.h" -#include "../RenderDll/Common/Shaders/Vertex.h" +#include struct SSkyLightRenderParams; diff --git a/Code/CryEngine/CryCommon/IIndexedMesh.h b/Code/CryEngine/CryCommon/IIndexedMesh.h index 9d0d77ffc8..d7ba19ae6c 100644 --- a/Code/CryEngine/CryCommon/IIndexedMesh.h +++ b/Code/CryEngine/CryCommon/IIndexedMesh.h @@ -22,7 +22,7 @@ #include #include // for AABB #include -#include <../RenderDll/Common/Shaders/Vertex.h> +#include #include // Description: diff --git a/Code/CryEngine/CryCommon/IShader.h b/Code/CryEngine/CryCommon/IShader.h index d284394904..1e8553ac57 100644 --- a/Code/CryEngine/CryCommon/IShader.h +++ b/Code/CryEngine/CryCommon/IShader.h @@ -26,7 +26,7 @@ #include "smartptr.h" #include // <> required for Interfuscator #include "VertexFormats.h" -#include +#include #include #include diff --git a/Code/CryEngine/CryCommon/Vertex.h b/Code/CryEngine/CryCommon/Vertex.h new file mode 100644 index 0000000000..44edd73903 --- /dev/null +++ b/Code/CryEngine/CryCommon/Vertex.h @@ -0,0 +1,1093 @@ +/* +* 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. +* +*/ +#pragma once +#include +#include +#include +namespace AZ +{ + namespace Vertex + { + const uint32_t VERTEX_BUFFER_ALIGNMENT = 4; + // This enum must only have 8 entries because only 3 bits are used to store usage. + enum class AttributeUsage : uint8 + { + Position, + Color, + Normal, + TexCoord, + Weights, + Indices, + Tangent, + BiTangent, + NumUsages + }; + + struct AttributeUsageData + { + AZStd::string friendlyName; + AZStd::string semanticName; + }; + + static AttributeUsageData AttributeUsageDataTable[(uint)AttributeUsage::NumUsages] = + { + // {friendlyName, semanticName} + { "Position", "POSITION" }, + { "Color", "COLOR" }, + { "Normal", "NORMAL" }, + { "TexCoord", "TEXCOORD" }, + { "Weights", "BLENDWEIGHT" }, + { "Indices", "BLENDINDICES" }, + { "Tangent", "TEXCOORD" }, + { "BiTangent", "TEXCOORD" } + }; + + // This enum must have 32 or less entries as 5 bits are used to store type. + enum class AttributeType : uint8 + { + Float16_1 = 0, + Float16_2, + Float16_4, + + Float32_1, + Float32_2, + Float32_3, + Float32_4, + + Byte_1, + Byte_2, + Byte_4, + + Short_1, + Short_2, + Short_4, + + UInt16_1, + UInt16_2, + UInt16_4, + + UInt32_1, + UInt32_2, + UInt32_3, + UInt32_4, + + NumTypes + }; + + struct AttributeTypeData + { + AZStd::string friendlyName; + uint8 byteSize; + }; + + static AttributeTypeData AttributeTypeDataTable[(unsigned int)AZ::Vertex::AttributeType::NumTypes] = + { + { "Float16_1", 2 }, + { "Float16_2", 4 }, + { "Float16_4", 8 }, + + { "Float32_1", 4 }, + { "Float32_2", 8 }, + { "Float32_3", 12 }, + { "Float32_4", 16 }, + + { "Byte_1", 1 }, + { "Byte_2", 2 }, + { "Byte_4", 4 }, + + { "Short_1", 2 }, + { "Short_2", 4 }, + { "Short_4", 8 }, + + { "UInt16_1", 2 }, + { "UInt16_2", 4 }, + { "UInt16_4", 8 }, + + { "UInt32_1", 4 }, + { "UInt32_2", 8 }, + { "UInt32_3", 12 }, + { "UInt32_4", 16 }, + }; + + //! Stores the usage, type, and byte length of an individual vertex attribute + class Attribute + { + public: + // Usage stored in the 3 lower bits and Type stored in the 5 upper bits. + static const uint8 kUsageBitCount = 3; + static const uint8 kUsageMask = 0x07; + static const uint8 kTypeMask = 0xf8; + static uint8 CreateAttribute(AttributeUsage usage, AttributeType type) + { + return (static_cast(type) << kUsageBitCount) | static_cast(usage); + } + static AttributeUsage GetUsage(const uint8 attribute) + { + return static_cast(attribute & kUsageMask); + } + static AttributeType GetType(const uint8 attribute) + { + return static_cast((attribute & kTypeMask) >> kUsageBitCount); + } + static uint8 GetByteLength(const uint8 attribute) + { + return AttributeTypeDataTable[(uint)GetType(attribute)].byteSize; + } + static const AZStd::string& GetSemanticName(uint8 attribute) + { + return AttributeUsageDataTable[(uint)GetUsage(attribute)].semanticName; + } + }; + + //! Flexible vertex format class + class Format + { + public: + Format(){}; + + + //! Conversion from old hard-coded EVertexFormat enum to new, flexible vertex class + Format(EVertexFormat format) + { + m_enum = eVF_Unknown; + m_numAttributes = 0; + switch (format) + { + case eVF_Unknown: + m_enum = eVF_Unknown; + break; + case eVF_P3F_C4B_T2F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + m_enum = eVF_P3F_C4B_T2F; + break; + case eVF_P3F_C4B_T2F_T2F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + m_enum = eVF_P3F_C4B_T2F_T2F; + break; + case eVF_P3S_C4B_T2S: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float16_4));// vec3f16 is backed by a CryHalf4 + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float16_2)); + m_enum = eVF_P3S_C4B_T2S; + break; + case eVF_P3S_C4B_T2S_T2S: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float16_4));// vec3f16 is backed by a CryHalf4 + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float16_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float16_2)); + m_enum = eVF_P3S_C4B_T2S_T2S; + break; + case eVF_P3S_N4B_C4B_T2S: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float16_4));// vec3f16 is backed by a CryHalf4 + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Normal, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float16_2)); + m_enum = eVF_P3S_N4B_C4B_T2S; + break; + case eVF_P3F_C4B_T4B_N3F2: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Tangent, AttributeType::Float32_3));//x-axis + AddAttribute(Attribute::CreateAttribute(AttributeUsage::BiTangent, AttributeType::Float32_3));//y-axis +#ifdef PARTICLE_MOTION_BLUR // Nonfunctional and disabled. + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));//prevPos + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Tangent, AttributeType::Float32_3));//prevXTan + AddAttribute(Attribute::CreateAttribute(AttributeUsage::BiTangent, AttributeType::Float32_3));//prevYTan +#endif + m_enum = eVF_P3F_C4B_T4B_N3F2;// Particles. + break; + case eVF_TP3F_C4B_T2F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + m_enum = eVF_TP3F_C4B_T2F;// Fonts (28 bytes). + break; + case eVF_TP3F_T2F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_TP3F_T2F_T3F; + break; + case eVF_P3F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_T3F; // Miscellaneus. + break; + case eVF_P3F_T2F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_T2F_T3F; + break; + // Additional streams + case eVF_T2F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + m_enum = eVF_T2F; // Light maps TC (8 bytes). + break; + case eVF_W4B_I4S:// Skinned weights/indices stream. + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Weights, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Indices, AttributeType::UInt16_4)); + m_enum = eVF_W4B_I4S; + break; + case eVF_C4B_C4B:// SH coefficients. + // We use the "Weights" usage since sh coefs use an unknown usage of 4 bytes. + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Weights, AttributeType::Byte_4)); //coef0 + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Weights, AttributeType::Byte_4)); //coef1 + m_enum = eVF_C4B_C4B; + break; + case eVF_P3F_P3F_I4B:// Shape deformation stream. + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); //thin + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); //fat + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Indices, AttributeType::Byte_4)); + m_enum = eVF_P3F_P3F_I4B; + break; + case eVF_P3F:// Velocity stream. + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + m_enum = eVF_P3F; + break; + case eVF_C4B_T2S: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float16_2)); + m_enum = eVF_C4B_T2S;// General (Position is merged with Tangent stream) + break; + case eVF_P2F_T4F_C4F: // Lens effects simulation + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + m_enum = eVF_P2F_T4F_C4F; + break; + case eVF_P2F_T4F_T4F_C4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + m_enum = eVF_P2F_T4F_T4F_C4F; + break; + case eVF_P2S_N4B_C4B_T1F:// terrain + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float16_2));// xy-coordinates in terrain + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Normal, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));// z-coordinate in terrain + m_enum = eVF_P2S_N4B_C4B_T1F; + break; + case eVF_P3F_C4B_T2S: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float16_2)); + m_enum = eVF_P3F_C4B_T2S; + break; + case eVF_P2F_C4B_T2F_F4B: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Indices, AttributeType::UInt16_2)); + m_enum = eVF_P2F_C4B_T2F_F4B; + break; + case eVF_P3F_C4B: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4)); + m_enum = eVF_P3F_C4B; + break; + case eVF_P3F_C4F_T2F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + m_enum = eVF_P3F_C4F_T2F; + break; + case eVF_P3F_C4F_T2F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_C4F_T2F_T3F; + break; + case eVF_P3F_C4F_T2F_T3F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_C4F_T2F_T3F_T3F; + break; + case eVF_P3F_C4F_T2F_T1F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + m_enum = eVF_P3F_C4F_T2F_T1F; + break; + case eVF_P3F_C4F_T2F_T1F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_C4F_T2F_T1F_T3F; + break; + case eVF_P3F_C4F_T2F_T1F_T3F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_C4F_T2F_T1F_T3F_T3F; + break; + case eVF_P3F_C4F_T4F_T2F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + m_enum = eVF_P3F_C4F_T4F_T2F; + break; + case eVF_P3F_C4F_T4F_T2F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_C4F_T4F_T2F_T3F; + break; + case eVF_P3F_C4F_T4F_T2F_T3F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_C4F_T4F_T2F_T3F_T3F; + break; + case eVF_P3F_C4F_T4F_T2F_T1F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + m_enum = eVF_P3F_C4F_T4F_T2F_T1F; + break; + case eVF_P3F_C4F_T4F_T2F_T1F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T3F; + break; + case eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T3F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T1F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F; + break; + case eVF_P4F_T2F_C4F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P4F_T2F_C4F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T4F; + break; + case eVF_P3F_C4F_T2F_T3F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T3F_T4F; + break; + case eVF_P3F_C4F_T2F_T3F_T3F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T3F_T3F_T4F; + break; + case eVF_P3F_C4F_T2F_T1F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T1F_T4F; + break; + case eVF_P3F_C4F_T2F_T1F_T3F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T1F_T3F_T4F; + break; + case eVF_P3F_C4F_T2F_T1F_T3F_T3F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T1F_T3F_T3F_T4F; + break; + case eVF_P3F_C4F_T4F_T2F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T4F_T2F_T4F; + break; + case eVF_P3F_C4F_T4F_T2F_T3F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T4F_T2F_T3F_T4F; + break; + case eVF_P3F_C4F_T4F_T2F_T3F_T3F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T4F_T2F_T3F_T3F_T4F; + break; + case eVF_P3F_C4F_T4F_T2F_T1F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T4F; + break; + case eVF_P3F_C4F_T4F_T2F_T1F_T3F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T3F_T4F; + break; + case eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F_T4F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T4F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T3F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T3F_T4F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F_T4F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T4F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T4F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F_T4F; + break; + case eVF_P4F_T2F_C4F_T4F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P4F_T2F_C4F_T4F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T3F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T3F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T3F_T3F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T3F_T3F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T1F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T1F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T1F_T3F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T1F_T3F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T1F_T3F_T3F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T1F_T3F_T3F_T4F_T4F; + break; + case eVF_P3F_C4F_T4F_T2F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T4F_T2F_T4F_T4F; + break; + case eVF_P3F_C4F_T4F_T2F_T3F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T4F_T2F_T3F_T4F_T4F; + break; + case eVF_P3F_C4F_T4F_T2F_T3F_T3F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T4F_T2F_T3F_T3F_T4F_T4F; + break; + case eVF_P3F_C4F_T4F_T2F_T1F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T4F_T4F; + break; + case eVF_P3F_C4F_T4F_T2F_T1F_T3F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T3F_T4F_T4F; + break; + case eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T3F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T3F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T4F_T4F; + break; + case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F_T4F_T4F; + break; + case eVF_P4F_T2F_C4F_T4F_T4F_T4F_T4F: + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4)); + m_enum = eVF_P4F_T2F_C4F_T4F_T4F_T4F_T4F; + break; + case eVF_Max: + default: + AZ_Error("VF", false, "Invalid vertex format"); + m_enum = eVF_Unknown; + } + CalculateStrideAndUsageCounts(); + } + + //! Get the equivalent old-style EVertexFormat enum + uint GetEnum() const { return m_enum; } + + static const uint8 kHas16BitFloatPosition = 0x4; + static const uint8 kHas16BitFloatTexCoords = 0x2; + static const uint8 kHas32BitFloatTexCoords = 0x1; + + + //! Helper function to check to see if the vertex format has a position attribute that uses 16 bit floats for the underlying type + bool Has16BitFloatPosition() const + { + return (m_flags & kHas16BitFloatPosition) != 0x0; + } + + //! Helper function to check to see if the vertex format has a texture coordinate attribute that uses 16 bit floats for the underlying type + bool Has16BitFloatTextureCoordinates() const + { + return (m_flags & kHas16BitFloatTexCoords) != 0x0; + } + + //! Helper function to check to see if the vertex format has a texture coordinate attribute that uses 32 bit floats for the underlying type + bool Has32BitFloatTextureCoordinates() const + { + return (m_flags & kHas32BitFloatTexCoords) != 0x0; + } + + + uint32 GetAttributeUsageCount(AttributeUsage usage) const + { + return (uint32)m_attributeUsageCounts[(uint)usage]; + } + + bool TryGetAttributeOffsetAndType(AttributeUsage usage, uint32 index, uint& outOffset, AttributeType& outType) const + { + outOffset = 0; + outType = AttributeType::NumTypes; + for (uint ii=0; ii < m_numAttributes; ++ii) + { + uint8 attribute = m_vertexAttributes[ii]; + if (Attribute::GetUsage(attribute) == usage) + { + if (index == 0) + { + outType = Attribute::GetType(attribute); + return true; + } + else + { + --index; + } + } + outOffset += Attribute::GetByteLength(attribute); + } + return false; + } + + uint8 GetAttributeByteLength(AttributeUsage usage) const + { + for (uint ii = 0; ii < m_numAttributes; ++ii) + { + uint8 attribute = m_vertexAttributes[ii]; + if (Attribute::GetUsage(attribute) == usage) + { + return Attribute::GetByteLength(attribute); + } + } + return 0; + } + + + const uint8* GetAttributes( uint32 &outCount) const + { + outCount = m_numAttributes; + return m_vertexAttributes; + } + + //! Return true if the vertex format is a superset of the input + bool IsSupersetOf(const AZ::Vertex::Format& input) const + { + uint32 count = 0; + const uint8* attributes = input.GetAttributes(count); + for ( uint8 ii=0; ii(const Format& other) const + { + return !(*this <= other); + } + bool operator>=(const Format& other) const + { + return (*this == other || *this > other); + } + private: + void AddAttribute(uint8 attribute) + { + AZ_Assert(m_numAttributes < kMaxAttributes, "Too many attributes added. Change the size of kMaxAttributes"); + m_vertexAttributes[m_numAttributes++] = attribute; + + // Update the flags. + AttributeUsage usage = Attribute::GetUsage(attribute); + AttributeType type = Attribute::GetType(attribute); + if (usage == AttributeUsage::TexCoord) + { + if (type == AttributeType::Float16_2) { + m_flags |= kHas16BitFloatTexCoords; + } + else if (type == AttributeType::Float32_2 || type == AttributeType::Float32_3 || type == AttributeType::Float32_4) { + m_flags |= kHas32BitFloatTexCoords; + } + } + else if (usage == AttributeUsage::Position && type == AttributeType::Float16_4) { + m_flags |= kHas16BitFloatPosition; + } + } + + //! Calculates the sum of the size in bytes of all attributes that make up this format + void CalculateStrideAndUsageCounts() + { + static_assert((uint32)AttributeUsage::NumUsages <= 8, "We use 3 bits to represent usage so we only support 8 usages for a vertex format attribute."); + static_assert((uint32)AttributeType::NumTypes <= 32, "We use 5 bits to represent type so we only support up to 32 types for a vertex format attribute."); + + for (uint index = 0; index < (uint)AttributeUsage::NumUsages; ++index) + { + m_attributeUsageCounts[index] = 0; + } + uint32 stride = 0; + for (uint ii = 0; ii < m_numAttributes; ++ii) + { + uint8 attribute = m_vertexAttributes[ii]; + stride += Attribute::GetByteLength(attribute); + m_attributeUsageCounts[(uint)Attribute::GetUsage(attribute)]++; + } + AZ_Assert(stride < (0x1 << (sizeof(m_stride) * 8)), "Vertex stride is larger than the maximum supported, update the type for m_stride in Vertex.h"); + + m_stride = stride; + } + + + +#ifdef PARTICLE_MOTION_BLUR + static const uint32_t kMaxAttributes = 8; +#else + static const uint32_t kMaxAttributes = 10; +#endif + uint8 m_vertexAttributes[kMaxAttributes] = { 0 }; + + uint8 m_attributeUsageCounts[(uint)AttributeUsage::NumUsages] = { 0 }; + uint8 m_numAttributes = 0; + uint8 m_enum = eVF_Unknown; + uint8 m_stride = 0; + uint8 m_flags = 0x0; + }; + + + // bNeedNormals=1 - float normals; bNeedNormals=2 - byte normals //waltont TODO (this was copied as is from vertexformats.h) this comment is out of date and the function does not even use all the parameters. This should be replaceable with the new vertex class, and should be replaced when refactoring CHWShader_D3D::mfVertexFormat which handles the shader parsing/serialization + _inline Format VertFormatForComponents([[maybe_unused]] bool bNeedCol, [[maybe_unused]] bool bHasTC, bool bHasTC2, bool bHasPS, bool bHasNormal) + { + AZ::Vertex::Format RequestedVertFormat; + + if (bHasPS) + { + RequestedVertFormat = AZ::Vertex::Format(eVF_P3F_C4B_T4B_N3F2); + } + else + if (bHasNormal) + { + RequestedVertFormat = AZ::Vertex::Format(eVF_P3S_N4B_C4B_T2S); + } + else + { + if (!bHasTC2) + { + RequestedVertFormat = AZ::Vertex::Format(eVF_P3S_C4B_T2S); + } + else + { + RequestedVertFormat = AZ::Vertex::Format(eVF_P3F_C4B_T2F_T2F); + } + } + + return RequestedVertFormat; + } + } +} diff --git a/Code/CryEngine/CrySystem/CMakeLists.txt b/Code/CryEngine/CrySystem/CMakeLists.txt index 32ddc4a3a5..e7816cc1cd 100644 --- a/Code/CryEngine/CrySystem/CMakeLists.txt +++ b/Code/CryEngine/CrySystem/CMakeLists.txt @@ -60,8 +60,6 @@ ly_add_target( Legacy::CrySystem.XMLBinary Legacy::RemoteConsoleCore AZ::AzFramework - RUNTIME_DEPENDENCIES - Legacy::Cry3DEngine ) ly_add_source_properties( diff --git a/Code/CryEngine/CrySystem/Platform/Mac/platform_mac.cmake b/Code/CryEngine/CrySystem/Platform/Mac/platform_mac.cmake index 6c55ad5b08..bafe20e506 100644 --- a/Code/CryEngine/CrySystem/Platform/Mac/platform_mac.cmake +++ b/Code/CryEngine/CrySystem/Platform/Mac/platform_mac.cmake @@ -14,14 +14,3 @@ # NOTE: functions in cmake are global, therefore adding functions to this file # is being avoided to prevent overriding functions declared in other targets platfrom # specific cmake files - -if (LY_MONOLITHIC_GAME) # Only Atom is supported in monolithic builds - set(LY_BUILD_DEPENDENCIES - PUBLIC - Legacy::CryRenderOther - ) -else() - set(LY_RUNTIME_DEPENDENCIES - Legacy::CryRenderMetal - ) -endif() diff --git a/Code/CryEngine/CrySystem/SystemRender.cpp b/Code/CryEngine/CrySystem/SystemRender.cpp index 01828175db..a544cef4a5 100644 --- a/Code/CryEngine/CrySystem/SystemRender.cpp +++ b/Code/CryEngine/CrySystem/SystemRender.cpp @@ -58,75 +58,6 @@ extern CMTSafeHeap* g_pPakHeap; #if defined(AZ_PLATFORM_ANDROID) #include -#elif defined(AZ_PLATFORM_IOS) - -#if defined(AZ_MONOLITHIC_BUILD) -extern bool UIKitGetPrimaryPhysicalDisplayDimensions(int& o_widthPixels, int& o_heightPixels); -#else - -using NativeScreenType = UIScreen; -using NativeWindowType = UIWindow; - -//////////////////////////////////////////////////////////////////////////////// -bool UIKitGetPrimaryPhysicalDisplayDimensions(int& o_widthPixels, int& o_heightPixels) -{ - - NativeScreenType* nativeScreen = [NativeScreenType mainScreen]; - CGRect screenBounds = [nativeScreen bounds]; - CGFloat screenScale = [nativeScreen scale]; - o_widthPixels = static_cast(screenBounds.size.width * screenScale); - o_heightPixels = static_cast(screenBounds.size.height * screenScale); - - const bool isScreenLandscape = o_widthPixels > o_heightPixels; - - UIInterfaceOrientation uiOrientation = UIInterfaceOrientationUnknown; -#if defined(__IPHONE_13_0) || defined(__TVOS_13_0) - if(@available(iOS 13.0, tvOS 13.0, *)) - { - UIWindow* foundWindow = nil; - - //Find the key window - NSArray* windows = [[UIApplication sharedApplication] windows]; - for (UIWindow* window in windows) - { - if (window.isKeyWindow) - { - foundWindow = window; - break; - } - } - - //Check if the key window is found - if(foundWindow) - { - uiOrientation = foundWindow.windowScene.interfaceOrientation; - } - else - { - //If no key window is found create a temporary window in order to extract the orientation - //This can happen as this function gets called before the renderer is initialized - CGRect screenBounds = [[NativeScreenType mainScreen] bounds]; - UIWindow* tempWindow = [[NativeWindowType alloc] initWithFrame: screenBounds]; - uiOrientation = tempWindow.windowScene.interfaceOrientation; - [tempWindow release]; - } - } -#else - uiOrientation = UIApplication.sharedApplication.statusBarOrientation; -#endif - - const bool isInterfaceLandscape = UIInterfaceOrientationIsLandscape(uiOrientation); - if (isScreenLandscape != isInterfaceLandscape) - { - const int width = o_widthPixels; - o_widthPixels = o_heightPixels; - o_heightPixels = width; - } - - return true; -} -#endif - #endif extern int CryMemoryGetAllocatedSize(); @@ -151,8 +82,6 @@ bool CSystem::GetPrimaryPhysicalDisplayDimensions([[maybe_unused]] int& o_widthP return true; #elif defined(AZ_PLATFORM_ANDROID) return AZ::Android::Utils::GetWindowSize(o_widthPixels, o_heightPixels); -#elif defined(AZ_PLATFORM_IOS) - return UIKitGetPrimaryPhysicalDisplayDimensions(o_widthPixels, o_heightPixels); #else return false; #endif diff --git a/Code/LauncherUnified/Platform/Android/launcher_project_android.cmake b/Code/LauncherUnified/Platform/Android/launcher_project_android.cmake index 2865e9c43d..4d5680a30d 100644 --- a/Code/LauncherUnified/Platform/Android/launcher_project_android.cmake +++ b/Code/LauncherUnified/Platform/Android/launcher_project_android.cmake @@ -8,11 +8,3 @@ # 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. # - -if(LY_MONOLITHIC_GAME) # only Atom is supported in monolithic - list(APPEND LY_BUILD_DEPENDENCIES Legacy::CryRenderOther) -else() - set(LY_RUNTIME_DEPENDENCIES - Legacy::CryRenderGL - ) -endif() diff --git a/Code/LauncherUnified/Platform/Linux/launcher_project_linux.cmake b/Code/LauncherUnified/Platform/Linux/launcher_project_linux.cmake index 28eb9595c2..4d5680a30d 100644 --- a/Code/LauncherUnified/Platform/Linux/launcher_project_linux.cmake +++ b/Code/LauncherUnified/Platform/Linux/launcher_project_linux.cmake @@ -8,15 +8,3 @@ # 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. # - -if (LY_MONOLITHIC_GAME) # only Atom is supported in monolithic - set(LY_BUILD_DEPENDENCIES - PUBLIC - Legacy::CryRenderOther - ) -else() - set(LY_BUILD_DEPENDENCIES - PRIVATE - Legacy::CryRenderGL - ) -endif() diff --git a/Code/LauncherUnified/Platform/Mac/launcher_project_mac.cmake b/Code/LauncherUnified/Platform/Mac/launcher_project_mac.cmake index 8d55ae93b0..52513820de 100644 --- a/Code/LauncherUnified/Platform/Mac/launcher_project_mac.cmake +++ b/Code/LauncherUnified/Platform/Mac/launcher_project_mac.cmake @@ -13,12 +13,6 @@ set(LY_TARGET_PROPERTIES BUILD_RPATH @executable_path/ ) -if(LY_MONOLITHIC_GAME) # only Atom is supported in monolithic builds - list(APPEND LY_BUILD_DEPENDENCIES Legacy::CryRenderOther) -else() - set(LY_RUNTIME_DEPENDENCIES Legacy::CryRenderMetal) -endif() - # Add resources and app icons to launchers list(APPEND candidate_paths ${project_real_path}/Resources/Platform/Mac) list(APPEND candidate_paths ${project_real_path}/Gem/Resources/Platform/Mac) # Legacy projects diff --git a/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake b/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake index 4b5805908e..bcef59ec5a 100644 --- a/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake +++ b/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake @@ -9,11 +9,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -set(LY_BUILD_DEPENDENCIES - PRIVATE - Legacy::CryRenderD3D11 -) - set(ICON_FILE ${project_real_path}/Gem/Resources/GameSDK.ico) if(NOT EXISTS ${ICON_FILE}) # Try the common LauncherUnified icon instead diff --git a/Code/LauncherUnified/Platform/iOS/launcher_project_ios.cmake b/Code/LauncherUnified/Platform/iOS/launcher_project_ios.cmake index e846af494e..36fa19d0d1 100644 --- a/Code/LauncherUnified/Platform/iOS/launcher_project_ios.cmake +++ b/Code/LauncherUnified/Platform/iOS/launcher_project_ios.cmake @@ -14,13 +14,6 @@ set(LY_LINK_OPTIONS -ObjC ) -if(LY_MONOLITHIC_GAME) # only Atom is supported in monolithic - list(APPEND LY_BUILD_DEPENDENCIES Legacy::CryRenderOther) -else() - list(APPEND LY_BUILD_DEPENDENCIES CrySystem.Static) - set(LY_RUNTIME_DEPENDENCIES Legacy::CryRenderMetal) -endif() - # Add resources and app icons to launchers list(APPEND candidate_paths ${project_real_path}/Resources/Platform/iOS) list(APPEND candidate_paths ${project_real_path}/Gem/Resources/Platform/iOS) # Legacy projects diff --git a/Code/LauncherUnified/launcher_generator.cmake b/Code/LauncherUnified/launcher_generator.cmake index ca17a58eee..08ddd538fc 100644 --- a/Code/LauncherUnified/launcher_generator.cmake +++ b/Code/LauncherUnified/launcher_generator.cmake @@ -67,7 +67,6 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC ${game_gem_dependencies} Legacy::CrySystem Legacy::CryFont - Legacy::Cry3DEngine ) if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) @@ -97,7 +96,6 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC ${game_gem_dependencies} Legacy::CrySystem Legacy::CryFont - Legacy::Cry3DEngine ) endif() @@ -106,13 +104,7 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC set(game_runtime_dependencies Legacy::CrySystem Legacy::CryFont - Legacy::Cry3DEngine ) - if(PAL_TRAIT_BUILD_SERVER_SUPPORTED AND NOT LY_MONOLITHIC_GAME) # Only Atom is supported in monolithic builds - set(server_runtime_dependencies - Legacy::CryRenderNULL - ) - endif() endif() diff --git a/Code/Sandbox/Editor/CustomResolutionDlg.cpp b/Code/Sandbox/Editor/CustomResolutionDlg.cpp index 44513e68ce..895715ff46 100644 --- a/Code/Sandbox/Editor/CustomResolutionDlg.cpp +++ b/Code/Sandbox/Editor/CustomResolutionDlg.cpp @@ -27,6 +27,7 @@ AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING #define MIN_RES 64 +#define MAX_RES 8192 CCustomResolutionDlg::CCustomResolutionDlg(int w, int h, QWidget* pParent /*=NULL*/) : QDialog(pParent) @@ -46,18 +47,17 @@ CCustomResolutionDlg::~CCustomResolutionDlg() void CCustomResolutionDlg::OnInitDialog() { - int maxRes = GetIEditor()->GetRenderer()->GetMaxSquareRasterDimension(); - m_ui->m_width->setRange(MIN_RES, maxRes); + m_ui->m_width->setRange(MIN_RES, MAX_RES); m_ui->m_width->setValue(m_wDefault); - m_ui->m_height->setRange(MIN_RES, maxRes); + m_ui->m_height->setRange(MIN_RES, MAX_RES); m_ui->m_height->setValue(m_hDefault); QString maxDimensionString; QTextStream(&maxDimensionString) - << "Maximum Dimension: " << maxRes << Qt::endl + << "Maximum Dimension: " << MAX_RES << Qt::endl << Qt::endl - << "Note: Dimensions over 4K may be" << Qt::endl + << "Note: Dimensions over 8K may be" << Qt::endl << "unstable depending on hardware."; m_ui->m_maxDimension->setText(maxDimensionString); diff --git a/Code/Sandbox/Editor/EnvironmentPanel.cpp b/Code/Sandbox/Editor/EnvironmentPanel.cpp index 02b568f6d2..f71babbff6 100644 --- a/Code/Sandbox/Editor/EnvironmentPanel.cpp +++ b/Code/Sandbox/Editor/EnvironmentPanel.cpp @@ -19,10 +19,6 @@ #include "GameEngine.h" #include "CryEditDoc.h" -// Cry3DEngine -#include - - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING #include AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING @@ -36,15 +32,6 @@ CEnvironmentPanel::CEnvironmentPanel(QWidget* pParent /*=nullptr*/) { XmlNodeRef node = GetIEditor()->GetDocument()->GetEnvironmentTemplate(); - // is the feature toggle enabled? - bool bHasOceanFeature = false; - AZ::OceanFeatureToggleBus::BroadcastResult(bHasOceanFeature, &AZ::OceanFeatureToggleBus::Events::OceanComponentEnabled); - if (bHasOceanFeature) - { - node->findChild("Ocean")->setAttr("hidden", true); - node->findChild("OceanAnimation")->setAttr("hidden", true); - } - m_onSetCallback = AZStd::bind(&CCryEditDoc::OnEnvironmentPropertyChanged, GetIEditor()->GetDocument(), AZStd::placeholders::_1); ui->setupUi(this); diff --git a/Code/Sandbox/Editor/Platform/Windows/editor_windows.cmake b/Code/Sandbox/Editor/Platform/Windows/editor_windows.cmake index 4058c1d466..4d5680a30d 100644 --- a/Code/Sandbox/Editor/Platform/Windows/editor_windows.cmake +++ b/Code/Sandbox/Editor/Platform/Windows/editor_windows.cmake @@ -8,8 +8,3 @@ # 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. # - -set(LY_BUILD_DEPENDENCIES - PRIVATE - Legacy::CryRenderNULL -) \ No newline at end of file diff --git a/Code/Sandbox/Editor/RenderViewport.cpp b/Code/Sandbox/Editor/RenderViewport.cpp index af4cbd46bc..bac0ba752c 100644 --- a/Code/Sandbox/Editor/RenderViewport.cpp +++ b/Code/Sandbox/Editor/RenderViewport.cpp @@ -275,8 +275,6 @@ void CRenderViewport::resizeEvent(QResizeEvent* event) gEnv->pSystem->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_RESIZE, width(), height()); - gEnv->pRenderer->EF_DisableTemporalEffects(); - if (AZ::Interface::Get()) { // We queue the window resize event because the render overlay may be hidden. diff --git a/Code/Sandbox/Editor/TimeOfDayDialog.cpp b/Code/Sandbox/Editor/TimeOfDayDialog.cpp index 8fe368b8fb..80aa4d5172 100644 --- a/Code/Sandbox/Editor/TimeOfDayDialog.cpp +++ b/Code/Sandbox/Editor/TimeOfDayDialog.cpp @@ -34,9 +34,6 @@ #include "Undo/Undo.h" #include "LyViewPaneNames.h" -// Cry3DEngine -#include - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING #include AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING @@ -69,14 +66,6 @@ namespace TimeOfDayDetails return static_cast(time.msecsSinceStartOfDay() / 60000) / 60.0; } - // Is the ocean component feature toggle enabled? - AZ_INLINE static bool HasOceanFeatureToggle() - { - bool bHasOceanFeature = false; - AZ::OceanFeatureToggleBus::BroadcastResult(bHasOceanFeature, &AZ::OceanFeatureToggleBus::Events::OceanComponentEnabled); - return bHasOceanFeature; - } - AZ_INLINE static bool SkipUserInterface(int value) { // Check for obsolete parameters that we still want to keep around to migrate legacy data to new data @@ -89,13 +78,6 @@ namespace TimeOfDayDetails (enumValue == ITimeOfDay::PARAM_TERRAIN_OCCL_MULTIPLIER) || (enumValue == ITimeOfDay::PARAM_SUN_COLOR_MULTIPLIER); - // Only check the ocean parameters if the ocean feature (aka the Infinite Ocean Component) - // has been enabled - skipParameter |= HasOceanFeatureToggle() && - ((enumValue == ITimeOfDay::PARAM_OCEANFOG_COLOR) || - (enumValue == ITimeOfDay::PARAM_OCEANFOG_COLOR_MULTIPLIER) || - (enumValue == ITimeOfDay::PARAM_OCEANFOG_DENSITY)); - return skipParameter; } } diff --git a/Code/Sandbox/Plugins/EditorCommon/Cry_LegacyPhysUtils.h b/Code/Sandbox/Plugins/EditorCommon/Cry_LegacyPhysUtils.h new file mode 100644 index 0000000000..cb7b971267 --- /dev/null +++ b/Code/Sandbox/Plugins/EditorCommon/Cry_LegacyPhysUtils.h @@ -0,0 +1,704 @@ +/* +* 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. +* +*/ + +// Copied utils functions from CryPhysics that are used by non-physics systems +// This functions will be eventually removed, DO *NOT* use these functions +// TO-DO: Re-implement users using new code +// LY-109806 + +#pragma once + +#include "Cry_Math.h" + +namespace LegacyCryPhysicsUtils +{ + namespace polynomial_tpl_IMPL + { + template + class polynomial_tpl + { + public: + explicit polynomial_tpl() { denom = (ftype)1; }; + explicit polynomial_tpl(ftype op) { zero(); data[degree] = op; } + AZ_FORCE_INLINE polynomial_tpl& zero() + { + for (int i = 0; i <= degree; i++) + { + data[i] = 0; + } + denom = (ftype)1; + return *this; + } + polynomial_tpl(const polynomial_tpl& src) { *this = src; } + polynomial_tpl& operator=(const polynomial_tpl& src) + { + denom = src.denom; + for (int i = 0; i <= degree; i++) + { + data[i] = src.data[i]; + } + return *this; + } + template + AZ_FORCE_INLINE polynomial_tpl& operator=(const polynomial_tpl& src) + { + int i; + denom = src.denom; + for (i = 0; i <= min(degree, degree1); i++) + { + data[i] = src.data[i]; + } + for (; i < degree; i++) + { + data[i] = 0; + } + return *this; + } + AZ_FORCE_INLINE polynomial_tpl& set(ftype* pdata) + { + for (int i = 0; i <= degree; i++) + { + data[degree - i] = pdata[i]; + } + return *this; + } + + AZ_FORCE_INLINE ftype& operator[](int idx) { return data[idx]; } + + void calc_deriviative(polynomial_tpl& deriv, int curdegree = degree) const; + + AZ_FORCE_INLINE polynomial_tpl& fixsign() + { + ftype sg = sgnnz(denom); + denom *= sg; + for (int i = 0; i <= degree; i++) + { + data[i] *= sg; + } + return *this; + } + + int findroots(ftype start, ftype end, ftype* proots, int nIters = 20, int curdegree = degree, bool noDegreeCheck = false) const; + int nroots(ftype start, ftype end) const; + + AZ_FORCE_INLINE ftype eval(ftype x) const + { + ftype res = 0; + for (int i = degree; i >= 0; i--) + { + res = res * x + data[i]; + } + return res; + } + AZ_FORCE_INLINE ftype eval(ftype x, int subdegree) const + { + ftype res = data[subdegree]; + for (int i = subdegree - 1; i >= 0; i--) + { + res = res * x + data[i]; + } + return res; + } + + AZ_FORCE_INLINE polynomial_tpl& operator+=(ftype op) { data[0] += op * denom; return *this; } + AZ_FORCE_INLINE polynomial_tpl& operator-=(ftype op) { data[0] -= op * denom; return *this; } + AZ_FORCE_INLINE polynomial_tpl operator*(ftype op) const + { + polynomial_tpl res; + res.denom = denom; + for (int i = 0; i <= degree; i++) + { + res.data[i] = data[i] * op; + } + return res; + } + AZ_FORCE_INLINE polynomial_tpl& operator*=(ftype op) + { + for (int i = 0; i <= degree; i++) + { + data[i] *= op; + } + return *this; + } + AZ_FORCE_INLINE polynomial_tpl operator/(ftype op) const + { + polynomial_tpl res = *this; + res.denom = denom * op; + return res; + } + AZ_FORCE_INLINE polynomial_tpl& operator/=(ftype op) { denom *= op; return *this; } + + AZ_FORCE_INLINE polynomial_tpl sqr() const { return *this * *this; } + + ftype denom; + ftype data[degree + 1]; + }; + + template + struct tagPolyE + { + inline static ftype polye() { return (ftype)1E-10; } + }; + + template<> + inline float tagPolyE::polye() { return 1e-6f; } + + template + inline ftype polye() { return tagPolyE::polye(); } + + // Don't use this macro; use AZStd::max instead. This is only here to make the template const arguments below readable + // and because Visual Studio 2013 doesn't have a const_expr version of std::max + #define deprecated_degmax(degree1, degree2) (((degree1) > (degree2)) ? (degree1) : (degree2)) + + template + AZ_FORCE_INLINE polynomial_tpl operator+(const polynomial_tpl& pn, ftype op) + { + polynomial_tpl res = pn; + res.data[0] += op * res.denom; + return res; + } + template + AZ_FORCE_INLINE polynomial_tpl operator-(const polynomial_tpl& pn, ftype op) + { + polynomial_tpl res = pn; + res.data[0] -= op * res.denom; + return res; + } + + template + AZ_FORCE_INLINE polynomial_tpl operator+(ftype op, const polynomial_tpl& pn) + { + polynomial_tpl res = pn; + res.data[0] += op * res.denom; + return res; + } + template + AZ_FORCE_INLINE polynomial_tpl operator-(ftype op, const polynomial_tpl& pn) + { + polynomial_tpl res = pn; + res.data[0] -= op * res.denom; + for (int i = 0; i <= degree; i++) + { + res.data[i] = -res.data[i]; + } + return res; + } + template + polynomial_tpl AZ_FORCE_INLINE psqr(const polynomial_tpl& op) { return op * op; } + + template + AZ_FORCE_INLINE polynomial_tpl operator+(const polynomial_tpl& op1, const polynomial_tpl& op2) + { + polynomial_tpl res; + int i; + for (i = 0; i <= min(degree1, degree2); i++) + { + res.data[i] = op1.data[i] * op2.denom + op2.data[i] * op1.denom; + } + for (; i <= degree1; i++) + { + res.data[i] = op1.data[i] * op2.denom; + } + for (; i <= degree2; i++) + { + res.data[i] = op2.data[i] * op1.denom; + } + res.denom = op1.denom * op2.denom; + return res; + } + template + AZ_FORCE_INLINE polynomial_tpl operator-(const polynomial_tpl& op1, const polynomial_tpl& op2) + { + polynomial_tpl res; + int i; + for (i = 0; i <= min(degree1, degree2); i++) + { + res.data[i] = op1.data[i] * op2.denom - op2.data[i] * op1.denom; + } + for (; i <= degree1; i++) + { + res.data[i] = op1.data[i] * op2.denom; + } + for (; i <= degree2; i++) + { + res.data[i] = op2.data[i] * op1.denom; + } + res.denom = op1.denom * op2.denom; + return res; + } + + template + AZ_FORCE_INLINE polynomial_tpl& operator+=(polynomial_tpl& op1, const polynomial_tpl& op2) + { + for (int i = 0; i < min(degree1, degree2); i++) + { + op1.data[i] = op1.data[i] * op2.denom + op2.data[i] * op1.denom; + } + op1.denom *= op2.denom; + return op1; + } + template + AZ_FORCE_INLINE polynomial_tpl& operator-=(polynomial_tpl& op1, const polynomial_tpl& op2) + { + for (int i = 0; i < min(degree1, degree2); i++) + { + op1.data[i] = op1.data[i] * op2.denom - op2.data[i] * op1.denom; + } + op1.denom *= op2.denom; + return op1; + } + + template + AZ_FORCE_INLINE polynomial_tpl operator*(const polynomial_tpl& op1, const polynomial_tpl& op2) + { + polynomial_tpl res; + res.zero(); + int j; + switch (degree1) + { + case 8: + for (j = 0; j <= degree2; j++) + { + res.data[8 + j] += op1.data[8] * op2.data[j]; + } + case 7: + for (j = 0; j <= degree2; j++) + { + res.data[7 + j] += op1.data[7] * op2.data[j]; + } + case 6: + for (j = 0; j <= degree2; j++) + { + res.data[6 + j] += op1.data[6] * op2.data[j]; + } + case 5: + for (j = 0; j <= degree2; j++) + { + res.data[5 + j] += op1.data[5] * op2.data[j]; + } + case 4: + for (j = 0; j <= degree2; j++) + { + res.data[4 + j] += op1.data[4] * op2.data[j]; + } + case 3: + for (j = 0; j <= degree2; j++) + { + res.data[3 + j] += op1.data[3] * op2.data[j]; + } + case 2: + for (j = 0; j <= degree2; j++) + { + res.data[2 + j] += op1.data[2] * op2.data[j]; + } + case 1: + for (j = 0; j <= degree2; j++) + { + res.data[1 + j] += op1.data[1] * op2.data[j]; + } + case 0: + for (j = 0; j <= degree2; j++) + { + res.data[0 + j] += op1.data[0] * op2.data[j]; + } + } + res.denom = op1.denom * op2.denom; + return res; + } + + + template + AZ_FORCE_INLINE void polynomial_divide(const polynomial_tpl& num, const polynomial_tpl& den, polynomial_tpl& quot, + polynomial_tpl& rem, int degree1, int degree2) + { + int i, j, k, l; + ftype maxel; + for (i = 0; i <= degree1; i++) + { + rem.data[i] = num.data[i]; + } + for (i = 0; i <= degree1 - degree2; i++) + { + quot.data[i] = 0; + } + for (i = 1, maxel = fabs_tpl(num.data[0]); i <= degree1; i++) + { + maxel = max(maxel, num.data[i]); + } + for (maxel *= polye(); degree1 >= 0 && fabs_tpl(num.data[degree1]) < maxel; degree1--) + { + ; + } + for (i = 1, maxel = fabs_tpl(den.data[0]); i <= degree2; i++) + { + maxel = max(maxel, den.data[i]); + } + for (maxel *= polye(); degree2 >= 0 && fabs_tpl(den.data[degree2]) < maxel; degree2--) + { + ; + } + rem.denom = num.denom; + quot.denom = (ftype)1; + if (degree1 < 0 || degree2 < 0) + { + return; + } + + for (k = degree1 - degree2, l = degree1; l >= degree2; l--, k--) + { + quot.data[k] = rem.data[l] * den.denom; + quot.denom *= den.data[degree2]; + for (i = degree1 - degree2; i > k; i--) + { + quot.data[i] *= den.data[degree2]; + } + for (i = degree2 - 1, j = l - 1; i >= 0; i--, j--) + { + rem.data[j] = rem.data[j] * den.data[degree2] - den.data[i] * rem.data[l]; + } + for (; j >= 0; j--) + { + rem.data[j] *= den.data[degree2]; + } + rem.denom *= den.data[degree2]; + } + } + + template + AZ_FORCE_INLINE polynomial_tpl operator/(const polynomial_tpl& num, const polynomial_tpl& den) + { + polynomial_tpl quot; + polynomial_tpl rem; + polynomial_divide((polynomial_tpl&)num, (polynomial_tpl&)den, (polynomial_tpl&)quot, + (polynomial_tpl&)rem, degree1, degree2); + return quot; + } + template + AZ_FORCE_INLINE polynomial_tpl operator%(const polynomial_tpl& num, const polynomial_tpl& den) + { + polynomial_tpl quot; + polynomial_tpl rem; + polynomial_divide((polynomial_tpl&)num, (polynomial_tpl&)den, (polynomial_tpl&)quot, + (polynomial_tpl&)rem, degree1, degree2); + return (polynomial_tpl&)rem; + } + + template + AZ_FORCE_INLINE void polynomial_tpl::calc_deriviative(polynomial_tpl& deriv, int curdegree) const + { + for (int i = 0; i < curdegree; i++) + { + deriv.data[i] = data[i + 1] * (i + 1); + } + deriv.denom = denom; + } + + template + to_t* convert_type(from_t* input) + { + typedef union + { + to_t* to; + from_t* from; + } convert_union; + convert_union u; + u.from = input; + return u.to; + } + + template + AZ_FORCE_INLINE int polynomial_tpl::nroots(ftype start, ftype end) const + { + polynomial_tpl f[degree + 1]; + int i, j, sg_a, sg_b; + ftype val, prevval; + + calc_deriviative(f[0]); + polynomial_divide(*convert_type >(this), *convert_type< polynomial_tpl >(&f[0]), *convert_type >(&f[degree]), + *convert_type >(&f[1]), degree, degree - 1); + f[1].denom = -f[1].denom; + for (i = 2; i < degree; i++) + { + polynomial_divide(*convert_type >(&f[i - 2]), *convert_type >(&f[i - 1]), *convert_type >(&f[degree]), + *convert_type >(&f[i]), degree + 1 - i, degree - i); + f[i].denom = -f[i].denom; + if (fabs_tpl(f[i].denom) > (ftype)1E10) + { + for (j = 0; j <= degree - 1 - i; j++) + { + f[i].data[j] *= (ftype)1E-10; + } + f[i].denom *= (ftype)1E-10; + } + } + + prevval = eval(start) * denom; + for (i = sg_a = 0; i < degree; i++, prevval = val) + { + val = f[i].eval(start, degree - 1 - i) * f[i].denom; + sg_a += isneg(val * prevval); + } + + prevval = eval(end) * denom; + for (i = sg_b = 0; i < degree; i++, prevval = val) + { + val = f[i].eval(end, degree - 1 - i) * f[i].denom; + sg_b += isneg(val * prevval); + } + + return fabs_tpl(sg_a - sg_b); + } + + template + AZ_FORCE_INLINE ftype cubert_tpl(ftype x) { return fabs_tpl(x) > (ftype)1E-20 ? exp_tpl(log_tpl(fabs_tpl(x)) * (ftype)(1.0 / 3)) * sgnnz(x) : x; } + template + AZ_FORCE_INLINE ftype pow_tpl(ftype x, ftype pow) { return fabs_tpl(x) > (ftype)1E-20 ? exp_tpl(log_tpl(fabs_tpl(x)) * pow) * sgnnz(x) : x; } + template + AZ_FORCE_INLINE void swap(ftype* ptr, int i, int j) { ftype t = ptr[i]; ptr[i] = ptr[j]; ptr[j] = t; } + + template + int polynomial_tpl::findroots(ftype start, ftype end, ftype* proots, [[maybe_unused]] int nIters, int degree, bool noDegreeCheck) const + { + AZ_UNUSED(nIters); + int i, j, nRoots = 0; + ftype maxel; + if (!noDegreeCheck) + { + for (i = 1, maxel = fabs_tpl(data[0]); i <= degree; i++) + { + maxel = max(maxel, data[i]); + } + for (maxel *= polye(); degree > 0 && fabs_tpl(data[degree]) <= maxel; degree--) + { + ; + } + } + + if constexpr (maxdegree >= 1) + { + if (degree == 1) + { + proots[0] = data[0] / data[1]; + nRoots = 1; + } + } + + if constexpr (maxdegree >= 2) + { + if (degree == 2) + { + ftype a, b, c, d, bound[2], sg; + + a = data[2]; + b = data[1]; + c = data[0]; + d = aznumeric_cast(sgnnz(a)); + a *= d; + b *= d; + c *= d; + d = b * b - a * c * 4; + bound[0] = start * a * 2 + b; + bound[1] = end * a * 2 + b; + sg = aznumeric_cast((sgnnz(bound[0] * bound[1]) + 1) >> 1); + bound[0] *= bound[0]; + bound[1] *= bound[1]; + bound[isneg(fabs_tpl(bound[1]) - fabs_tpl(bound[0]))] *= sg; + + if (isnonneg(d) & inrange(d, bound[0], bound[1])) + { + d = sqrt_tpl(d); + a = (ftype)0.5 / a; + proots[nRoots] = (-b - d) * a; + nRoots += inrange(proots[nRoots], start, end); + proots[nRoots] = (-b + d) * a; + nRoots += inrange(proots[nRoots], start, end); + } + } + } + + if constexpr (maxdegree >= 3) + { + if (degree == 3) + { + ftype t, a, b, c, a3, p, q, Q, Qr, Ar, Ai, phi; + + t = (ftype)1.0 / data[3]; + a = data[2] * t; + b = data[1] * t; + c = data[0] * t; + a3 = a * (ftype)(1.0 / 3); + p = b - a * a3; + q = (a3 * b - c) * (ftype)0.5 - cube(a3); + Q = cube(p * (ftype)(1.0 / 3)) + q * q; + Qr = sqrt_tpl(fabs_tpl(Q)); + + if (Q > 0) + { + proots[0] = cubert_tpl(q + Qr) + cubert_tpl(q - Qr) - a3; + nRoots = 1; + } + else + { + phi = atan2_tpl(Qr, q) * (ftype)(1.0 / 3); + t = pow_tpl(Qr * Qr + q * q, (ftype)(1.0 / 6)); + Ar = t * cos_tpl(phi); + Ai = t * sin_tpl(phi); + proots[0] = 2 * Ar - a3; + proots[1] = aznumeric_cast(-Ar + Ai * sqrt3 - a3); + proots[2] = aznumeric_cast(-Ar - Ai * sqrt3 - a3); + i = idxmax3(proots); + swap(proots, i, 2); + i = isneg(proots[0] - proots[1]); + swap(proots, i, 1); + nRoots = 3; + } + } + } + + if constexpr (maxdegree >= 4) + { + if (degree == 4) + { + ftype t, a3, a2, a1, a0, y, R, D, E, subroots[3]; + const ftype e = (ftype)1E-9; + + t = (ftype)1.0 / data[4]; + a3 = data[3] * t; + a2 = data[2] * t; + a1 = data[1] * t; + a0 = data[0] * t; + polynomial_tpl p3aux; + ftype kp3aux[] = { 1, -a2, a1 * a3 - 4 * a0, 4 * a2 * a0 - a1 * a1 - a3 * a3 * a0 }; + p3aux.set(kp3aux); + if (!p3aux.findroots((ftype)-1E20, (ftype)1E20, subroots)) + { + return 0; + } + R = a3 * a3 * (ftype)0.25 - a2 + (y = subroots[0]); + + if (R > -e) + { + if (R < e) + { + D = E = a3 * a3 * (ftype)(3.0 / 4) - 2 * a2; + t = y * y - 4 * a0; + if (t < -e) + { + return 0; + } + t = 2 * sqrt_tpl(max((ftype)0, t)); + } + else + { + R = sqrt_tpl(max((ftype)0, R)); + D = E = a3 * a3 * (ftype)(3.0 / 4) - R * R - 2 * a2; + t = (4 * a3 * a2 - 8 * a1 - a3 * a3 * a3) / R * (ftype)0.25; + } + if (D + t > -e) + { + D = sqrt_tpl(max((ftype)0, D + t)); + proots[nRoots++] = a3 * (ftype)-0.25 + (R - D) * (ftype)0.5; + proots[nRoots++] = a3 * (ftype)-0.25 + (R + D) * (ftype)0.5; + } + if (E - t > -e) + { + E = sqrt_tpl(max((ftype)0, E - t)); + proots[nRoots++] = a3 * (ftype)-0.25 - (R + E) * (ftype)0.5; + proots[nRoots++] = a3 * (ftype)-0.25 - (R - E) * (ftype)0.5; + } + if (nRoots == 4) + { + i = idxmax3(proots); + if (proots[3] < proots[i]) + { + swap(proots, i, 3); + } + i = idxmax3(proots); + swap(proots, i, 2); + i = isneg(proots[0] - proots[1]); + swap(proots, i, 1); + } + } + } + } + + if constexpr (maxdegree > 4) + { + if (degree > 4) + { + ftype roots[maxdegree + 1], prevroot, val, prevval[2], curval, bound[2], middle; + polynomial_tpl deriv; + int nExtremes, iter, iBound; + calc_deriviative(deriv); + + // find a subset of deriviative extremes between start and end + for (nExtremes = deriv.findroots(start, end, roots + 1, nIters, degree - 1) + 1; nExtremes > 1 && roots[nExtremes - 1] > end; nExtremes--) + { + ; + } + for (i = 1; i < nExtremes && roots[i] < start; i++) + { + ; + } + roots[i - 1] = start; + PREFAST_ASSUME(nExtremes < maxdegree + 1); + roots[nExtremes++] = end; + + for (prevroot = start, prevval[0] = eval(start, degree), nRoots = 0; i < nExtremes; prevval[0] = val, prevroot = roots[i++]) + { + val = eval(roots[i], degree); + if (val * prevval[0] < 0) + { + // we have exactly one root between prevroot and roots[i] + bound[0] = prevroot; + bound[1] = roots[i]; + iter = 0; + do + { + middle = (bound[0] + bound[1]) * (ftype)0.5; + curval = eval(middle, degree); + iBound = isneg(prevval[0] * curval); + bound[iBound] = middle; + prevval[iBound] = curval; + } while (++iter < nIters); + proots[nRoots++] = middle; + } + } + } + } + + for (i = 0; i < nRoots && proots[i] < start; i++) + { + ; + } + for (; nRoots > i&& proots[nRoots - 1] > end; nRoots--) + { + ; + } + for (j = i; j < nRoots; j++) + { + proots[j - i] = proots[j]; + } + + return nRoots - i; + } + } // namespace polynomial_tpl_IMPL + template + using polynomial_tpl = polynomial_tpl_IMPL::polynomial_tpl; + + typedef polynomial_tpl P3; + typedef polynomial_tpl P2; + typedef polynomial_tpl P1; + typedef polynomial_tpl P3f; + typedef polynomial_tpl P2f; + typedef polynomial_tpl P1f; +} // namespace LegacyCryPhysicsUtils diff --git a/Code/Sandbox/Plugins/EditorCommon/CurveEditor.cpp b/Code/Sandbox/Plugins/EditorCommon/CurveEditor.cpp index cd6c556ace..e5426b78e4 100644 --- a/Code/Sandbox/Plugins/EditorCommon/CurveEditor.cpp +++ b/Code/Sandbox/Plugins/EditorCommon/CurveEditor.cpp @@ -38,7 +38,7 @@ AZ_POP_DISABLE_WARNING #define NO_BUFFER_OVERRUN PREFAST_SUPPRESS_WARNING(6385 6386) #include -#include "../Cry3DEngine/Cry_LegacyPhysUtils.h" +#include "Cry_LegacyPhysUtils.h" namespace CurveEditorHelpers { diff --git a/Code/Sandbox/Plugins/EditorCommon/CurveEditor_38.cpp b/Code/Sandbox/Plugins/EditorCommon/CurveEditor_38.cpp index 3e44f20367..60a61b930f 100644 --- a/Code/Sandbox/Plugins/EditorCommon/CurveEditor_38.cpp +++ b/Code/Sandbox/Plugins/EditorCommon/CurveEditor_38.cpp @@ -25,7 +25,7 @@ #define INDEX_NOT_OUT_OF_RANGE PREFAST_SUPPRESS_WARNING(6201) #define NO_BUFFER_OVERRUN PREFAST_SUPPRESS_WARNING(6385 6386) -#include "../Cry3DEngine/Cry_LegacyPhysUtils.h" +#include "Cry_LegacyPhysUtils.h" #pragma warning (pop) diff --git a/Code/Tools/AssetProcessor/CMakeLists.txt b/Code/Tools/AssetProcessor/CMakeLists.txt index dd59481636..5d4980eed4 100644 --- a/Code/Tools/AssetProcessor/CMakeLists.txt +++ b/Code/Tools/AssetProcessor/CMakeLists.txt @@ -48,7 +48,6 @@ ly_add_target( ${additional_dependencies} RUNTIME_DEPENDENCIES AZ::AssetBuilder - Legacy::RC ) # Aggregates all combined AssetBuilders into a single LY_ASSET_BUILDERS #define diff --git a/Code/Tools/CMakeLists.txt b/Code/Tools/CMakeLists.txt index f106034c3c..65a1bf85ce 100644 --- a/Code/Tools/CMakeLists.txt +++ b/Code/Tools/CMakeLists.txt @@ -16,13 +16,9 @@ add_subdirectory(AzTestRunner) add_subdirectory(CrashHandler) add_subdirectory(CryCommonTools) add_subdirectory(CryXML) -add_subdirectory(HLSLCrossCompiler) -add_subdirectory(HLSLCrossCompilerMETAL) add_subdirectory(News) add_subdirectory(PythonBindingsExample) -add_subdirectory(RC) add_subdirectory(RemoteConsole) -add_subdirectory(ShaderCacheGen) add_subdirectory(DeltaCataloger) add_subdirectory(SerializeContextTools) add_subdirectory(AssetBundler) diff --git a/Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt b/Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt index 7cca815017..df97feaa3f 100644 --- a/Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt +++ b/Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt @@ -23,7 +23,6 @@ ly_add_target( PUBLIC AZ::AzCore Legacy::CryCommon - Legacy::CryRender.Headers Gem::ImGui.Static ) diff --git a/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer.cpp b/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer.cpp index ac3ab0dd04..f371210d68 100644 --- a/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer.cpp +++ b/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer.cpp @@ -54,8 +54,7 @@ namespace AssetMemoryAnalyzer namespace AssetMemoryAnalyzer { class AnalyzerImpl : - public AZ::Debug::MemoryDrillerBus::Handler, - public Render::Debug::VRAMDrillerBus::Handler + public AZ::Debug::MemoryDrillerBus::Handler { public: AZ_TYPE_INFO(AnalyzerImpl, "{E460E4DE-2160-4171-A4B6-3C2DB6692C32}"); @@ -73,13 +72,6 @@ namespace AssetMemoryAnalyzer void ReallocateAllocation(AZ::IAllocator* allocator, void* prevAddress, void* newAddress, size_t newByteSize, size_t newAlignment) override; void ResizeAllocation(AZ::IAllocator* allocator, void* address, size_t newSize) override; - // VRAMDrillerBus - void RegisterCategory(Render::Debug::VRAMAllocationCategory category, const char* categoryName, const Render::Debug::VRAMSubCategoryType& subcategories) override; - void UnregisterAllCategories() override; - void RegisterAllocation(void* address, size_t byteSize, const char* allocationName, Render::Debug::VRAMAllocationCategory category, Render::Debug::VRAMAllocationSubcategory subcategories) override; - void UnregisterAllocation(void* address) override; - void GetCurrentVRAMStats(Render::Debug::VRAMAllocationCategory category, Render::Debug::VRAMAllocationSubcategory subcategory, AZStd::string& categoryName, AZStd::string& subcategoryName, size_t& numberBytesAllocated, size_t& numberAllocations) override; - AZStd::shared_ptr GetAnalysis(); private: @@ -112,13 +104,11 @@ namespace AssetMemoryAnalyzer m_assetTracking(&m_assetTree, &m_allocationTable) { AZ::Debug::MemoryDrillerBus::Handler::BusConnect(); - Render::Debug::VRAMDrillerBus::Handler::BusConnect(); } AnalyzerImpl::~AnalyzerImpl() { AZ::Debug::MemoryDrillerBus::Handler::BusDisconnect(); - Render::Debug::VRAMDrillerBus::Handler::BusDisconnect(); } void AnalyzerImpl::RegisterAllocator(AZ::IAllocator* allocator) @@ -181,44 +171,6 @@ namespace AssetMemoryAnalyzer m_allocationTable.ResizeAllocation(address, newSize); } - void AnalyzerImpl::RegisterCategory(Render::Debug::VRAMAllocationCategory category, const char* categoryName, const Render::Debug::VRAMSubCategoryType& subcategories) - { - AZ_UNUSED(category); - AZ_UNUSED(categoryName); - AZ_UNUSED(subcategories); - } - - void AnalyzerImpl::UnregisterAllCategories() - { - } - - void AnalyzerImpl::RegisterAllocation(void* address, size_t byteSize, const char* allocationName, Render::Debug::VRAMAllocationCategory category, Render::Debug::VRAMAllocationSubcategory subcategories) - { - // Bit-flip address so that it won't collide with heap allocations (calls to the VRAM driller tend to use the same pointers from the heap objects that own the VRAM) - address = (void*)~(size_t)address; - - Data::AllocationData::CategoryInfo categoryInfo; - categoryInfo.m_vramInfo.m_category = category; - categoryInfo.m_vramInfo.m_subcategories = subcategories; - RegisterAllocationCommon(address, byteSize, allocationName, 0, categoryInfo, Data::AllocationCategories::VRAM); - } - - void AnalyzerImpl::UnregisterAllocation(void* address) - { - address = (void*)~(size_t)address; - UnregisterAllocationCommon(address); - } - - void AnalyzerImpl::GetCurrentVRAMStats(Render::Debug::VRAMAllocationCategory category, Render::Debug::VRAMAllocationSubcategory subcategory, AZStd::string& categoryName, AZStd::string& subcategoryName, size_t& numberBytesAllocated, size_t& numberAllocations) - { - AZ_UNUSED(category); - AZ_UNUSED(subcategory); - AZ_UNUSED(categoryName); - AZ_UNUSED(subcategoryName); - AZ_UNUSED(numberBytesAllocated); - AZ_UNUSED(numberAllocations); - } - void AnalyzerImpl::RegisterAllocationCommon(void* address, size_t byteSize, const char* fileName, int lineNum, Data::AllocationData::CategoryInfo categoryInfo, Data::AllocationCategories category) { if (m_performingAnalysis) diff --git a/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer.h b/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer.h index 9107604cf1..951877ab28 100644 --- a/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer.h +++ b/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer.h @@ -12,7 +12,6 @@ #pragma once #include -#include namespace AssetMemoryAnalyzer { @@ -48,13 +47,6 @@ namespace AssetMemoryAnalyzer AZ::IAllocator* m_allocator; } m_heapInfo; - - struct - { - Render::Debug::VRAMAllocationCategory m_category; - Render::Debug::VRAMAllocationSubcategory m_subcategories; - } - m_vramInfo; }; CodePoint* m_codePoint; diff --git a/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzerSystemComponent.cpp b/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzerSystemComponent.cpp index 733fa8b210..26eb94c5ec 100644 --- a/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzerSystemComponent.cpp +++ b/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzerSystemComponent.cpp @@ -12,9 +12,9 @@ #include "AssetMemoryAnalyzer_precompiled.h" #include +#include // For AZ_MAX_PATH_LEN #include #include -#include #include "AssetMemoryAnalyzerSystemComponent.h" @@ -186,9 +186,6 @@ namespace AssetMemoryAnalyzer void AssetMemoryAnalyzerSystemComponent::Init() { - static_assert(AZ_ARRAY_SIZE(VRAM_CATEGORIES) == Render::Debug::VRAMAllocationCategory::VRAM_CATEGORY_NUMBER_CATEGORIES, "VRAMAllocationCategory has changed length! Fix VRAM_CATEGORIES to match."); - static_assert(AZ_ARRAY_SIZE(VRAM_SUBCATEGORIES) == Render::Debug::VRAMAllocationSubcategory::VRAM_SUBCATEGORY_NUMBER_SUBCATEGORIES, "VRAMAllocationSubcategory has changed length! Fix VRAM_SUBCATEGORIES to match."); - m_impl->m_debugImGUI.Init(this); m_impl->m_exportCSV.Init(this); m_impl->m_exportJSON.Init(this); diff --git a/Gems/AssetMemoryAnalyzer/Code/Source/ExportJSON.cpp b/Gems/AssetMemoryAnalyzer/Code/Source/ExportJSON.cpp index d4f699bcde..f7b8633eb6 100644 --- a/Gems/AssetMemoryAnalyzer/Code/Source/ExportJSON.cpp +++ b/Gems/AssetMemoryAnalyzer/Code/Source/ExportJSON.cpp @@ -18,7 +18,6 @@ #include "FormatUtils.h" #include -#include #include #include #include diff --git a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.h b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.h index d8e7409788..a5663216d5 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.h +++ b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.h @@ -57,6 +57,7 @@ namespace AZ void OnRenderTick() override; void OnViewportSizeChanged(AzFramework::WindowSize size) override; + DebugConsole m_debugConsole; bool m_initialized = false; }; } // namespace LYIntegration diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/RCExt/ExportContexts.h b/Gems/EMotionFX/Code/EMotionFX/Pipeline/RCExt/ExportContexts.h index a856e1257a..5db5305e05 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/RCExt/ExportContexts.h +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/RCExt/ExportContexts.h @@ -12,7 +12,6 @@ * */ -#include #include #include #include @@ -21,6 +20,16 @@ namespace AZ { + namespace RC + { + enum class Phase + { + Construction, // The target is created. + Filling, // Data is added to the target. + Finalizing // Work on the target has completed. + }; + } + namespace SceneAPI { namespace Events diff --git a/Gems/LmbrCentral/Code/Source/Shape/PolygonPrismShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/PolygonPrismShape.cpp index 89c5028e93..6abd6019a6 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/PolygonPrismShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/PolygonPrismShape.cpp @@ -399,6 +399,11 @@ namespace LmbrCentral const ShapeDrawParams& shapeDrawParams, const PolygonPrismMesh& polygonPrismMesh, AzFramework::DebugDisplayRequests& debugDisplay) { + if (!gEnv->pRenderer) + { + return; + } + auto geomRenderer = gEnv->pRenderer->GetIRenderAuxGeom(); const SAuxGeomRenderFlags oldFlags = geomRenderer->GetRenderFlags(); diff --git a/Gems/PhysX/Code/CMakeLists.txt b/Gems/PhysX/Code/CMakeLists.txt index 386e48221e..ec98b0970f 100644 --- a/Gems/PhysX/Code/CMakeLists.txt +++ b/Gems/PhysX/Code/CMakeLists.txt @@ -108,7 +108,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) AZ::SceneData Legacy::CryCommon Legacy::CryCommonTools - Legacy::Cry3DEngine.CGF.Static Gem::LmbrCentral Gem::PhysX.NumericalMethods Gem::PhysX.Static diff --git a/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentPreExportComponent.h b/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentPreExportComponent.h index a39edae4a0..a74654e9a8 100644 --- a/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentPreExportComponent.h +++ b/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentPreExportComponent.h @@ -15,7 +15,6 @@ #include #include -#include #include diff --git a/Tools/LyTestTools/tests/CMakeLists.txt b/Tools/LyTestTools/tests/CMakeLists.txt index 924fbf334c..4367339272 100644 --- a/Tools/LyTestTools/tests/CMakeLists.txt +++ b/Tools/LyTestTools/tests/CMakeLists.txt @@ -32,7 +32,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED AND AutomatedT AssetProcessor AutomatedTesting.GameLauncher AutomatedTesting.Assets - Legacy::CryRenderNULL COMPONENT TestTools ) @@ -55,7 +54,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED AND AutomatedT AssetProcessor AutomatedTesting.GameLauncher AutomatedTesting.Assets - Legacy::CryRenderNULL COMPONENT TestTools ) endif() diff --git a/Tools/RemoteConsole/ly_remote_console/tests/CMakeLists.txt b/Tools/RemoteConsole/ly_remote_console/tests/CMakeLists.txt index c7352da3a0..bfc6546456 100644 --- a/Tools/RemoteConsole/ly_remote_console/tests/CMakeLists.txt +++ b/Tools/RemoteConsole/ly_remote_console/tests/CMakeLists.txt @@ -30,6 +30,5 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED AND AutomatedT # AssetProcessor # AutomatedTesting.GameLauncher # AutomatedTesting.Assets -# Legacy::CryRenderNULL # ) endif() \ No newline at end of file diff --git a/cmake/LYTestWrappers.cmake b/cmake/LYTestWrappers.cmake index 5ba8d9a11b..2a65929cf6 100644 --- a/cmake/LYTestWrappers.cmake +++ b/cmake/LYTestWrappers.cmake @@ -355,7 +355,6 @@ function(ly_add_editor_python_test) RUNTIME_DEPENDENCIES ${ly_add_editor_python_test_RUNTIME_DEPENDENCIES} Gem::EditorPythonBindings.Editor - Legacy::CryRenderNULL Legacy::Editor TEST_SUITE ${ly_add_editor_python_test_TEST_SUITE} LABELS FRAMEWORK_pytest