mirror of
https://gitlab.freedesktop.org/mesa/vulkan-wsi-layer.git
synced 2026-05-05 16:58:06 +02:00
Fix conversion warnings generated by clang-tidy
Fixes warnings: - hicpp-use-auto - clang-diagnostic-shorten-64-to-32 - clang-diagnostic-sign-conversion in dispatch_table calls Signed-off-by: Alex Bates <alex.bates@arm.com> Change-Id: I0e8fd6ef36b659b8b44419cda26b54d473c224e8
This commit is contained in:
parent
e50742db3c
commit
ad61e4292d
5 changed files with 16 additions and 14 deletions
|
|
@ -76,14 +76,14 @@ VkResult image_backing_memory_device::allocate_and_bind(VkImage image)
|
|||
|
||||
TRY(disp_table.AllocateMemory(m_device_data.device, &mem_info, m_allocator.get_original_callbacks(),
|
||||
&m_device_memory));
|
||||
TRY(disp_table.BindImageMemory(m_device_data.device, image, m_device_memory, 0));
|
||||
TRY(disp_table.BindImageMemory(m_device_data.device, image, m_device_memory, 0ull));
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult image_backing_memory_device::bind(const VkBindImageMemoryInfo *bind_image_mem_info)
|
||||
{
|
||||
return m_device_data.disp.BindImageMemory(m_device_data.device, bind_image_mem_info->image, m_device_memory, 0);
|
||||
return m_device_data.disp.BindImageMemory(m_device_data.device, bind_image_mem_info->image, m_device_memory, 0ull);
|
||||
}
|
||||
|
||||
uint64_t image_backing_memory_device::get_modifier() const
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ VkResult surface_properties_formats_helper(It begin, It end, uint32_t *surface_f
|
|||
|
||||
const auto distance = std::distance(begin, end);
|
||||
assert(distance >= 0);
|
||||
const uint32_t supported_formats_count = static_cast<uint32_t>(distance);
|
||||
const auto supported_formats_count = static_cast<uint32_t>(distance);
|
||||
if (surface_formats == nullptr && extended_surface_formats == nullptr)
|
||||
{
|
||||
*surface_formats_count = supported_formats_count;
|
||||
|
|
@ -309,17 +309,20 @@ VkResult get_surface_present_modes_common(uint32_t *present_mode_count, VkPresen
|
|||
|
||||
assert(present_mode_count != nullptr);
|
||||
|
||||
assert(modes.size() <= UINT32_MAX);
|
||||
const auto modes_count = static_cast<uint32_t>(modes.size());
|
||||
|
||||
if (nullptr == present_modes)
|
||||
{
|
||||
*present_mode_count = modes.size();
|
||||
*present_mode_count = modes_count;
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
if (modes.size() > *present_mode_count)
|
||||
if (modes_count > *present_mode_count)
|
||||
{
|
||||
res = VK_INCOMPLETE;
|
||||
}
|
||||
*present_mode_count = std::min(*present_mode_count, static_cast<uint32_t>(modes.size()));
|
||||
*present_mode_count = std::min(*present_mode_count, modes_count);
|
||||
for (uint32_t i = 0; i < *present_mode_count; ++i)
|
||||
{
|
||||
present_modes[i] = modes[i];
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ VkResult swapchain_base::init(VkDevice device, const VkSwapchainCreateInfoKHR *s
|
|||
* Vulkan spec, vkGetDeviceQueue2 should be used to get queues
|
||||
* that were created with non zero flags parameters.
|
||||
*/
|
||||
m_device_data.disp.GetDeviceQueue(m_device, 0, 0, &m_queue);
|
||||
m_device_data.disp.GetDeviceQueue(m_device, 0u, 0u, &m_queue);
|
||||
TRY_LOG_CALL(m_device_data.SetDeviceLoaderData(m_device, m_queue));
|
||||
}
|
||||
|
||||
|
|
@ -531,8 +531,7 @@ VkResult swapchain_base::get_swapchain_images(uint32_t *swapchain_image_count, V
|
|||
|
||||
current_image++;
|
||||
|
||||
const uint32_t total_images = static_cast<uint32_t>(m_swapchain_images.size());
|
||||
if (current_image == total_images)
|
||||
if (current_image == static_cast<uint32_t>(m_swapchain_images.size()))
|
||||
{
|
||||
*swapchain_image_count = current_image;
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ VkResult fence_sync::wait_payload(uint64_t timeout)
|
|||
VkResult res = VK_SUCCESS;
|
||||
if (has_payload && !payload_finished)
|
||||
{
|
||||
res = dev->disp.WaitForFences(dev->device, 1, &fence, VK_TRUE, timeout);
|
||||
res = dev->disp.WaitForFences(dev->device, 1u, &fence, VK_TRUE, timeout);
|
||||
if (res == VK_SUCCESS)
|
||||
{
|
||||
payload_finished = true;
|
||||
|
|
@ -112,7 +112,7 @@ VkResult fence_sync::wait_payload(uint64_t timeout)
|
|||
|
||||
VkResult fence_sync::set_payload(VkQueue queue, const queue_submit_semaphores &semaphores, const void *submission_pnext)
|
||||
{
|
||||
VkResult result = dev->disp.ResetFences(dev->device, 1, &fence);
|
||||
VkResult result = dev->disp.ResetFences(dev->device, 1u, &fence);
|
||||
if (result != VK_SUCCESS)
|
||||
{
|
||||
return result;
|
||||
|
|
@ -257,7 +257,7 @@ VkResult sync_queue_submit(const layer::device_private_data &device, VkQueue que
|
|||
pipeline_stage_flags_vector.data(), command_buffer_data.m_command_buffer_count,
|
||||
command_buffer_data.m_command_buffers, semaphores.signal_semaphores_count,
|
||||
semaphores.signal_semaphores };
|
||||
TRY(device.disp.QueueSubmit(queue, 1, &submit_info, fence));
|
||||
TRY(device.disp.QueueSubmit(queue, 1u, &submit_info, fence));
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
} /* namespace wsi */
|
||||
|
|
|
|||
|
|
@ -333,8 +333,8 @@ wayland_owner<wl_buffer> swapchain::create_wl_buffer(image_backing_memory_extern
|
|||
/* create a wl_buffer using the dma_buf protocol */
|
||||
zwp_linux_buffer_params_v1 *params = zwp_linux_dmabuf_v1_create_params(m_wsi_surface->get_dmabuf_interface());
|
||||
const uint64_t modifier = image_external_memory.get_image_create_info().selected_format.modifier;
|
||||
const uint32_t modifier_hi = static_cast<uint32_t>(image_external_memory.get_image_create_info().selected_format.modifier >> 32);
|
||||
const uint32_t modifier_low = static_cast<uint32_t>(modifier & 0xFFFFFFFF);
|
||||
const auto modifier_hi = static_cast<uint32_t>(modifier >> 32);
|
||||
const auto modifier_low = static_cast<uint32_t>(modifier & 0xFFFFFFFF);
|
||||
for (uint32_t plane = 0; plane < ext_memory.get_num_planes(); plane++)
|
||||
{
|
||||
zwp_linux_buffer_params_v1_add(params, ext_memory.get_buffer_fds()[plane], plane, ext_memory.get_offsets()[plane],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue