Skip to content

Commit

Permalink
Unify classes vkb::CommandBuffer and vkb::core::HPPCommandBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
asuessenbach committed Jan 8, 2025
1 parent 04f03b3 commit 2225837
Show file tree
Hide file tree
Showing 107 changed files with 2,153 additions and 2,595 deletions.
5 changes: 1 addition & 4 deletions framework/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2024, Arm Limited and Contributors
# Copyright (c) 2019-2025, Arm Limited and Contributors
#
# SPDX-License-Identifier: Apache-2.0
#
Expand Down Expand Up @@ -251,7 +251,6 @@ set(CORE_FILES
core/render_pass.h
core/query_pool.h
core/acceleration_structure.h
core/hpp_command_buffer.h
core/hpp_command_pool.h
core/hpp_debug.h
core/hpp_descriptor_pool.h
Expand Down Expand Up @@ -287,7 +286,6 @@ set(CORE_FILES
core/queue.cpp
core/command_pool.cpp
core/swapchain.cpp
core/command_buffer.cpp
core/allocated.cpp
core/image_core.cpp
core/image_view.cpp
Expand All @@ -298,7 +296,6 @@ set(CORE_FILES
core/render_pass.cpp
core/query_pool.cpp
core/acceleration_structure.cpp
core/hpp_command_buffer.cpp
core/hpp_command_pool.cpp
core/hpp_debug.cpp
core/hpp_device.cpp
Expand Down
6 changes: 3 additions & 3 deletions framework/api_vulkan_sample.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Copyright (c) 2019-2024, Sascha Willems
* Copyright (c) 2024, Arm Limited and Contributors
/* Copyright (c) 2019-2025, Sascha Willems
* Copyright (c) 2024-2025, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -1344,7 +1344,7 @@ void ApiVulkanSample::with_command_buffer(const std::function<void(VkCommandBuff
get_device().flush_command_buffer(command_buffer, queue, true, signalSemaphore);
}

void ApiVulkanSample::with_vkb_command_buffer(const std::function<void(vkb::CommandBuffer &command_buffer)> &f)
void ApiVulkanSample::with_vkb_command_buffer(const std::function<void(vkb::core::CommandBufferC &command_buffer)> &f)
{
auto &cmd = get_device().request_command_buffer();
cmd.begin(VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, VK_NULL_HANDLE);
Expand Down
4 changes: 2 additions & 2 deletions framework/api_vulkan_sample.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019-2024, Sascha Willems
/* Copyright (c) 2019-2025, Sascha Willems
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -257,7 +257,7 @@ class ApiVulkanSample : public vkb::VulkanSampleC
* @brief Synchronously execute a block code within a command buffer vkb wrapper, then submit the command buffer and wait for completion.
* @param f a block of code which is passed a command buffer which is already in the begin state.
*/
void with_vkb_command_buffer(const std::function<void(vkb::CommandBuffer &command_buffer)> &f);
void with_vkb_command_buffer(const std::function<void(vkb::core::CommandBufferC &command_buffer)> &f);

public:
/**
Expand Down
7 changes: 3 additions & 4 deletions framework/buffer_pool.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Copyright (c) 2019-2024, Arm Limited and Contributors
* Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
/* Copyright (c) 2019-2025, Arm Limited and Contributors
* Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -19,8 +19,7 @@
#pragma once

#include "core/buffer.h"
#include "core/device.h"
#include "core/hpp_device.h"
#include "core/hpp_physical_device.h"

namespace vkb
{
Expand Down
10 changes: 8 additions & 2 deletions framework/common/hpp_resource_caching.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2023-2024, NVIDIA CORPORATION. All rights reserved.
/* Copyright (c) 2023-2025, NVIDIA CORPORATION. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -17,8 +17,14 @@

#pragma once

#include "common/hpp_vk_common.h"
#include "core/hpp_descriptor_set.h"
#include "core/hpp_image_view.h"
#include "core/hpp_render_pass.h"
#include "core/hpp_shader_module.h"
#include "hpp_resource_record.h"
#include "rendering/hpp_render_target.h"
#include "resource_caching.h"
#include <core/hpp_device.h>
#include <vulkan/vulkan_hash.hpp>

namespace std
Expand Down
4 changes: 1 addition & 3 deletions framework/common/utils.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2018-2024, Arm Limited and Contributors
/* Copyright (c) 2018-2025, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -43,8 +43,6 @@ std::string get_extension(const std::string &uri);
*/
std::string to_snake_case(const std::string &name);

class CommandBuffer;

/**
* @brief Takes a screenshot of the app by writing the swapchain image to file (slow function)
* @param render_context The RenderContext to use
Expand Down
13 changes: 10 additions & 3 deletions framework/common/vk_common.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Copyright (c) 2018-2024, Arm Limited and Contributors
* Copyright (c) 2019-2024, Sascha Willems
* Copyright (c) 2024, Mobica Limited
/* Copyright (c) 2018-2025, Arm Limited and Contributors
* Copyright (c) 2019-2025, Sascha Willems
* Copyright (c) 2024-2025, Mobica Limited
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -47,6 +47,13 @@ enum class BindingType
Cpp
};

enum class CommandBufferResetMode
{
ResetPool,
ResetIndividually,
AlwaysAllocate,
};

/**
* @brief Helper function to determine if a Vulkan format is depth only.
* @param format Vulkan format to check.
Expand Down
Loading

0 comments on commit 2225837

Please sign in to comment.