Skip to content

Commit

Permalink
Fix some compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejnau committed Nov 28, 2023
1 parent f163129 commit 2bac18c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/FlyCube/CommandQueue/VKCommandQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void VKCommandQueue::Wait(const std::shared_ptr<Fence>& fence, uint64_t value)
signal_submit_info.pWaitSemaphores = &vk_fence.GetFence();
vk::PipelineStageFlags wait_dst_stage_mask = vk::PipelineStageFlagBits::eAllCommands;
signal_submit_info.pWaitDstStageMask = &wait_dst_stage_mask;
m_queue.submit(1, &signal_submit_info, {});
std::ignore = m_queue.submit(1, &signal_submit_info, {});
}

void VKCommandQueue::Signal(const std::shared_ptr<Fence>& fence, uint64_t value)
Expand All @@ -38,7 +38,7 @@ void VKCommandQueue::Signal(const std::shared_ptr<Fence>& fence, uint64_t value)
signal_submit_info.pNext = &timeline_info;
signal_submit_info.signalSemaphoreCount = 1;
signal_submit_info.pSignalSemaphores = &vk_fence.GetFence();
m_queue.submit(1, &signal_submit_info, {});
std::ignore = m_queue.submit(1, &signal_submit_info, {});
}

void VKCommandQueue::ExecuteCommandLists(const std::vector<std::shared_ptr<CommandList>>& command_lists)
Expand All @@ -59,7 +59,7 @@ void VKCommandQueue::ExecuteCommandLists(const std::vector<std::shared_ptr<Comma
vk::PipelineStageFlags wait_dst_stage_mask = vk::PipelineStageFlagBits::eAllCommands;
submit_info.pWaitDstStageMask = &wait_dst_stage_mask;

m_queue.submit(1, &submit_info, {});
std::ignore = m_queue.submit(1, &submit_info, {});
}

VKDevice& VKCommandQueue::GetDevice()
Expand Down
2 changes: 1 addition & 1 deletion src/FlyCube/Fence/VKTimelineSemaphore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void VKTimelineSemaphore::Wait(uint64_t value)
wait_info.semaphoreCount = 1;
wait_info.pSemaphores = &m_timeline_semaphore.get();
wait_info.pValues = &value;
m_device.GetDevice().waitSemaphoresKHR(wait_info, UINT64_MAX);
std::ignore = m_device.GetDevice().waitSemaphoresKHR(wait_info, UINT64_MAX);
}

void VKTimelineSemaphore::Signal(uint64_t value)
Expand Down
3 changes: 2 additions & 1 deletion src/FlyCube/Resource/VKResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ void VKResource::SetName(const std::string& name)
uint8_t* VKResource::Map()
{
uint8_t* dst_data = nullptr;
m_device.GetDevice().mapMemory(m_vk_memory, 0, VK_WHOLE_SIZE, {}, reinterpret_cast<void**>(&dst_data));
std::ignore =
m_device.GetDevice().mapMemory(m_vk_memory, 0, VK_WHOLE_SIZE, {}, reinterpret_cast<void**>(&dst_data));
return dst_data;
}

Expand Down
6 changes: 3 additions & 3 deletions src/FlyCube/ShaderReflection/test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class RayTracing : public ShaderTestCase {
return m_desc;
}

void Test(ShaderBlobType type, const void* data, size_t size) const
void Test(ShaderBlobType type, const void* data, size_t size) const override
{
REQUIRE(data);
REQUIRE(size);
Expand Down Expand Up @@ -63,7 +63,7 @@ class TrianglePS : public ShaderTestCase {
return m_desc;
}

void Test(ShaderBlobType type, const void* data, size_t size) const
void Test(ShaderBlobType type, const void* data, size_t size) const override
{
REQUIRE(data);
REQUIRE(size);
Expand Down Expand Up @@ -92,7 +92,7 @@ class TriangleVS : public ShaderTestCase {
return m_desc;
}

void Test(ShaderBlobType type, const void* data, size_t size) const
void Test(ShaderBlobType type, const void* data, size_t size) const override
{
REQUIRE(data);
REQUIRE(size);
Expand Down
14 changes: 7 additions & 7 deletions src/FlyCube/Swapchain/VKSwapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ VKSwapchain::VKSwapchain(VKCommandQueue& command_queue,
ASSERT(surface_capabilities.currentExtent.height == height);

vk::Bool32 is_supported_surface = VK_FALSE;
adapter.GetPhysicalDevice().getSurfaceSupportKHR(command_queue.GetQueueFamilyIndex(), m_surface.get(),
&is_supported_surface);
std::ignore = adapter.GetPhysicalDevice().getSurfaceSupportKHR(command_queue.GetQueueFamilyIndex(), m_surface.get(),
&is_supported_surface);
ASSERT(is_supported_surface);

auto modes = adapter.GetPhysicalDevice().getSurfacePresentModesKHR(m_surface.get());
Expand Down Expand Up @@ -138,8 +138,8 @@ std::shared_ptr<Resource> VKSwapchain::GetBackBuffer(uint32_t buffer)

uint32_t VKSwapchain::NextImage(const std::shared_ptr<Fence>& fence, uint64_t signal_value)
{
m_device.GetDevice().acquireNextImageKHR(m_swapchain.get(), UINT64_MAX, m_image_available_semaphore.get(), nullptr,
&m_frame_index);
std::ignore = m_device.GetDevice().acquireNextImageKHR(m_swapchain.get(), UINT64_MAX,
m_image_available_semaphore.get(), nullptr, &m_frame_index);

decltype(auto) vk_fence = fence->As<VKTimelineSemaphore>();
uint64_t tmp = std::numeric_limits<uint64_t>::max();
Expand All @@ -156,7 +156,7 @@ uint32_t VKSwapchain::NextImage(const std::shared_ptr<Fence>& fence, uint64_t si
signal_submit_info.pWaitDstStageMask = &waitDstStageMask;
signal_submit_info.signalSemaphoreCount = 1;
signal_submit_info.pSignalSemaphores = &vk_fence.GetFence();
m_command_queue.GetQueue().submit(1, &signal_submit_info, {});
std::ignore = m_command_queue.GetQueue().submit(1, &signal_submit_info, {});

return m_frame_index;
}
Expand All @@ -178,13 +178,13 @@ void VKSwapchain::Present(const std::shared_ptr<Fence>& fence, uint64_t wait_val
signal_submit_info.pWaitDstStageMask = &waitDstStageMask;
signal_submit_info.signalSemaphoreCount = 1;
signal_submit_info.pSignalSemaphores = &m_rendering_finished_semaphore.get();
m_command_queue.GetQueue().submit(1, &signal_submit_info, {});
std::ignore = m_command_queue.GetQueue().submit(1, &signal_submit_info, {});

vk::PresentInfoKHR present_info = {};
present_info.swapchainCount = 1;
present_info.pSwapchains = &m_swapchain.get();
present_info.pImageIndices = &m_frame_index;
present_info.waitSemaphoreCount = 1;
present_info.pWaitSemaphores = &m_rendering_finished_semaphore.get();
m_command_queue.GetQueue().presentKHR(present_info);
std::ignore = m_command_queue.GetQueue().presentKHR(present_info);
}

0 comments on commit 2bac18c

Please sign in to comment.