Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Atom_RPI.Public and Atom_RPI.Edit to shared libraries #18427

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add export macro to Atom_RPI.Public files
Signed-off-by: Markus Prettner <[email protected]>
  • Loading branch information
mprettner-huawei committed Dec 3, 2024
commit 716ddc5399280b3b3cf89b21aa3bf6ccee106205
5 changes: 4 additions & 1 deletion Gems/Atom/RPI/Code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ else()
endif()

ly_add_target(
NAME ${gem_name}.Public STATIC
NAME ${gem_name}.Public ${PAL_TRAIT_MONOLITHIC_DRIVEN_LIBRARY_TYPE}
NAMESPACE Gem
FILES_CMAKE
atom_rpi_reflect_files.cmake
atom_rpi_public_files.cmake
../Assets/atom_rpi_asset_files.cmake
${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
${MASKED_OCCLUSION_CULLING_FILES}
COMPILE_DEFINITIONS
PRIVATE
ATOM_RPI_PUBLIC_EXPORTS
PLATFORM_INCLUDE_FILES
${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common/${PAL_TRAIT_COMPILER_ID}/atom_rpi_public_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
INCLUDE_DIRECTORIES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#include <AzCore/std/smart_ptr/shared_ptr.h>

#include <Atom/RPI.Public/Configuration.h>

namespace AZ
{
namespace RPI
Expand All @@ -29,7 +31,7 @@ namespace AZ
//! geometry will not be combined with any other geometry to reduce draw calls. For functions where a single color is provided, the given color
//! is used to determine if the geometry is opaque or translucent. If multiple colors are provided then a separate parameter of type OpacityType
//! is used to indicate if the geometry is opaque or translucent.
class AuxGeomDraw
class ATOM_RPI_PUBLIC_API AuxGeomDraw
{
public: //types

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <AzCore/RTTI/RTTI.h>

#include <Atom/RPI.Public/Base.h>
#include <Atom/RPI.Public/Configuration.h>
#include <Atom/RPI.Public/FeatureProcessor.h>

namespace AZ
Expand All @@ -22,7 +23,7 @@ namespace AZ
using AuxGeomDrawPtr = AZStd::shared_ptr<AuxGeomDraw>;

//! Interface of AuxGeom system, which is used for drawing Auxiliary Geometry, both for debug and things like editor manipulators.
class AuxGeomFeatureProcessorInterface
class ATOM_RPI_PUBLIC_API AuxGeomFeatureProcessorInterface
: public FeatureProcessor
{
public:
Expand Down
7 changes: 4 additions & 3 deletions Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
/**
* This header file is for declaring types used for RPI System classes to avoid recursive includes
*/

#include <Atom/RHI.Reflect/Limits.h>
#include <Atom/RPI.Public/Configuration.h>
#include <AzCore/Asset/AssetManager.h>
#include <AzCore/Asset/AssetManagerBus.h>
#include <AzCore/Debug/Budget.h>
Expand All @@ -20,8 +21,8 @@
#include <AzCore/std/smart_ptr/shared_ptr.h>
#include <AzCore/std/containers/fixed_vector.h>

AZ_DECLARE_BUDGET(AzRender);
AZ_DECLARE_BUDGET(RPI);
ATOM_RPI_PUBLIC_API AZ_DECLARE_BUDGET(AzRender);
ATOM_RPI_PUBLIC_API AZ_DECLARE_BUDGET(RPI);

namespace AZ
{
Expand Down
5 changes: 3 additions & 2 deletions Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Buffer/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@

#pragma once

#include <Atom/RPI.Public/Configuration.h>

#include <Atom/RHI/Buffer.h>
#include <Atom/RHI/BufferPool.h>
#include <Atom/RHI/Fence.h>

#include <Atom/RHI.Reflect/AttachmentId.h>
#include <Atom/RHI.Reflect/Base.h>

#include <Atom/RPI.Reflect/Buffer/BufferAsset.h>

#include <AtomCore/Instance/InstanceData.h>
Expand All @@ -30,7 +31,7 @@ namespace AZ
{
class BufferPool;

class Buffer final
class ATOM_RPI_PUBLIC_API Buffer final
: public Data::InstanceData
{
friend class BufferSystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#pragma once

#include <Atom/RPI.Public/Configuration.h>

#include <Atom/RHI/BufferPool.h>

#include <AtomCore/Instance/InstanceData.h>
Expand All @@ -23,7 +25,7 @@ namespace AZ
{
class ResourcePoolAsset;

class BufferPool final
class ATOM_RPI_PUBLIC_API BufferPool final
: public Data::InstanceData
{
friend class BufferSystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma once

#include <Atom/RPI.Public/Buffer/BufferSystemInterface.h>
#include <Atom/RPI.Public/Configuration.h>
#include <Atom/RPI.Reflect/Asset/AssetHandler.h>

namespace AZ
Expand All @@ -21,7 +22,7 @@ namespace AZ
class Buffer;

//! Manages system-wide initialization and support for Buffer classes
class BufferSystem final
class ATOM_RPI_PUBLIC_API BufferSystem final
: public BufferSystemInterface
{
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#pragma once

#include <Atom/RPI.Public/Configuration.h>

#include <Atom/RHI/BufferPool.h>
#include <Atom/RHI.Reflect/Base.h>
#include <Atom/RHI.Reflect/Format.h>
Expand Down Expand Up @@ -56,7 +58,7 @@ namespace AZ
bool m_isUniqueName = false;
};

class BufferSystemInterface
class ATOM_RPI_PUBLIC_API BufferSystemInterface
{
public:
AZ_RTTI(BufferSystemInterface, "{6FD805CC-C3EC-4E58-A2AF-E9E918965122}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <Atom/RHI.Reflect/FrameCountMaxRingBuffer.h>
#include <Atom/RPI.Public/Buffer/Buffer.h>
#include <Atom/RPI.Public/Buffer/BufferSystemInterface.h>
#include <Atom/RPI.Public/Configuration.h>
#include <AzCore/std/containers/span.h>
#include <AzCore/std/string/string.h>

Expand All @@ -20,7 +21,7 @@ namespace AZ::RPI
//! A class which manages a FrameCountMax number of RPI buffers and manages them in a ring buffer structure, meaning that whenever data
//! needs to be updated, the current buffer index is incremented (mod FrameCountMax) and the data is then written to the new current
//! buffer, such that the other buffers stay valid.
class RingBuffer : public RHI::FrameCountMaxRingBuffer<Data::Instance<Buffer>>
class ATOM_RPI_PUBLIC_API RingBuffer : public RHI::FrameCountMaxRingBuffer<Data::Instance<Buffer>>
{
AZStd::string m_bufferName;
CommonBufferPoolType m_bufferPoolType{ CommonBufferPoolType::ReadOnly };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#pragma once

#include <AzCore/Math/Color.h>
#include <Atom/RPI.Public/Configuration.h>

namespace AZ
{
Expand All @@ -25,6 +26,6 @@ namespace AZ
ColorSpaceIdCount
};

Color TransformColor(Color color, ColorSpaceId fromColorSpace, ColorSpaceId toColorSpace);
ATOM_RPI_PUBLIC_API Color TransformColor(Color color, ColorSpaceId fromColorSpace, ColorSpaceId toColorSpace);
} // namespace Render
} // namespace AZ
21 changes: 21 additions & 0 deletions Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Configuration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 <AzCore/PlatformDef.h>

#if defined(AZ_MONOLITHIC_BUILD)
#define ATOM_RPI_PUBLIC_API
#else
#if defined(ATOM_RPI_PUBLIC_EXPORTS)
#define ATOM_RPI_PUBLIC_API AZ_DLL_EXPORT
#else
#define ATOM_RPI_PUBLIC_API AZ_DLL_IMPORT
#endif
#endif
9 changes: 5 additions & 4 deletions Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Culling.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <AzFramework/Visibility/IVisibilitySystem.h>

#include <Atom/RPI.Public/Configuration.h>
#include <Atom/RPI.Public/View.h>
#include <Atom/RHI/DrawList.h>

Expand All @@ -50,7 +51,7 @@ namespace AZ
{
class Scene;

struct Cullable
struct ATOM_RPI_PUBLIC_API Cullable
{
struct CullData
{
Expand Down Expand Up @@ -148,7 +149,7 @@ namespace AZ
#endif
};

class CullingDebugContext
class ATOM_RPI_PUBLIC_API CullingDebugContext
{
public:
AZStd::mutex m_frozenFrustumsMutex;
Expand Down Expand Up @@ -226,12 +227,12 @@ namespace AZ
};

//! Selects an lod (based on size-in-screen-space) and adds the appropriate DrawPackets to the view.
uint32_t AddLodDataToView(const Vector3& pos, const Cullable::LodData& lodData, RPI::View& view, AzFramework::VisibilityEntry::TypeFlags typeFlags);
ATOM_RPI_PUBLIC_API uint32_t AddLodDataToView(const Vector3& pos, const Cullable::LodData& lodData, RPI::View& view, AzFramework::VisibilityEntry::TypeFlags typeFlags);

//! Centralized manager for culling-related processing for a given scene.
//! There is one CullingScene owned by each Scene, so external systems (such as FeatureProcessors) should
//! access the CullingScene via their parent Scene.
class CullingScene
class ATOM_RPI_PUBLIC_API CullingScene
{
public:
AZ_RTTI(CullingScene, "{5B23B55B-8A1D-4B0D-9760-15E87FC8518A}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#pragma once

#include <Atom/RPI.Public/Base.h>
#include <Atom/RPI.Public/Configuration.h>
#include <Atom/RPI.Public/DynamicDraw/DynamicBufferAllocator.h>

#include <AzCore/std/smart_ptr/intrusive_base.h>
Expand All @@ -33,7 +34,7 @@ namespace AZ
//! // Use the buffer view for DrawItem or etc.
//! }
//! Note: DynamicBuffer should only be used for DynamicInputAssembly buffer or Constant buffer (not supported yet).
class DynamicBuffer
class ATOM_RPI_PUBLIC_API DynamicBuffer
: public AZStd::intrusive_base
{
friend class DynamicBufferAllocator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <Atom/RHI/IndexBufferView.h>
#include <Atom/RHI/StreamBufferView.h>
#include <Atom/RPI.Public/Buffer/RingBuffer.h>
#include <Atom/RPI.Public/Configuration.h>

namespace AZ
{
Expand All @@ -24,7 +25,7 @@ namespace AZ
//! Limitation: the allocation may fail if the request buffer size is larger than the ring buffer size or
//! there isn't enough unused memory available within the ring buffer. User may increase the input of Init(ringBufferSize)
//! to increase the ring buffer's size.
class DynamicBufferAllocator
class ATOM_RPI_PUBLIC_API DynamicBufferAllocator
{
public:
AZ_RTTI(AZ::RPI::DynamicBufferAllocator, "{82B047B3-C845-4F77-9852-747E39C53081}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <Atom/RHI.Reflect/Base.h> // for AZ_BITS and AZ_DEFINE_ENUM_BITWISE_OPERATORS

#include <Atom/RPI.Public/Configuration.h>
#include <Atom/RPI.Public/PipelineState.h>
#include <Atom/RPI.Public/SceneBus.h>

Expand All @@ -29,7 +30,7 @@ namespace AZ
//! * One shader.
//! * One draw list tag which is initialized from shader but can be overwritten.
//! DynamicDrawContext may allow some render states change or few other changes which are defined in DynamicDrawContext::DrawVariation
class DynamicDrawContext
class ATOM_RPI_PUBLIC_API DynamicDrawContext
: public AZStd::intrusive_base
, public SceneNotificationBus::Handler
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <Atom/RHI/DrawPacket.h>

#include <Atom/RPI.Public/Base.h>
#include <Atom/RPI.Public/Configuration.h>
#include <Atom/RPI.Public/DynamicDraw/DynamicBuffer.h>
#include <Atom/RPI.Public/DynamicDraw/DynamicDrawContext.h>
#include <Atom/RPI.Public/Material/Material.h>
Expand All @@ -36,7 +37,7 @@ namespace AZ

//! Interface of dynamic draw system which provide access to system dynamic buffer
//! and some draw functions
class DynamicDrawInterface
class ATOM_RPI_PUBLIC_API DynamicDrawInterface
{
public:
AZ_RTTI(DynamicDrawInterface, "{0883B8A7-9D25-418A-8F98-B33C52FF21CC}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@

#pragma once

#include <Atom/RPI.Public/Configuration.h>
#include <Atom/RPI.Public/DynamicDraw/DynamicDrawInterface.h>
#include <Atom/RPI.Public/DynamicDraw/DynamicBufferAllocator.h>
#include <Atom/RPI.Reflect/RPISystemDescriptor.h>


namespace AZ
{
namespace RPI
{
//! DynamicDrawSystem is the dynamic draw system in RPI system which implements DynamicDrawInterface
//! It contains the dynamic buffer allocator which is used to allocate dynamic buffers.
//! It also responses to submit all the dynamic draw data to the rendering passes.
class DynamicDrawSystem final : public DynamicDrawInterface
class ATOM_RPI_PUBLIC_API DynamicDrawSystem final : public DynamicDrawInterface
{
friend class RPISystem;
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <Atom/RHI/DrawListContext.h>

#include <Atom/RPI.Public/Base.h>
#include <Atom/RPI.Public/Configuration.h>
#include <Atom/RPI.Public/SceneBus.h>

#include <Atom/RPI.Reflect/FeatureProcessorDescriptor.h>
Expand Down Expand Up @@ -42,7 +43,7 @@ namespace AZ
//!
//! It is recommended that each feature processor maintain a data buffer that is buffered N times for the data that is
//! expected to be delivered via an Ebus.
class FeatureProcessor
class ATOM_RPI_PUBLIC_API FeatureProcessor
: public SceneNotificationBus::Handler
{
friend class Scene;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#pragma once

#include <Atom/RPI.Public/Base.h>
#include <Atom/RPI.Public/Configuration.h>
#include <AzCore/RTTI/RTTI.h>
#include <AzCore/Memory/SystemAllocator.h>

Expand All @@ -23,7 +24,7 @@ namespace AZ
//! feature processors. Once registered, these feature processors can
//! be queried and created for scenes attempting to enable/disable a
//! specific feature processor.
class FeatureProcessorFactory final
class ATOM_RPI_PUBLIC_API FeatureProcessorFactory final
{
public:
friend class FeatureProcessorDeleter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <AzCore/std/containers/array.h>
#include <AzCore/Name/Name.h>

#include <Atom/RPI.Public/Configuration.h>
#include <Atom/RPI.Public/GpuQuery/GpuQueryTypes.h>

namespace AZ
Expand All @@ -26,7 +27,7 @@ namespace AZ
//! REMARK: Use judiciously, as MeasureGpuTimeInNanoseconds() can itself affect performance when called.
//! For example, if a scene is running at 300fps, calling MeasureGpuTimeInNanoseconds(), each frame, can reduce the FPS to
//! ~265fps.
class GpuPassProfiler final
class ATOM_RPI_PUBLIC_API GpuPassProfiler final
{
public:

Expand Down
Loading