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
20 changes: 13 additions & 7 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,24 @@ jobs:
- uses: ZedThree/clang-tidy-review@v0.21.0
id: review
with:
apt_packages: 'wget,libx11-dev'
apt_packages: 'sudo,wget,libx11-dev,xorg-dev,ca-certificates,gpg'
build_dir: build
cmake_command: | # Awful, dirty hacks to get the vulkan-sdk and cmake version we need
install_commands: | # Awful, dirty hacks to get the vulkan-sdk and cmake version we need
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | \
tee /etc/apt/trusted.gpg.d/lunarg.asc && \
wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.4.313-noble.list \
https://packages.lunarg.com/vulkan/1.4.313/lunarg-vulkan-1.4.313-noble.list && \
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ noble main'\
| sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null && \
apt update && \
apt-get -y install libvulkan-dev vulkan-headers cmake && \
cmake -Bbuild -S. -DCMAKE_EXPORT_COMPILE_COMMANDS=on
(test -f /usr/share/doc/kitware-archive-keyring/copyright || \
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null \
| gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null) && \
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ noble main' | \
sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null && \
sudo apt-get update && \
(test -f /usr/share/doc/kitware-archive-keyring/copyright || \
sudo rm /usr/share/keyrings/kitware-archive-keyring.gpg) && \
apt-get -y install kitware-archive-keyring libvulkan-dev vulkan-headers cmake
cmake_command: |
cmake -Bbuild -S. -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DGLFW_BUILD_WAYLAND=off
clang_tidy_checks: '' # Use closest .clang-tidy config, not some weird default
split_workflow: true # So that comments work with fork PRs

Expand Down
2 changes: 1 addition & 1 deletion cmake/thirdparty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ CPMAddPackage(
CPMAddPackage(
NAME etna
GITHUB_REPOSITORY AlexandrShcherbakov/etna
VERSION 1.10.1
VERSION 1.11.0
)

# Type-erased function containers that actually work
Expand Down
5 changes: 3 additions & 2 deletions samples/shadowmap/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void Renderer::drawFrame()
// but only on some platforms (not windows+nvidia, sadly).
if (nextSwapchainImage)
{
auto [image, view, availableSem] = *nextSwapchainImage;
auto [image, view, availableSem, readyForPresentSem] = *nextSwapchainImage;

ETNA_CHECK_VK_RESULT(currentCmdBuf.begin(vk::CommandBufferBeginInfo{}));
{
Expand Down Expand Up @@ -167,7 +167,8 @@ void Renderer::drawFrame()
}
ETNA_CHECK_VK_RESULT(currentCmdBuf.end());

auto renderingDone = commandManager->submit(std::move(currentCmdBuf), std::move(availableSem));
auto renderingDone = commandManager->submit(
std::move(currentCmdBuf), std::move(availableSem), std::move(readyForPresentSem));

const bool presented = window->present(std::move(renderingDone), view);

Expand Down
15 changes: 10 additions & 5 deletions tasks/local_shadertoy1/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ void App::drawFrame()
// because it kills the swapchain, so we skip frames in this case.
if (nextSwapchainImage)
{
auto [backbuffer, backbufferView, backbufferAvailableSem] = *nextSwapchainImage;
auto [backbuffer, backbufferView, backbufferAvailableSem, backbufferReadyForPresentSem] =
*nextSwapchainImage;

ETNA_CHECK_VK_RESULT(currentCmdBuf.begin(vk::CommandBufferBeginInfo{}));
{
Expand Down Expand Up @@ -158,10 +159,14 @@ void App::drawFrame()
ETNA_CHECK_VK_RESULT(currentCmdBuf.end());

// We are done recording GPU commands now and we can send them to be executed by the GPU.
// Note that the GPU won't start executing our commands before the semaphore is
// signalled, which will happen when the OS says that the next swapchain image is ready.
auto renderingDone =
commandManager->submit(std::move(currentCmdBuf), std::move(backbufferAvailableSem));
// Note that the GPU won't start executing our commands before the backbufferAvailableSem
// semaphore is signalled, which will happen when the OS says that the next swapchain image
// is ready, and the result image will be ready for present after backbufferReadyForPresent
// is signalled by GPU
auto renderingDone = commandManager->submit(
std::move(currentCmdBuf),
std::move(backbufferAvailableSem),
std::move(backbufferReadyForPresentSem));

// Finally, present the backbuffer the screen, but only after the GPU tells the OS
// that it is done executing the command buffer via the renderingDone semaphore.
Expand Down
5 changes: 3 additions & 2 deletions tasks/model_bakery/renderer/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void Renderer::drawFrame()

if (nextSwapchainImage)
{
auto [image, view, availableSem] = *nextSwapchainImage;
auto [image, view, availableSem, readyForPresentSem] = *nextSwapchainImage;

ETNA_CHECK_VK_RESULT(currentCmdBuf.begin(vk::CommandBufferBeginInfo{}));
{
Expand All @@ -123,7 +123,8 @@ void Renderer::drawFrame()
}
ETNA_CHECK_VK_RESULT(currentCmdBuf.end());

auto renderingDone = commandManager->submit(std::move(currentCmdBuf), std::move(availableSem));
auto renderingDone = commandManager->submit(
std::move(currentCmdBuf), std::move(availableSem), std::move(readyForPresentSem));

const bool presented = window->present(std::move(renderingDone), view);

Expand Down