/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #pragma once #include #include #include #include #include #include #include #include #include #include #include namespace UnitTest { //! Unit test fixture for setting up things commonly needed by RPI unit tests class RPITestFixture : public AssetManagerTestFixture { static const uint32_t s_heapSizeMB = 64; public: protected: virtual void Reflect(AZ::ReflectContext* context); void SetUp() override; void TearDown() override; AZ::RHI::Device* GetDevice(); //! Performs processing that would normally be done by the frame scheduler, //! which has to happen in order to recompile the same SRG instance multiple times. void ProcessQueuedSrgCompilations(AZ::Data::Asset shaderAsset, const AZ::Name& srgName); AZ::JsonRegistrationContext* GetJsonRegistrationContext() override; AssetSystemStub m_assetSystemStub; private: AZStd::unique_ptr m_rhiFactory; AZStd::unique_ptr m_rpiSystem; AZStd::unique_ptr m_jobManager; AZStd::unique_ptr m_jobContext; // Required for json serializer AZStd::unique_ptr m_jsonSystemComponent; AZStd::unique_ptr m_jsonRegistrationContext; AZ::IO::FileIOBase* m_priorFileIO = nullptr; AZStd::unique_ptr m_localFileIO; }; } // namespace UnitTest