Skip to content

Commit

Permalink
Merge pull request #587 from novelrt/feature/rendering-abstraction-v2
Browse files Browse the repository at this point in the history
Modernise Graphics file structure.
  • Loading branch information
FiniteReality authored Jul 2, 2023
2 parents fdc64ac + 65aeba4 commit b78f194
Show file tree
Hide file tree
Showing 109 changed files with 334 additions and 199 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ endif()
#
add_subdirectory(thirdparty)
add_subdirectory(resources)
add_subdirectory(graphics)
add_subdirectory(src)

if(NOVELRT_BUILD_SAMPLES)
Expand All @@ -140,7 +141,7 @@ endif()
#
if(NOVELRT_INSTALL)
install(
EXPORT NovelRT
EXPORT NovelRTConfig
EXPORT_LINK_INTERFACE_LIBRARIES
NAMESPACE NovelRT::
DESTINATION lib
Expand Down
155 changes: 155 additions & 0 deletions graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
add_library(NovelRT-Graphics STATIC
GraphicsMemoryBlock.cpp
GraphicsMemoryBlockCollection.cpp
GraphicsPipeline.cpp
GraphicsPipelineInput.cpp
GraphicsPipelineInputElement.cpp
GraphicsPipelineResource.cpp
GraphicsPipelineSignature.cpp
GraphicsResourceManager.cpp
ShaderProgram.cpp
Vulkan/VulkanGraphicsAdapter.cpp
Vulkan/VulkanGraphicsAdapterSelector.cpp
Vulkan/VulkanGraphicsBuffer.cpp
Vulkan/VulkanGraphicsContext.cpp
Vulkan/VulkanGraphicsDevice.cpp
Vulkan/VulkanGraphicsFence.cpp
Vulkan/VulkanGraphicsMemoryAllocator.cpp
Vulkan/VulkanGraphicsMemoryBlock.cpp
Vulkan/VulkanGraphicsMemoryBlockCollection.cpp
Vulkan/VulkanGraphicsPipeline.cpp
Vulkan/VulkanGraphicsPipelineSignature.cpp
Vulkan/VulkanGraphicsPluginProvider.cpp
Vulkan/VulkanGraphicsProvider.cpp
Vulkan/VulkanGraphicsSurfaceContext.cpp
Vulkan/VulkanGraphicsTexture.cpp
Vulkan/VulkanShaderProgram.cpp
)

target_sources(NovelRT-Graphics
PUBLIC
FILE_SET public_headers
TYPE HEADERS
BASE_DIRS include
FILES
include/NovelRT/Graphics/Graphics.hpp
include/NovelRT/Graphics/GraphicsAdapter.hpp
include/NovelRT/Graphics/GraphicsBuffer.hpp
include/NovelRT/Graphics/GraphicsBufferKind.hpp
include/NovelRT/Graphics/GraphicsContext.hpp
include/NovelRT/Graphics/GraphicsDevice.hpp
include/NovelRT/Graphics/GraphicsDeviceObject.hpp
include/NovelRT/Graphics/GraphicsFence.hpp
include/NovelRT/Graphics/GraphicsMemoryAllocator.hpp
include/NovelRT/Graphics/GraphicsMemoryAllocatorSettings.hpp
include/NovelRT/Graphics/GraphicsMemoryBlock.hpp
include/NovelRT/Graphics/GraphicsMemoryBlockCollection.hpp
include/NovelRT/Graphics/GraphicsMemoryBudget.hpp
include/NovelRT/Graphics/GraphicsMemoryRegion.hpp
include/NovelRT/Graphics/GraphicsMemoryRegionAllocationFlags.hpp
include/NovelRT/Graphics/GraphicsPipeline.hpp
include/NovelRT/Graphics/GraphicsPipelineBlendFactor.hpp
include/NovelRT/Graphics/GraphicsPipelineInput.hpp
include/NovelRT/Graphics/GraphicsPipelineInputElement.hpp
include/NovelRT/Graphics/GraphicsPipelineInputElementKind.hpp
include/NovelRT/Graphics/GraphicsPipelineResource.hpp
include/NovelRT/Graphics/GraphicsPipelineResourceKind.hpp
include/NovelRT/Graphics/GraphicsPipelineSignature.hpp
include/NovelRT/Graphics/GraphicsPrimitive.hpp
include/NovelRT/Graphics/GraphicsProvider.hpp
include/NovelRT/Graphics/GraphicsResource.hpp
include/NovelRT/Graphics/GraphicsResourceAccess.hpp
include/NovelRT/Graphics/GraphicsResourceManager.hpp
include/NovelRT/Graphics/GraphicsSurfaceContext.hpp
include/NovelRT/Graphics/GraphicsSurfaceKind.hpp
include/NovelRT/Graphics/GraphicsTexture.hpp
include/NovelRT/Graphics/GraphicsTextureAddressMode.hpp
include/NovelRT/Graphics/GraphicsTextureKind.hpp
include/NovelRT/Graphics/IGraphicsAdapterSelector.hpp
include/NovelRT/Graphics/IGraphicsMemoryRegionCollection.hpp
include/NovelRT/Graphics/IGraphicsSurface.hpp
include/NovelRT/Graphics/RGBAColour.hpp
include/NovelRT/Graphics/ShaderProgram.hpp
include/NovelRT/Graphics/ShaderProgramKind.hpp
include/NovelRT/Graphics/ShaderProgramVisibility.hpp
include/NovelRT/Graphics/TexelFormat.hpp
include/NovelRT/Graphics/D3D12/Graphics.D3D12.hpp
include/NovelRT/Graphics/D3D12/Utilities/Graphics.D3D12.Utilities.hpp
include/NovelRT/Graphics/D3D12/Utilities/PipelineBlendFactor.hpp
include/NovelRT/Graphics/Metal/Graphics.Metal.hpp
include/NovelRT/Graphics/Metal/Utilities/Graphics.Metal.Utilities.hpp
include/NovelRT/Graphics/Metal/Utilities/PipelineBlendFactor.hpp
include/NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp
include/NovelRT/Graphics/Vulkan/QueueFamilyIndices.hpp
include/NovelRT/Graphics/Vulkan/SwapChainSupportDetails.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsAdapter.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsAdapterSelector.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsBuffer.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsContext.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsDevice.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsFence.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsMemoryAllocator.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsMemoryBlock.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsMemoryBlockCollection.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsPipeline.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsPipelineSignature.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsPluginProvider.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsPrimitive.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsProvider.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsSurfaceContext.hpp
include/NovelRT/Graphics/Vulkan/VulkanGraphicsTexture.hpp
include/NovelRT/Graphics/Vulkan/VulkanShaderProgram.hpp
include/NovelRT/Graphics/Vulkan/Utilities/BufferUsageKind.hpp
include/NovelRT/Graphics/Vulkan/Utilities/Graphics.Vulkan.Utilities.hpp
include/NovelRT/Graphics/Vulkan/Utilities/PipelineBlendFactor.hpp
include/NovelRT/Graphics/Vulkan/Utilities/Support.hpp
include/NovelRT/Graphics/Vulkan/Utilities/Texel.hpp
include/NovelRT/Graphics/Vulkan/Utilities/TextureAddressMode.hpp
)

set_target_properties(NovelRT-Graphics
PROPERTIES
EXPORT_NAME Graphics
POSITION_INDEPENDENT_CODE ON
)

target_compile_features(NovelRT-Graphics
PUBLIC
cxx_std_17
)

target_compile_options(NovelRT-Graphics
PRIVATE
$<$<CXX_COMPILER_ID:GNU>:-Wall>
$<$<CXX_COMPILER_ID:GNU>:-Wabi>
$<$<CXX_COMPILER_ID:GNU>:-Werror>
$<$<CXX_COMPILER_ID:GNU>:-Wextra>
$<$<CXX_COMPILER_ID:GNU>:-Wpedantic>
$<$<CXX_COMPILER_ID:GNU>:-pedantic-errors>

$<$<CXX_COMPILER_ID:Clang>:-Wall>
$<$<CXX_COMPILER_ID:Clang>:-Werror>
$<$<CXX_COMPILER_ID:Clang>:-Wextra>
$<$<CXX_COMPILER_ID:Clang>:-Wpedantic>
$<$<CXX_COMPILER_ID:Clang>:-pedantic-errors>

$<$<CXX_COMPILER_ID:MSVC>:/W4>
$<$<CXX_COMPILER_ID:MSVC>:/WX>
$<$<CXX_COMPILER_ID:MSVC>:/permissive->
)

target_include_directories(NovelRT-Graphics PRIVATE "$<TARGET_PROPERTY:Engine,INCLUDE_DIRECTORIES>")
target_link_libraries(NovelRT-Graphics
PUBLIC
spdlog
tbb
Vulkan::Vulkan
VulkanMemoryAllocator
)

install(
TARGETS NovelRT-Graphics
EXPORT NovelRTConfig
LIBRARY DESTINATION lib
FILE_SET public_headers DESTINATION include
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Graphics.h"
#include <NovelRT/Graphics/Graphics.hpp>

namespace NovelRT::Graphics
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Graphics.h"
#include <NovelRT/Graphics/Graphics.hpp>

namespace NovelRT::Graphics
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Graphics.h"
#include <NovelRT/Graphics/Graphics.hpp>

namespace NovelRT::Graphics
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Graphics.h"
#include <NovelRT/Graphics/Graphics.hpp>

namespace NovelRT::Graphics
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Graphics.h"
#include <NovelRT/Graphics/Graphics.hpp>

namespace NovelRT::Graphics
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Graphics.h"
#include <NovelRT/Graphics/Graphics.hpp>

namespace NovelRT::Graphics
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Graphics.h"
#include <NovelRT/Graphics/Graphics.hpp>

namespace NovelRT::Graphics
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Graphics.h"
#include <NovelRT/Graphics/Graphics.hpp>

namespace NovelRT::Graphics
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Graphics.h"
#include <NovelRT/Graphics/Graphics.hpp>

namespace NovelRT::Graphics
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>
#include <iostream>

namespace NovelRT::Graphics::Vulkan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root
// for more information.

#include "NovelRT/Graphics/Vulkan/Graphics.Vulkan.h"
#include <NovelRT/Graphics/Vulkan/Graphics.Vulkan.hpp>

namespace NovelRT::Graphics::Vulkan
{
Expand Down
Loading

0 comments on commit b78f194

Please sign in to comment.