From 40d2fe61a14c9882b6d4bd550159762f2f48e570 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 3 Sep 2021 20:35:39 -0700 Subject: [PATCH] Gems/Atom Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Common/Code/Source/Material/DrawListFunctor.h | 1 + .../Code/Source/Material/DrawListFunctorSourceData.h | 1 + .../Material/SubsurfaceTransmissionParameterFunctor.h | 1 + .../SubsurfaceTransmissionParameterFunctorSourceData.h | 1 + .../Common/Code/Source/Material/Transform2DFunctor.h | 1 + .../Code/Source/Material/Transform2DFunctorSourceData.h | 1 + .../RHI/Code/Include/Atom/RHI/PipelineStateDescriptor.h | 9 ++++----- .../RPI/Code/Include/Atom/RPI.Public/Pass/PassFilter.h | 2 ++ Gems/Atom/RPI/Code/Tests/Common/SerializeTester.h | 3 ++- Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp | 6 +++--- .../RPI/Code/Tests/Material/MaterialFunctorTests.cpp | 3 +++ .../Material/MaterialPropertyValueSourceDataTests.cpp | 1 + .../RPI/Code/Tests/Material/MaterialTypeAssetTests.cpp | 2 ++ .../Code/Tests/Material/MaterialTypeSourceDataTests.cpp | 6 ++++++ 14 files changed, 29 insertions(+), 9 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/DrawListFunctor.h b/Gems/Atom/Feature/Common/Code/Source/Material/DrawListFunctor.h index eb4bb0ab00..a21fb963e9 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/DrawListFunctor.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/DrawListFunctor.h @@ -26,6 +26,7 @@ namespace AZ static void Reflect(ReflectContext* context); + using RPI::MaterialFunctor::Process; void Process(RuntimeContext& context) override; private: diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/DrawListFunctorSourceData.h b/Gems/Atom/Feature/Common/Code/Source/Material/DrawListFunctorSourceData.h index 58df14a812..ba5e174101 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/DrawListFunctorSourceData.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/DrawListFunctorSourceData.h @@ -27,6 +27,7 @@ namespace AZ static void Reflect(ReflectContext* context); + using RPI::MaterialFunctorSourceData::CreateFunctor; FunctorResult CreateFunctor(const RuntimeContext& context) const override; private: diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctor.h b/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctor.h index 10be4a0c47..e412687947 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctor.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctor.h @@ -26,6 +26,7 @@ namespace AZ static void Reflect(ReflectContext* context); + using RPI::MaterialFunctor::Process; void Process(RuntimeContext& context) override; private: diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.h b/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.h index c4f07c549d..9d074551c3 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.h @@ -25,6 +25,7 @@ namespace AZ static void Reflect(AZ::ReflectContext* context); + using AZ::RPI::MaterialFunctorSourceData::CreateFunctor; FunctorResult CreateFunctor(const RuntimeContext& context) const override; private: diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/Transform2DFunctor.h b/Gems/Atom/Feature/Common/Code/Source/Material/Transform2DFunctor.h index bee24d90b7..2ef5af6913 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/Transform2DFunctor.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/Transform2DFunctor.h @@ -34,6 +34,7 @@ namespace AZ static void Reflect(ReflectContext* context); + using RPI::MaterialFunctor::Process; void Process(RuntimeContext& context) override; private: diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/Transform2DFunctorSourceData.h b/Gems/Atom/Feature/Common/Code/Source/Material/Transform2DFunctorSourceData.h index ecac071f94..db7e65fedc 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/Transform2DFunctorSourceData.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/Transform2DFunctorSourceData.h @@ -25,6 +25,7 @@ namespace AZ static void Reflect(AZ::ReflectContext* context); + using AZ::RPI::MaterialFunctorSourceData::CreateFunctor; FunctorResult CreateFunctor(const RuntimeContext& context) const override; private: diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineStateDescriptor.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineStateDescriptor.h index 63f0cb3822..83ab3cb584 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineStateDescriptor.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineStateDescriptor.h @@ -44,7 +44,7 @@ namespace AZ /// Returns the hash of the pipeline state descriptor contents. virtual HashValue64 GetHash() const = 0; - virtual bool operator == (const PipelineStateDescriptor& rhs) const; + bool operator == (const PipelineStateDescriptor& rhs) const; /// The pipeline layout describing the shader resource bindings. ConstPtr m_pipelineLayoutDescriptor = nullptr; @@ -77,8 +77,7 @@ namespace AZ /// Computes the hash value for this descriptor. HashValue64 GetHash() const override; - - virtual bool operator == (const PipelineStateDescriptorForDispatch& rhs) const; + bool operator == (const PipelineStateDescriptorForDispatch& rhs) const; /// The compute function containing byte code to compile. ConstPtr m_computeFunction; @@ -102,7 +101,7 @@ namespace AZ /// Computes the hash value for this descriptor. HashValue64 GetHash() const override; - virtual bool operator == (const PipelineStateDescriptorForDraw& rhs) const; + bool operator == (const PipelineStateDescriptorForDraw& rhs) const; /// [Required] The vertex function to compile. ConstPtr m_vertexFunction; @@ -135,7 +134,7 @@ namespace AZ //! Computes the hash value for this descriptor. HashValue64 GetHash() const override; - virtual bool operator == (const PipelineStateDescriptorForRayTracing& rhs) const; + bool operator == (const PipelineStateDescriptorForRayTracing& rhs) const; // The ray tracing shader byte code ConstPtr m_rayTracingFunction; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/PassFilter.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/PassFilter.h index 5429dc13c0..c31f353adb 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/PassFilter.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/PassFilter.h @@ -53,6 +53,8 @@ namespace AZ //! Construct filter with only pass name. PassHierarchyFilter(const Name& passName); + virtual ~PassHierarchyFilter() = default; + //! Construct filter with pass name and its parents' names in the order of the hierarchy //! This means k-th element is always an ancestor of the (k-1)-th element. //! And the last element is the pass name. diff --git a/Gems/Atom/RPI/Code/Tests/Common/SerializeTester.h b/Gems/Atom/RPI/Code/Tests/Common/SerializeTester.h index 8422756837..df21d13fc0 100644 --- a/Gems/Atom/RPI/Code/Tests/Common/SerializeTester.h +++ b/Gems/Atom/RPI/Code/Tests/Common/SerializeTester.h @@ -23,6 +23,7 @@ namespace UnitTest : m_serializeContext{serializeContext} , m_outStream{&m_buffer} {} + virtual ~SerializeTester() = default; // Serializes an object out to a the internal stream. Resets the stream with each call. virtual void SerializeOut(T* object, AZ::DataStream::StreamType streamType = AZ::DataStream::ST_XML); @@ -76,7 +77,7 @@ namespace UnitTest m_assetHandler = AZ::Data::AssetManager::Instance().GetHandler(AssetDataT::RTTI_Type()); } - ~AssetTester() = default; + virtual ~AssetTester() = default; void SerializeOut(AZ::Data::Asset assetToSave) { diff --git a/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp b/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp index 345637bfe5..86f97b96e9 100644 --- a/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp @@ -40,10 +40,9 @@ namespace AZ : public UnitTest::AssetTester { public: - StreamingImageAssetTester() - { + StreamingImageAssetTester() = default; + ~StreamingImageAssetTester() override = default; - } void SetAssetReady(Data::Asset& asset) override { asset->SetReady(); @@ -55,6 +54,7 @@ namespace AZ { public: ImageMipChainAssetTester() {} + ~ImageMipChainAssetTester() override = default; void SetAssetReady(Data::Asset& asset) override { diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialFunctorTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialFunctorTests.cpp index 0c84484508..e1e8c91944 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialFunctorTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialFunctorTests.cpp @@ -41,6 +41,7 @@ namespace UnitTest { } + using MaterialFunctor::Process; void Process(MaterialFunctor::RuntimeContext& context) override { m_processResult = context.SetShaderOptionValue(0, m_shaderOptionIndex, m_shaderOptionValue); @@ -65,6 +66,7 @@ namespace UnitTest public: MOCK_METHOD0(ProcessCalled, void()); + using MaterialFunctor::Process; void Process(RuntimeContext& context) override { ProcessCalled(); @@ -87,6 +89,7 @@ namespace UnitTest : public MaterialFunctorSourceData { public: + using MaterialFunctorSourceData::CreateFunctor; FunctorResult CreateFunctor(const RuntimeContext& context) const override { Ptr functor = aznew PropertyDependencyTestFunctor; diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyValueSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyValueSourceDataTests.cpp index 231558bb99..5dde21ece1 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyValueSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyValueSourceDataTests.cpp @@ -142,6 +142,7 @@ namespace UnitTest AZStd::string m_propertyName; MaterialPropertyValueSourceData m_propertyValue; + using MaterialFunctorSourceData::CreateFunctor; FunctorResult CreateFunctor(const RuntimeContext& context) const override { Ptr functor = aznew ValueFunctor; diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeAssetTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeAssetTests.cpp index e11a049af2..b9774c84d9 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeAssetTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeAssetTests.cpp @@ -47,6 +47,7 @@ namespace UnitTest ; } + using AZ::RPI::MaterialFunctor::Process; void Process(AZ::RPI::MaterialFunctor::RuntimeContext& context) override { // This code isn't actually called in the unit test, but we include it here just to demonstrate what a real functor might look like. @@ -74,6 +75,7 @@ namespace UnitTest ; } + using AZ::RPI::MaterialFunctor::Process; void Process(AZ::RPI::MaterialFunctor::RuntimeContext& context) override { // This code isn't actually called in the unit test, but we include it here just to demonstrate what a real functor might look like. diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp index 5edf09b67d..179dc7c966 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp @@ -70,6 +70,7 @@ namespace UnitTest } } + using AZ::RPI::MaterialFunctor::Process; void Process(AZ::RPI::MaterialFunctor::RuntimeContext& context) override { // This code isn't actually called in the unit test, but we include it here just to demonstrate what a real functor might look like. @@ -110,6 +111,7 @@ namespace UnitTest AZStd::string m_floatPropertyInputId; AZStd::string m_float3ShaderSettingOutputId; + using MaterialFunctorSourceData::CreateFunctor; FunctorResult CreateFunctor(const RuntimeContext& context) const override { Ptr functor = aznew Splat3Functor; @@ -138,6 +140,7 @@ namespace UnitTest } } + using AZ::RPI::MaterialFunctor::Process; void Process(AZ::RPI::MaterialFunctor::RuntimeContext& context) override { // This code isn't actually called in the unit test, but we include it here just to demonstrate what a real functor might look like. @@ -174,6 +177,7 @@ namespace UnitTest m_shaderIndex{shaderIndex} {} + using MaterialFunctorSourceData::CreateFunctor; FunctorResult CreateFunctor(const RuntimeContext& context) const override { Ptr functor = aznew EnableShaderFunctor; @@ -200,6 +204,7 @@ namespace UnitTest } } + using AZ::RPI::MaterialFunctor::Process; void Process(AZ::RPI::MaterialFunctor::RuntimeContext& context) override { // This code isn't actually called in the unit test, but we include it here just to demonstrate what a real functor might look like. @@ -232,6 +237,7 @@ namespace UnitTest return options; } + using MaterialFunctorSourceData::CreateFunctor; FunctorResult CreateFunctor([[maybe_unused]] const RuntimeContext& context) const override { Ptr functor = aznew SetShaderOptionFunctor;