WIP: feat(renderer/vk): shaders #12
11 changed files with 136 additions and 103 deletions
111
.drone.yml
111
.drone.yml
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: exec
|
||||
name: macrohard doors
|
||||
name: amd64 — msvc
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
|
@ -9,20 +9,16 @@ platform:
|
|||
os: windows
|
||||
arch: amd64
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
steps:
|
||||
- name: clone
|
||||
environment:
|
||||
HOME: C:\Users\username\
|
||||
- name: greeting
|
||||
commands:
|
||||
- echo 'Hello from Windows 10! :D'
|
||||
- name: unit tests
|
||||
shell: powershell
|
||||
commands:
|
||||
- ./tools/ci/steps/amd64/msvc/unit-tests.ps1
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: unit tests
|
||||
name: amd64 — gcc
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
|
@ -32,54 +28,18 @@ steps:
|
|||
image: unit_tests:latest
|
||||
pull: if-not-exists
|
||||
commands:
|
||||
- |
|
||||
set -e
|
||||
- ./tools/ci/steps/amd64/gcc/unit-tests.sh
|
||||
|
||||
conan build . \
|
||||
-c tools.system.package_manager:mode=install \
|
||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||
-s build_type=Release \
|
||||
-o enable_static_analysis=False \
|
||||
-o enable_tests=True \
|
||||
-o use_mold=True \
|
||||
--build=missing
|
||||
|
||||
for test in $(find ./build -type f -name '*_tests' -executable); do
|
||||
echo "Running $test"
|
||||
"$test"
|
||||
done
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: valgrind
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
|
||||
steps:
|
||||
- name: valgrind
|
||||
image: valgrind:latest
|
||||
pull: if-not-exists
|
||||
commands:
|
||||
- |
|
||||
set -e
|
||||
|
||||
conan build . \
|
||||
-c tools.system.package_manager:mode=install \
|
||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||
-s build_type=Release \
|
||||
-o enable_static_analysis=False \
|
||||
-o enable_tests=True \
|
||||
-o use_mold=True \
|
||||
--build=missing
|
||||
|
||||
find ./build -type f -name "*_tests" -executable | xargs -I {} bash -c 'valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --error-exitcode=255 {}' || exit 1
|
||||
- ./tools/ci/steps/amd64/gcc/valgrind.sh
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: leak sanitizer
|
||||
name: amd64 — clang
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
|
@ -89,27 +49,7 @@ steps:
|
|||
image: leak_sanitizer:latest
|
||||
pull: if-not-exists
|
||||
commands:
|
||||
- |
|
||||
set -e
|
||||
|
||||
conan build . \
|
||||
-c tools.system.package_manager:mode=install \
|
||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||
-c tools.build:cxxflags='["-g", "-fno-omit-frame-pointer", "-nostdinc++", "-isystem", "/libcxx_lsan/include/c++/v1/", "-fsanitize=leak"]' \
|
||||
-c tools.build:sharedlinkflags='["-L/libcxx_lsan/lib", "-Wl,-rpath,/libcxx_lsan/lib", "-lc++", "-lc++abi", "-fsanitize=leak"]' \
|
||||
-c tools.build:exelinkflags='["-L/libcxx_lsan/lib", "-Wl,-rpath,/libcxx_lsan/lib", "-lc++", "-lc++abi", "-fsanitize=leak"]' \
|
||||
-c tools.info.package_id:confs='["tools.build:cxxflags","tools.build:sharedlinkflags","tools.build:exelinkflags"]' \
|
||||
-c tools.build:compiler_executables='{"c": "clang", "cpp": "clang++"}' \
|
||||
-s build_type=Release \
|
||||
-s compiler=clang \
|
||||
-s compiler.version=20 \
|
||||
-s compiler.libcxx=libc++ \
|
||||
-o use_mold=True \
|
||||
--build=missing
|
||||
for test in $(find ./build -type f -name '*_tests' -executable); do
|
||||
echo "Running $test"
|
||||
"$test"
|
||||
done
|
||||
- ./tools/ci/steps/amd64/clang/lsan.sh
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
|
@ -125,20 +65,12 @@ steps:
|
|||
pull: if-not-exists
|
||||
privileged: true
|
||||
commands:
|
||||
- |
|
||||
conan build . \
|
||||
-c tools.system.package_manager:mode=install \
|
||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||
-s build_type=Release \
|
||||
-o enable_static_analysis=True \
|
||||
-o enable_tests=True \
|
||||
-o use_mold=True \
|
||||
--build=missing
|
||||
- ./tools/ci/steps/static_analysis.sh
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: clang format
|
||||
name: style
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
|
@ -148,21 +80,4 @@ steps:
|
|||
image: clang_format:latest
|
||||
pull: if-not-exists
|
||||
commands:
|
||||
- |
|
||||
set -e
|
||||
clang-format --version
|
||||
has_fomatting_issues=0
|
||||
|
||||
for file in $(find ./modules -name '*.?pp'); do
|
||||
echo "Checking format for $file"
|
||||
if ! clang-format --dry-run --Werror "$file"; then
|
||||
echo "❌ Formatting issue detected in $file"
|
||||
has_fomatting_issues=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$has_fomatting_issues" -eq 0 ]; then
|
||||
echo "✅ All files are properly formatted! Well done! ^~^"
|
||||
fi
|
||||
|
||||
exit ${has_fomatting_issues}
|
||||
- ./tools/ci/steps/style.sh
|
||||
|
|
|
@ -82,14 +82,15 @@ void AssetBrowserPanel::on_user_interface_update()
|
|||
}
|
||||
|
||||
// Button
|
||||
const auto path_str = path.string();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::PushID(path.c_str());
|
||||
ImGui::PushID(path_str.c_str());
|
||||
switch (asset_type)
|
||||
{
|
||||
// Directory
|
||||
case AssetType::directory:
|
||||
if (ImGui::ImageButton(
|
||||
path.c_str(),
|
||||
path_str.c_str(),
|
||||
m_directory_texture->get_texture(),
|
||||
ImVec2(m_file_size, m_file_size)
|
||||
))
|
||||
|
@ -101,7 +102,7 @@ void AssetBrowserPanel::on_user_interface_update()
|
|||
// Scene
|
||||
case AssetType::scene:
|
||||
if (ImGui::ImageButton(
|
||||
path.c_str(),
|
||||
path_str.c_str(),
|
||||
m_scene_texture->get_texture(),
|
||||
ImVec2(m_file_size, m_file_size)
|
||||
))
|
||||
|
@ -115,7 +116,7 @@ void AssetBrowserPanel::on_user_interface_update()
|
|||
// Image
|
||||
case AssetType::image:
|
||||
if (ImGui::ImageButton(
|
||||
path.c_str(),
|
||||
path_str.c_str(),
|
||||
m_image_texture->get_texture(),
|
||||
ImVec2(m_file_size, m_file_size)
|
||||
))
|
||||
|
@ -126,7 +127,7 @@ void AssetBrowserPanel::on_user_interface_update()
|
|||
// Text
|
||||
case AssetType::text:
|
||||
if (ImGui::ImageButton(
|
||||
path.c_str(),
|
||||
path_str.c_str(),
|
||||
m_text_texture->get_texture(),
|
||||
ImVec2(m_file_size, m_file_size)
|
||||
))
|
||||
|
|
3
modules/ui/private/gl/.clang-tidy
Normal file
3
modules/ui/private/gl/.clang-tidy
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Disable all checks in this subdirectory
|
||||
Checks: '-*'
|
||||
|
3
modules/ui/private/glfw/.clang-tidy
Normal file
3
modules/ui/private/glfw/.clang-tidy
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Disable all checks in this subdirectory
|
||||
Checks: '-*'
|
||||
|
25
tools/ci/steps/amd64/clang/lsan.sh
Executable file
25
tools/ci/steps/amd64/clang/lsan.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd $(git rev-parse --show-toplevel)/
|
||||
rm -rf ./build
|
||||
|
||||
conan build . \
|
||||
-c tools.system.package_manager:mode=install \
|
||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||
-c tools.build:cxxflags='["-g", "-fno-omit-frame-pointer", "-nostdinc++", "-isystem", "/libcxx_lsan/include/c++/v1/", "-fsanitize=leak"]' \
|
||||
-c tools.build:sharedlinkflags='["-L/libcxx_lsan/lib", "-Wl,-rpath,/libcxx_lsan/lib", "-lc++", "-lc++abi", "-fsanitize=leak"]' \
|
||||
-c tools.build:exelinkflags='["-L/libcxx_lsan/lib", "-Wl,-rpath,/libcxx_lsan/lib", "-lc++", "-lc++abi", "-fsanitize=leak"]' \
|
||||
-c tools.info.package_id:confs='["tools.build:cxxflags","tools.build:sharedlinkflags","tools.build:exelinkflags"]' \
|
||||
-c tools.build:compiler_executables='{"c": "clang", "cpp": "clang++"}' \
|
||||
-s build_type=Release \
|
||||
-s compiler=clang \
|
||||
-s compiler.version=20 \
|
||||
-s compiler.libcxx=libc++ \
|
||||
-o use_mold=True \
|
||||
--build=missing
|
||||
|
||||
for test in $(find ./build -type f -name '*_tests' -executable); do
|
||||
echo "Running $test"
|
||||
"$test"
|
||||
done
|
18
tools/ci/steps/amd64/gcc/unit-tests.sh
Executable file
18
tools/ci/steps/amd64/gcc/unit-tests.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd $(git rev-parse --show-toplevel)/
|
||||
rm -rf ./build
|
||||
|
||||
conan build . \
|
||||
-c tools.system.package_manager:mode=install \
|
||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||
-s build_type=Release \
|
||||
-o enable_tests=True \
|
||||
-o use_mold=True \
|
||||
--build=missing
|
||||
|
||||
for test in $(find ./build -type f -name '*_tests' -executable); do
|
||||
echo "Running $test"
|
||||
"$test"
|
||||
done
|
15
tools/ci/steps/amd64/gcc/valgrind.sh
Executable file
15
tools/ci/steps/amd64/gcc/valgrind.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd $(git rev-parse --show-toplevel)/
|
||||
rm -rf ./build
|
||||
|
||||
conan build . \
|
||||
-c tools.system.package_manager:mode=install \
|
||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||
-s build_type=Release \
|
||||
-o enable_tests=True \
|
||||
-o use_mold=True \
|
||||
--build=missing
|
||||
|
||||
find ./build -type f -name "*_tests" -executable | xargs -I {} bash -c 'valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --error-exitcode=255 {}' || exit 1
|
16
tools/ci/steps/amd64/msvc/unit-tests.ps1
Normal file
16
tools/ci/steps/amd64/msvc/unit-tests.ps1
Normal file
|
@ -0,0 +1,16 @@
|
|||
conan profile detect
|
||||
conan build . -s compiler.cppstd=20 -s build_type=Release
|
||||
|
||||
$tests = Get-ChildItem -Path "./build" -Recurse -File | Where-Object {
|
||||
$_.Name -like "*_tests.exe"
|
||||
}
|
||||
|
||||
foreach ($test in $tests) {
|
||||
Write-Host "Running $($test.FullName)"
|
||||
& $test.FullName
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Test $($test.Name) failed! T_T"
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
}
|
||||
|
14
tools/ci/steps/static_analysis.sh
Executable file
14
tools/ci/steps/static_analysis.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd $(git rev-parse --show-toplevel)/
|
||||
rm -rf ./build
|
||||
|
||||
conan build . \
|
||||
-c tools.system.package_manager:mode=install \
|
||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||
-s build_type=Release \
|
||||
-o enable_static_analysis=True \
|
||||
-o enable_tests=True \
|
||||
-o use_mold=True \
|
||||
--build=missing
|
19
tools/ci/steps/style.sh
Executable file
19
tools/ci/steps/style.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd $(git rev-parse --show-toplevel)/
|
||||
|
||||
has_fomatting_issues=0
|
||||
for file in $(find ./modules -name '*.?pp'); do
|
||||
echo "Checking format for $file"
|
||||
if ! clang-format --dry-run --Werror "$file"; then
|
||||
echo "❌ Formatting issue detected in $file"
|
||||
has_fomatting_issues=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$has_fomatting_issues" -eq 0 ]; then
|
||||
echo "✅ All files are properly formatted! Well done! ^~^"
|
||||
fi
|
||||
|
||||
exit ${has_fomatting_issues}
|
|
@ -20,4 +20,8 @@ echo "==> Building image: valgrind"
|
|||
cd "$IMAGE_DIR/valgrind"
|
||||
docker build -t valgrind .
|
||||
|
||||
echo "==> Building image: leak_sanitizer"
|
||||
cd "$IMAGE_DIR/leak_sanitizer"
|
||||
docker build -t leak_sanitizer .
|
||||
|
||||
echo "WOOOOOOOOOOOOOOOOH!!! DONE :D"
|
||||
|
|
Loading…
Add table
Reference in a new issue