Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
77 changes: 77 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
root = true

[*]
charset = utf-8
end_of_line = CRLF
indent_style = tab
indent_size = 4
tab_width = 4
trim_trailing_whitespace = true
insert_final_newline = true

[*.{c++,cc,cpp,cppm,cu,cuh,cxx,fx,h,h++,hh,hlsl,hpp,hxx,inl,ipp,ixx,tlh,tli}]
# Visual C++ Code Style settings
cpp_generate_documentation_comments = doxygen_slash_star
# Visual C++ Formatting settings
cpp_indent_braces = false
cpp_indent_multi_line_relative_to = innermost_parenthesis
cpp_indent_within_parentheses = indent
cpp_indent_preserve_within_parentheses = true
cpp_indent_case_contents = true
cpp_indent_case_labels = false
cpp_indent_case_contents_when_block = true
cpp_indent_lambda_braces_when_parameter = true
cpp_indent_goto_labels = leftmost_column
cpp_indent_preprocessor = leftmost_column
cpp_indent_access_specifiers = false
cpp_indent_namespace_contents = true
cpp_indent_preserve_comments = true
cpp_new_line_before_open_brace_namespace = new_line
cpp_new_line_before_open_brace_type = new_line
cpp_new_line_before_open_brace_function = new_line
cpp_new_line_before_open_brace_block = new_line
cpp_new_line_before_open_brace_lambda = new_line
cpp_new_line_scope_braces_on_separate_lines = true
cpp_new_line_close_brace_same_line_empty_type = false
cpp_new_line_close_brace_same_line_empty_function = false
cpp_new_line_before_catch = true
cpp_new_line_before_else = true
cpp_new_line_before_while_in_do_while = true
cpp_space_before_function_open_parenthesis = remove
cpp_space_within_parameter_list_parentheses = true
cpp_space_between_empty_parameter_list_parentheses = false
cpp_space_after_keywords_in_control_flow_statements = true
cpp_space_within_control_flow_statement_parentheses = true
cpp_space_before_lambda_open_parenthesis = false
cpp_space_within_cast_parentheses = true
cpp_space_after_cast_close_parenthesis = false
cpp_space_within_expression_parentheses = true
cpp_space_before_block_open_brace = true
cpp_space_between_empty_braces = false
cpp_space_before_initializer_list_open_brace = false
cpp_space_within_initializer_list_braces = true
cpp_space_preserve_in_initializer_list = false
cpp_space_before_open_square_bracket = false
cpp_space_within_square_brackets = false
cpp_space_before_empty_square_brackets = false
cpp_space_between_empty_square_brackets = false
cpp_space_group_square_brackets = true
cpp_space_within_lambda_brackets = false
cpp_space_between_empty_lambda_brackets = false
cpp_space_before_comma = false
cpp_space_after_comma = true
cpp_space_remove_around_member_operators = true
cpp_space_before_inheritance_colon = true
cpp_space_before_constructor_colon = true
cpp_space_remove_before_semicolon = true
cpp_space_after_semicolon = true
cpp_space_remove_around_unary_operator = true
cpp_space_around_binary_operator = insert
cpp_space_around_assignment_operator = insert
cpp_space_pointer_reference_alignment = center
cpp_space_around_ternary_operator = insert
cpp_use_unreal_engine_macro_formatting = true
cpp_wrap_preserve_blocks = never
# Visual C++ Inlcude Cleanup settings
cpp_include_cleanup_add_missing_error_tag_type = suggestion
cpp_include_cleanup_remove_unused_error_tag_type = dimmed
38 changes: 38 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
codecov:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "70...100"
status:
project:
default:
target: auto
threshold: 100%
base: auto
patch:
default:
target: auto
threshold: 100%
base: auto
if_ci_failed: success
informational: true

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "reach,diff,flags,files,footer"
behavior: default
require_changes: no
require_head: no
require_base: no

github_checks:
annotations: true
21 changes: 16 additions & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [[windows-latest,x64-windows,msvc]]
buildType: [Release]
buildType: [Debug]
runs-on: ${{ matrix.os[0] }}
steps:
- uses: actions/checkout@v2
Expand All @@ -30,7 +30,13 @@ jobs:
run: |
$VCPKG_ROOT/vcpkg install vulkan-headers:${{ matrix.os[1] }}
- name: Checkout submodules
run: git submodule update --init -- "CMake"
run: |
git submodule update --init -- "CMake"
- name: Setup OpenCppCoverage
id: setup_opencppcoverage
run: |
choco install OpenCppCoverage -y
echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH
- name: Create Build Environment
run: |
cmake -E make_directory ${{runner.workspace}}/build-${{ matrix.buildType }}
Expand All @@ -50,17 +56,22 @@ jobs:
shell: bash
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildType }} -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/package/rendergraph -DPROJECTS_WARNINGS_AS_ERRORS=$PROJ_WAE -DCRG_UNITY_BUILD=ON -DCRG_BUILD_TESTS=ON -DVULKAN_HEADERS_INCLUDE_DIRS=$VCPKG_ROOT/installed/${{matrix.os[1]}}/include
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildType }} -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/package/rendergraph -DPROJECTS_WARNINGS_AS_ERRORS=$PROJ_WAE -DPROJECTS_COVERAGE=ON -DCRG_UNITY_BUILD=ON -DCRG_BUILD_TESTS=ON -DVULKAN_HEADERS_INCLUDE_DIRS=$VCPKG_ROOT/installed/${{matrix.os[1]}}/include
- name: Build
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
shell: bash
run: |
cmake --build . --parallel 2 --config ${{ matrix.buildType }}
- name: Test
- name: Build coverage report
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
shell: bash
run: |
ctest -C ${{ matrix.buildType }}
cmake --build . --target RenderGraphCoverage --config ${{ matrix.buildType }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ github.workspace }}/doc/RenderGraphCoverage.xml
- name: Prepare package
if: github.event_name == 'push'
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/binaries
/build
/setup
/doc/coverage
/doc/RenderGraphCoverage
/doc/RenderGraphCoverage.xml
/doc/x86
/doc/x64
/.gitattributes
Expand Down
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set( MAIN_PROJECT_NAME "RenderGraph" )
# Set project version numbers
set( VERSION_MAJOR 1 )
set( VERSION_MINOR 4 )
set( VERSION_BUILD 0 )
set( VERSION_BUILD 1 )
set( VERSION_YEAR 2024 )

set( _PROJECT_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}" )
Expand Down Expand Up @@ -52,6 +52,8 @@ set_property( GLOBAL PROPERTY USE_FOLDERS ON )
set( CRG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
set( CRG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} )

set( CRG_EDITORCONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/.editorconfig )

if ( NOT DEFINED CRG_BUILD_STATIC )
option( CRG_BUILD_STATIC "Build as a static library" ON )
endif ()
Expand Down Expand Up @@ -94,15 +96,12 @@ if ( MSVC OR NOT "${CMAKE_BUILD_TYPE}" STREQUAL "" )
${CRG_SOURCE_DIR}/include/${PROJECT_NAME}/RunnablePass.hpp
${CRG_SOURCE_DIR}/include/${PROJECT_NAME}/Signal.hpp
${CRG_SOURCE_DIR}/include/${PROJECT_NAME}/WriteDescriptorSet.hpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/BuilderCommon.hpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/GraphBuilder.hpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/FramePassDependenciesBuilder.hpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/ResourceOptimiser.hpp
)
set( ${PROJECT_NAME}_SRC_FILES
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/Attachment.cpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/AttachmentTransition.cpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/BuilderCommon.cpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/DotExport.cpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/FrameGraph.cpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/FramePass.cpp
Expand All @@ -116,7 +115,6 @@ if ( MSVC OR NOT "${CMAKE_BUILD_TYPE}" STREQUAL "" )
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/Log.cpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/RecordContext.cpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/ResourceHandler.cpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/ResourceOptimiser.cpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/RunnableGraph.cpp
${CRG_SOURCE_DIR}/source/${PROJECT_NAME}/RunnablePass.cpp
)
Expand Down Expand Up @@ -214,6 +212,10 @@ if ( MSVC OR NOT "${CMAKE_BUILD_TYPE}" STREQUAL "" )
ALIAS
${PROJECT_NAME}
)
target_sources( ${PROJECT_NAME}
PRIVATE
${CRG_EDITORCONFIG_FILE}
)
target_add_compilation_flags( ${PROJECT_NAME} )
target_compile_options( ${PROJECT_NAME}
PUBLIC
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<p align="center">
<a href="https://github.com/DragonJoker/RenderGraph/actions?query=workflow%3ABuild+event%3Apush"><img alt="Build status" src="https://github.com/DragonJoker/RenderGraph/workflows/Build/badge.svg?event=push"></a>
<a href="https://codecov.io/gh/DragonJoker/RenderGraph" ><img src="https://codecov.io/gh/DragonJoker/RenderGraph/graph/badge.svg?token=E0IGAPHLJO"/></a>
</p>


Expand Down
1 change: 0 additions & 1 deletion include/RenderGraph/AttachmentTransition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ namespace crg
};

AttachmentTransitions mergeIdenticalTransitions( AttachmentTransitions value );
AttachmentTransitions reduceDirectPaths( AttachmentTransitions value );

struct FramePassTransitions
{
Expand Down
4 changes: 1 addition & 3 deletions include/RenderGraph/GraphNode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ namespace crg
CRG_API GraphNode & operator=( GraphNode const & ) = delete;
CRG_API GraphNode( GraphNode && rhs )noexcept;
CRG_API GraphNode & operator=( GraphNode && rhs )noexcept;

CRG_API virtual ~GraphNode()noexcept = default;

CRG_API void addAttaches( ConstGraphAdjacentNode const prev
, AttachmentTransitions inputAttaches );
CRG_API void attachNode( GraphAdjacentNode next
, AttachmentTransitions inputAttaches );
CRG_API GraphAdjacentNode findInNext( FramePass const & pass )const;
CRG_API bool hasInNext( ConstGraphAdjacentNode const & node )const;
CRG_API AttachmentTransitions const & getInputAttaches( ConstGraphAdjacentNode pred = nullptr )const;

CRG_API virtual void accept( GraphVisitor * vis )const = 0;
Expand Down
Loading