Skip to content

Commit

Permalink
Refactor Semaphore related functions
Browse files Browse the repository at this point in the history
Summary: To match up with how we setup VulkanFence functions in the previous diff

Reviewed By: corporateshark

Differential Revision: D50044925

fbshipit-source-id: 0edba6c723cc5ff5804ab864333efc03aab1946f
  • Loading branch information
Shayan Javed authored and facebook-github-bot committed Oct 7, 2023
1 parent 613b8e4 commit 67dd794
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/igl/vulkan/VulkanHelpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ uint32_t ivkFindMemoryType(const struct VulkanFunctionTable* vt,

VkResult ivkCreateSemaphore(const struct VulkanFunctionTable* vt,
VkDevice device,
VkSemaphore* outSemaphore,
bool exportable) {
bool exportable,
VkSemaphore* outSemaphore) {
const VkExportSemaphoreCreateInfo exportInfo = {
.sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO,
.pNext = NULL,
Expand Down
4 changes: 2 additions & 2 deletions src/igl/vulkan/VulkanHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ VkResult ivkCreateDebugReportMessenger(const struct VulkanFunctionTable* vt,

VkResult ivkCreateSemaphore(const struct VulkanFunctionTable* vt,
VkDevice device,
VkSemaphore* outSemaphore,
bool exportable);
bool exportable,
VkSemaphore* outSemaphore);

VkResult ivkCreateFence(const struct VulkanFunctionTable* vt,
VkDevice device,
Expand Down
3 changes: 2 additions & 1 deletion src/igl/vulkan/VulkanImmediateCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ VulkanImmediateCommands::VulkanImmediateCommands(const VulkanFunctionTable& vf,
VkFenceCreateFlagBits{},
exportableFences,
IGL_FORMAT("Fence: commandBuffer #{}", i).c_str()),
VulkanSemaphore(vf_, device, IGL_FORMAT("Semaphore: {} ({})", debugName, i).c_str()));
VulkanSemaphore(
vf_, device, false, IGL_FORMAT("Semaphore: {} ({})", debugName, i).c_str()));
VK_ASSERT(ivkAllocateCommandBuffer(
&vf_, device_, commandPool_.getVkCommandPool(), &buffers_[i].cmdBufAllocated_));
buffers_[i].handle_.bufferIndex_ = i;
Expand Down
6 changes: 3 additions & 3 deletions src/igl/vulkan/VulkanSemaphore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ namespace igl::vulkan {

VulkanSemaphore::VulkanSemaphore(const VulkanFunctionTable& vf,
VkDevice device,
const char* debugName,
bool exportable) :
bool exportable,
const char* debugName) :
vf_(&vf), device_(device) {
IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_CREATE);

VK_ASSERT(ivkCreateSemaphore(vf_, device_, &vkSemaphore_, exportable));
VK_ASSERT(ivkCreateSemaphore(vf_, device_, exportable, &vkSemaphore_));
VK_ASSERT(ivkSetDebugObjectName(
vf_, device_, VK_OBJECT_TYPE_SEMAPHORE, (uint64_t)vkSemaphore_, debugName));
}
Expand Down
4 changes: 2 additions & 2 deletions src/igl/vulkan/VulkanSemaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class VulkanSemaphore final {
public:
explicit VulkanSemaphore(const VulkanFunctionTable& vf,
VkDevice device,
const char* debugName = nullptr,
bool exportable = false);
bool exportable = false,
const char* debugName = nullptr);
~VulkanSemaphore();

VulkanSemaphore(VulkanSemaphore&& other) noexcept;
Expand Down

0 comments on commit 67dd794

Please sign in to comment.