Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
egorodet committed Aug 6, 2023
2 parents e36e7d2 + 291098e commit fcc7aa2
Show file tree
Hide file tree
Showing 108 changed files with 1,314 additions and 584 deletions.
73 changes: 67 additions & 6 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ on:
- 'CMake/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
schedule:
- cron: '20 23 * * 3'

# Do not schedule workflow with "cron", so that it could run in GitHub forks (scheduled workflows are disabled in forks)

env:
product_ver_major: 0
product_ver_minor: 7
product_ver_patch: 2
product_ver_patch: 3
product_ver_build: ${{ github.run_number }}
tracy_release_version: "0.9.1"
vulkan_sdk_version: "1.3.250.1"
is_origin_repository: ${{ github.repository == 'MethanePowered/MethaneKit' }}
# TSC Invariant check is disabled to allow running Catch test executables only for tests list query by CTest
TRACY_NO_INVARIANT_CHECK: 1

Expand All @@ -53,6 +55,7 @@ jobs:
named_logo: Windows
run_tests: true
add_tracy_app: false
install_vulkan_sdk: false

- os: windows-latest
os_name: Windows
Expand All @@ -62,6 +65,7 @@ jobs:
named_logo: Windows
run_tests: true
add_tracy_app: false
install_vulkan_sdk: false

- os: windows-latest
os_name: Windows
Expand All @@ -71,6 +75,7 @@ jobs:
named_logo: Windows
run_tests: false
add_tracy_app: true
install_vulkan_sdk: false

- os: windows-latest
os_name: Windows
Expand All @@ -80,6 +85,7 @@ jobs:
named_logo: Windows
run_tests: false
add_tracy_app: true
install_vulkan_sdk: false

- os: windows-latest
os_name: Windows
Expand All @@ -89,6 +95,7 @@ jobs:
named_logo: Windows
run_tests: true
add_tracy_app: false
install_vulkan_sdk: false

- os: windows-latest
os_name: Windows
Expand All @@ -98,6 +105,7 @@ jobs:
named_logo: Windows
run_tests: true
add_tracy_app: false
install_vulkan_sdk: false

- os: windows-latest
os_name: Windows
Expand All @@ -107,6 +115,7 @@ jobs:
named_logo: Windows
run_tests: false
add_tracy_app: true
install_vulkan_sdk: false

- os: windows-latest
os_name: Windows
Expand All @@ -116,6 +125,7 @@ jobs:
named_logo: Windows
run_tests: false
add_tracy_app: true
install_vulkan_sdk: false

- os: ubuntu-latest
os_name: Ubuntu
Expand All @@ -125,6 +135,7 @@ jobs:
named_logo: Linux
run_tests: true
add_tracy_app: false
install_vulkan_sdk: false

- os: ubuntu-latest
os_name: Ubuntu
Expand All @@ -134,6 +145,17 @@ jobs:
named_logo: Linux
run_tests: false
add_tracy_app: true
install_vulkan_sdk: false

- os: macos-latest
os_name: MacOS
name: "MacOS_VK_Release"
config_preset: "Xcode-Mac-VK-Default"
build_preset: "Xcode-Mac-VK-Release"
named_logo: Apple
run_tests: true
add_tracy_app: false
install_vulkan_sdk: true

- os: macos-latest
os_name: MacOS
Expand All @@ -143,6 +165,7 @@ jobs:
named_logo: Apple
run_tests: true
add_tracy_app: false
install_vulkan_sdk: false

- os: macos-latest
os_name: MacOS
Expand All @@ -152,6 +175,7 @@ jobs:
named_logo: Apple
run_tests: false
add_tracy_app: true
install_vulkan_sdk: false

- os: macos-latest
os_name: MacOS
Expand All @@ -161,6 +185,7 @@ jobs:
named_logo: Apple
run_tests: false
add_tracy_app: false
install_vulkan_sdk: false

- os: macos-latest
os_name: MacOS
Expand All @@ -170,6 +195,7 @@ jobs:
named_logo: Apple
run_tests: false
add_tracy_app: false
install_vulkan_sdk: false

runs-on: ${{ matrix.os }}

Expand All @@ -187,10 +213,45 @@ jobs:
uses: actions/checkout@v3

- name: Install Testspace
if: ${{ env.is_origin_repository }}
uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}

- name: Install Vulkan SDK ${{ env.vulkan_sdk_version }}
if: ${{ matrix.install_vulkan_sdk }}
run: |
runner_os=$(uname -s)
case $runner_os in
macOS|Darwin) sdk_os=mac ; sdk_os_subdir=macOS ;;
Linux) sdk_os=linux ; sdk_os_subdir=linux ;;
Windows|MINGW*) sdk_os=windows ; sdk_os_subdir=windows ;;
*) echo "Unknown runner_os: $runner_os" ; exit 7 ; ;;
esac
sdk_ver="${{ env.vulkan_sdk_version }}"
sdk_dir="${{ runner.tool_cache }}/VulkanSDK"
sdk_ver_dir="$sdk_dir/$sdk_ver/$sdk_os_subdir"
if [ -d "$sdk_ver_dir" ]; then
echo "Vulkan SDK version directory already exists: $sdk_ver_dir"
else
test -d $sdk_dir || mkdir -pv $sdk_dir
vulkan_sdk_url=https://github.com/MethanePowered/VulkanHeaders/releases/download/sdk-$sdk_ver/vulkan_sdk_$sdk_os.7z
echo "Downloading Vulkan SDK archive $vulkan_sdk_url ..."
curl -sSLo vulkan_sdk.7z $vulkan_sdk_url
echo "Unpacking Vulkan SDK archive to $sdk_dir ..."
7z x vulkan_sdk.7z -o$sdk_dir
if [ ! -d $sdk_ver_dir ]; then
echo "Vulkan SDK subdirectory not found: $sdk_ver_dir"
exit 7
fi
fi
echo "Setting VULKAN_SDK* environment variables..."
echo "VULKAN_SDK=$sdk_ver_dir" >> $GITHUB_ENV
echo "VULKAN_SDK_VERSION=$sdk_ver" >> $GITHUB_ENV
echo "VULKAN_SDK_PLATFORM=$sdk_os" >> $GITHUB_ENV
echo "PATH=$PATH:$sdk_ver_dir/bin" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=$sdk_ver_dir/lib:${DYLD_LIBRARY_PATH:-}" >> $GITHUB_ENV
- name: Initialize Externals Cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -255,7 +316,7 @@ jobs:
path: ${{ env.INSTALL_DIR }}/Tests/*_result.xml

- name: Upload Test Results and Build Log to Testspace server
if: ${{ matrix.run_tests && (success() || failure()) }}
if: ${{ env.is_origin_repository && matrix.run_tests && (success() || failure()) }}
run: testspace "[ ${{ matrix.name }} ]${{ env.INSTALL_DIR }}/Tests/*_result.xml" "[ ${{ matrix.name }} ]${{ env.BUILD_LOG_FILE }}"

- name: Add README and BUILD files
Expand Down Expand Up @@ -300,7 +361,7 @@ jobs:

- name: Update Badge Parameters
id: badge-params
if: ${{ github.event_name == 'push' && always() }}
if: ${{ env.is_origin_repository && github.event_name == 'push' && always() }}
shell: bash
run: |
case "${{ job.status }}" in
Expand All @@ -323,7 +384,7 @@ jobs:
esac
- name: Update Badge JSON
if: ${{ github.event_name == 'push' && always() }}
if: ${{ env.is_origin_repository && github.event_name == 'push' && always() }}
uses: schneegans/[email protected] # https://github.com/marketplace/actions/dynamic-badges
with:
auth: ${{ secrets.GIST_TOKEN }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci-codeql-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ on:
- 'CMakeLists.txt'
- 'CMakePresets.json'
schedule:
- cron: '20 23 * * 3'
- cron: '20 23 * * 3' # Scheduled workflow will not run in GitHub forks

jobs:
analyze:
name: ${{ matrix.name }}
if: ${{ github.repository == 'MethanePowered/MethaneKit' }}

strategy:
fail-fast: false
Expand All @@ -41,10 +42,12 @@ jobs:
# name: "Win64_DX_CodeQL-Scan"
# config_preset: "VS2022-Win64-DX-Scan"
# build_preset: "VS2022-Win64-DX-Scan"

- os: ubuntu-latest
name: "Ubuntu_VK_CodeQL-Scan"
config_preset: "Make-Lin-VK-Scan"
build_preset: "Make-Lin-VK-Scan"

- os: macos-latest
name: "MacOS_MTL_CodeQL-Scan"
config_preset: "Xcode-Mac-MTL-Scan"
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci-sonar-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ on:
- 'CMake/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
schedule:
- cron: '20 23 * * 3' # Scheduled workflow will not run in GitHub forks

env:
product_ver_major: 0
product_ver_minor: 7
product_ver_patch: 2
product_ver_patch: 3
product_ver_build: ${{ github.run_number }}
sonar_server_url: "https://sonarcloud.io"
sonar_organization: methane-powered
Expand All @@ -45,6 +47,7 @@ env:
jobs:
sonar_scan:
name: ${{ matrix.name }}
if: ${{ github.repository == 'MethanePowered/MethaneKit' }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -108,7 +111,7 @@ jobs:
dotnet-version: 6.0.400

- name: Install Sonar-Scanner
uses: sonarsource/sonarcloud-github-c-cpp@v1
uses: sonarsource/sonarcloud-github-c-cpp@v2

- name: Install Ninja
uses: MethanePowered/gha-setup-ninja@master
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-tests-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- name: "Win32_DX_Release"
- name: "Win32_VK_Release"
- name: "Ubuntu_VK_Release"
- name: "MacOS_VK_Release"
- name: "MacOS_MTL_Release"

runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Apps/01-HelloTriangle/HelloTriangleApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class HelloTriangleApp final // NOSONAR - destructor required
for (HelloTriangleFrame& frame : GetFrames())
{
frame.render_cmd_list = cmd_queue.CreateRenderCommandList(frame.screen_pass);
frame.render_cmd_list.SetName(IndexedName("Render Triangle", frame.index));
frame.render_cmd_list.SetName(fmt::format("Render Triangle {}", frame.index));
frame.execute_cmd_list_set = Rhi::CommandListSet({ frame.render_cmd_list.GetInterface() }, frame.index);
}

Expand Down
2 changes: 1 addition & 1 deletion Apps/01-HelloTriangle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public:
for (HelloTriangleFrame& frame : GetFrames())
{
frame.render_cmd_list = cmd_queue.CreateRenderCommandList(frame.screen_pass);
frame.render_cmd_list.SetName(IndexedName("Render Triangle", frame.index));
frame.render_cmd_list.SetName(fmt::format("Render Triangle {}", frame.index));
frame.execute_cmd_list_set = Rhi::CommandListSet({ frame.render_cmd_list.GetInterface() }, frame.index);
}

Expand Down
8 changes: 4 additions & 4 deletions Apps/02-HelloCube/HelloCubeApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,23 +204,23 @@ class HelloCubeApp final // NOSONAR - destructor required
#ifdef UNIFORMS_BUFFER_ENABLED
// Create uniforms buffer with volatile parameters for frame rendering
frame.uniforms_buffer = GetRenderContext().CreateBuffer(Rhi::BufferSettings::ForConstantBuffer(uniforms_data_size, false, true));
frame.uniforms_buffer.SetName(IndexedName("Uniforms Buffer", frame.index));
frame.uniforms_buffer.SetName(fmt::format("Uniforms Buffer {}", frame.index));

// Configure program resource bindings
frame.program_bindings = m_render_state.GetProgram().CreateBindings({
{ { Rhi::ShaderType::Vertex, "g_uniforms" }, { { frame.uniforms_buffer.GetInterface() } } }
}, frame.index);
frame.program_bindings.SetName(IndexedName("Cube Bindings {}", frame.index));
frame.program_bindings.SetName(fmt::format("Cube Bindings {}", frame.index));
#else
// Create vertex buffers for each frame
Rhi::Buffer vertex_buffer = GetRenderContext().CreateBuffer(Rhi::BufferSettings::ForVertexBuffer(m_cube_mesh.GetVertexDataSize(), m_cube_mesh.GetVertexSize(), true));
vertex_buffer.SetName(IndexedName("Cube Vertex Buffer", frame.index));
vertex_buffer.SetName(fmt::format("Cube Vertex Buffer {}", frame.index));
frame.vertex_buffer_set = Rhi::BufferSet(Rhi::BufferType::Vertex, { vertex_buffer });
#endif

// Create command list for rendering
frame.render_cmd_list = m_render_cmd_queue.CreateRenderCommandList(frame.screen_pass);
frame.render_cmd_list.SetName(IndexedName("Cube Rendering", frame.index));
frame.render_cmd_list.SetName(fmt::format("Cube Rendering {}", frame.index));
frame.execute_cmd_list_set = Rhi::CommandListSet({ frame.render_cmd_list.GetInterface() }, frame.index);
}

Expand Down
6 changes: 3 additions & 3 deletions Apps/03-TexturedCube/TexturedCubeApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void TexturedCubeApp::Init()
{
// Create uniforms buffer with volatile parameters for frame rendering
frame.uniforms_buffer = GetRenderContext().CreateBuffer(rhi::BufferSettings::ForConstantBuffer(uniforms_data_size, false, true));
frame.uniforms_buffer.SetName(IndexedName("Uniforms Buffer", frame.index));
frame.uniforms_buffer.SetName(fmt::format("Uniforms Buffer {}", frame.index));

// Configure program resource bindings
frame.program_bindings = m_render_state.GetProgram().CreateBindings({
Expand All @@ -166,11 +166,11 @@ void TexturedCubeApp::Init()
{ { rhi::ShaderType::Pixel, "g_texture" }, { { m_cube_texture.GetInterface() } } },
{ { rhi::ShaderType::Pixel, "g_sampler" }, { { m_texture_sampler.GetInterface() } } },
}, frame.index);
frame.program_bindings.SetName(IndexedName("Cube Bindings", frame.index));
frame.program_bindings.SetName(fmt::format("Cube Bindings {}", frame.index));

// Create command list for rendering
frame.render_cmd_list = render_cmd_queue.CreateRenderCommandList(frame.screen_pass);
frame.render_cmd_list.SetName(IndexedName("Cube Rendering", frame.index));
frame.render_cmd_list.SetName(fmt::format("Cube Rendering {}", frame.index));
frame.execute_cmd_list_set = rhi::CommandListSet({ frame.render_cmd_list.GetInterface() }, frame.index);
}

Expand Down
Loading

10 comments on commit fcc7aa2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Win64_VK_Release Test Results

  • ✅ 3129 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 979 ms. run duration

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MacOS_VK_Release Test Results

  • ✅ 3129 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 994 ms. run duration

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MacOS_MTL_Release Test Results

  • ✅ 3129 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 1026 ms. run duration

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Win32_VK_Release Test Results

  • ✅ 3129 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 962 ms. run duration

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Win64_DX_Release Test Results

  • ✅ 3129 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 966 ms. run duration

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ubuntu_VK_Release Test Results

  • ✅ 3130 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 13165 ms. run duration

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ubuntu_VK_SonarScan Tests Code Coverage

Code Coverage

Package Line Rate Branch Rate Health
Default 38% 100%
Summary 38% (7780 / 20330) 100% (0 / 0)

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MacOS_MTL_SonarScan Tests Code Coverage

Code Coverage

Package Line Rate Branch Rate Health
Default 49% 22%
Summary 49% (12265 / 24847) 22% (3412 / 15624)

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Win64_DX_SonarScan Tests Code Coverage

Code Coverage

Package Line Rate Branch Rate Health
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneDataEventsTest.exe 95% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneDataRangeSetTest.exe 91% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneDataTypesTest.exe 98% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneGraphicsCameraTest.exe 61% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneGraphicsRhiTest.exe 44% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneGraphicsTypesTest.exe 98% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethanePlatformInputTest.exe 43% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneUserInterfaceTypesTest.exe 9% 100%
Summary 34% (4589 / 13381) 100% (0 / 0)

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Win32_DX_Release Test Results

  • ✅ 3129 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 958 ms. run duration

Please sign in to comment.