@@ -175,7 +175,7 @@ static void vulkan_emulated_mailbox_loop(void *userdata)
175175{
176176 VkFence fence ;
177177 VkFenceCreateInfo info ;
178- struct vulkan_emulated_mailbox * mailbox =
178+ struct vulkan_emulated_mailbox * mailbox =
179179 (struct vulkan_emulated_mailbox * )userdata ;
180180
181181 if (!mailbox )
@@ -190,7 +190,7 @@ static void vulkan_emulated_mailbox_loop(void *userdata)
190190 for (;;)
191191 {
192192 slock_lock (mailbox -> lock );
193- while ( !(mailbox -> flags & VK_MAILBOX_FLAG_DEAD )
193+ while ( !(mailbox -> flags & VK_MAILBOX_FLAG_DEAD )
194194 && !(mailbox -> flags & VK_MAILBOX_FLAG_REQUEST_ACQUIRE ))
195195 scond_wait (mailbox -> cond , mailbox -> lock );
196196
@@ -207,9 +207,9 @@ static void vulkan_emulated_mailbox_loop(void *userdata)
207207 mailbox -> device , mailbox -> swapchain , UINT64_MAX ,
208208 VK_NULL_HANDLE , fence , & mailbox -> index );
209209#ifdef ANDROID
210- /* VK_SUBOPTIMAL_KHR can be returned on Android 10
210+ /* VK_SUBOPTIMAL_KHR can be returned on Android 10
211211 * when prerotate is not dealt with.
212- * This is not an error we need to care about,
212+ * This is not an error we need to care about,
213213 * and we'll treat it as SUCCESS. */
214214 if (mailbox -> result == VK_SUBOPTIMAL_KHR )
215215 mailbox -> result = VK_SUCCESS ;
@@ -569,7 +569,7 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
569569
570570 unsigned enabled_device_extension_count = 0 ;
571571
572- struct retro_hw_render_context_negotiation_interface_vulkan
572+ struct retro_hw_render_context_negotiation_interface_vulkan
573573 * iface = (struct retro_hw_render_context_negotiation_interface_vulkan * )
574574 video_st -> hw_render_context_negotiation ;
575575
@@ -593,7 +593,7 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
593593
594594 if (iface )
595595 {
596- if (iface -> interface_type != RETRO_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_VULKAN )
596+ if (iface -> interface_type != RETRO_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_VULKAN )
597597 {
598598 RARCH_WARN ("[Vulkan]: Got HW context negotiation interface, but it's the wrong API.\n" );
599599 iface = NULL ;
@@ -713,29 +713,14 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
713713 RARCH_LOG ("[Vulkan]: Using GPU: \"%s\".\n" , vk -> context .gpu_properties .deviceName );
714714
715715 {
716- char device_str [128 ];
717716 char version_str [128 ];
718- size_t len = strlcpy (device_str , vk -> context .gpu_properties .deviceName , sizeof (device_str ));
719- device_str [len ] = ' ' ;
720- device_str [++ len ] = '\0' ;
721-
722- len += snprintf (device_str + len , sizeof (device_str ) - len , "%u" , VK_VERSION_MAJOR (vk -> context .gpu_properties .driverVersion ));
723- device_str [len ] = '.' ;
724- device_str [++ len ] = '\0' ;
725- len += snprintf (device_str + len , sizeof (device_str ) - len , "%u" , VK_VERSION_MINOR (vk -> context .gpu_properties .driverVersion ));
726- device_str [len ] = '.' ;
727- device_str [++ len ] = '\0' ;
728- snprintf (device_str + len , sizeof (device_str ) - len , "%u" , VK_VERSION_PATCH (vk -> context .gpu_properties .driverVersion ));
729-
730- len = snprintf (version_str , sizeof (version_str ) , "%u" , VK_VERSION_MAJOR (vk -> context .gpu_properties .apiVersion ));
731- version_str [len ] = '.' ;
717+ size_t len = snprintf (version_str , sizeof (version_str ) , "%u" , VK_VERSION_MAJOR (vk -> context .gpu_properties .apiVersion ));
718+ version_str [ len ] = '.' ;
732719 version_str [++ len ] = '\0' ;
733720 len += snprintf (version_str + len , sizeof (version_str ) - len , "%u" , VK_VERSION_MINOR (vk -> context .gpu_properties .apiVersion ));
734- version_str [len ] = '.' ;
721+ version_str [ len ] = '.' ;
735722 version_str [++ len ] = '\0' ;
736723 snprintf (version_str + len , sizeof (version_str ) - len , "%u" , VK_VERSION_PATCH (vk -> context .gpu_properties .apiVersion ));
737-
738- video_driver_set_gpu_device_string (device_str );
739724 video_driver_set_gpu_api_version_string (version_str );
740725 }
741726
@@ -1126,7 +1111,7 @@ static bool vulkan_create_display_surface(gfx_ctx_vulkan_data_t *vk,
11261111 vkGetDisplayPlaneCapabilitiesKHR (vk -> context .gpu ,
11271112 best_mode , i , & plane_caps );
11281113
1129- if ( plane_caps .supportedAlpha
1114+ if ( plane_caps .supportedAlpha
11301115 & VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR )
11311116 {
11321117 best_plane = j ;
@@ -1257,7 +1242,7 @@ static VkSemaphore vulkan_get_wsi_acquire_semaphore(struct vulkan_context *ctx)
12571242 if (ctx -> num_recycled_acquire_semaphores == 0 )
12581243 {
12591244 VkSemaphoreCreateInfo sem_info ;
1260-
1245+
12611246 sem_info .sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO ;
12621247 sem_info .pNext = NULL ;
12631248 sem_info .flags = 0 ;
@@ -1756,7 +1741,7 @@ void vulkan_acquire_next_image(gfx_ctx_vulkan_data_t *vk)
17561741 fence_info .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO ;
17571742 fence_info .pNext = NULL ;
17581743 fence_info .flags = 0 ;
1759-
1744+
17601745 sem_info .sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO ;
17611746 sem_info .pNext = NULL ;
17621747 sem_info .flags = 0 ;
@@ -1811,9 +1796,9 @@ void vulkan_acquire_next_image(gfx_ctx_vulkan_data_t *vk)
18111796 vk -> swapchain , UINT64_MAX ,
18121797 semaphore , fence , & vk -> context .current_swapchain_index );
18131798#ifdef ANDROID
1814- /* VK_SUBOPTIMAL_KHR can be returned on Android 10
1799+ /* VK_SUBOPTIMAL_KHR can be returned on Android 10
18151800 * when prerotate is not dealt with.
1816- * This is not an error we need to care about, and
1801+ * This is not an error we need to care about, and
18171802 * we'll treat it as SUCCESS. */
18181803 if (err == VK_SUBOPTIMAL_KHR )
18191804 err = VK_SUCCESS ;
@@ -1973,7 +1958,7 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
19731958 && (vk -> mailbox .swapchain != VK_NULL_HANDLE ))
19741959 {
19751960 VkResult res = VK_SUCCESS ;
1976- /* We are tearing down, and entering a state
1961+ /* We are tearing down, and entering a state
19771962 * where we are supposed to have
19781963 * acquired an image, so block until we have acquired. */
19791964 if (! (vk -> context .flags & VK_CTX_FLAG_HAS_ACQUIRED_SWAPCHAIN ))
@@ -2026,7 +2011,7 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
20262011 vk -> context .swap_interval = swap_interval ;
20272012 for (i = 0 ; i < present_mode_count ; i ++ )
20282013 {
2029- if ( !swap_interval
2014+ if ( !swap_interval
20302015 && (present_modes [i ] == VK_PRESENT_MODE_MAILBOX_KHR ))
20312016 {
20322017 swapchain_present_mode = VK_PRESENT_MODE_MAILBOX_KHR ;
@@ -2038,7 +2023,7 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
20382023 swapchain_present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR ;
20392024 break ;
20402025 }
2041- else if ( swap_interval
2026+ else if ( swap_interval
20422027 && (present_modes [i ] == VK_PRESENT_MODE_FIFO_KHR ))
20432028 {
20442029 /* Kind of tautological since FIFO must always be present. */
@@ -2058,7 +2043,7 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
20582043 vk -> vk_surface , & format_count , formats );
20592044
20602045 format .format = VK_FORMAT_UNDEFINED ;
2061- if ( format_count == 1
2046+ if ( format_count == 1
20622047 && (formats [0 ].format == VK_FORMAT_UNDEFINED ))
20632048 {
20642049 format = formats [0 ];
@@ -2070,7 +2055,7 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
20702055 {
20712056 RARCH_ERR ("[Vulkan]: Surface has no formats.\n" );
20722057 return false;
2073- }
2058+ }
20742059
20752060#ifdef VULKAN_HDR_SWAPCHAIN
20762061 if (settings -> bools .video_hdr_enable )
@@ -2206,7 +2191,7 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
22062191 info .imageExtent .height = swapchain_size .height ;
22072192 info .imageArrayLayers = 1 ;
22082193 info .imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
2209- | VK_IMAGE_USAGE_TRANSFER_SRC_BIT
2194+ | VK_IMAGE_USAGE_TRANSFER_SRC_BIT
22102195 | VK_IMAGE_USAGE_TRANSFER_DST_BIT ;
22112196 info .imageSharingMode = VK_SHARING_MODE_EXCLUSIVE ;
22122197 info .queueFamilyIndexCount = 0 ;
@@ -2298,7 +2283,7 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
22982283 PFN_vkGetInstanceProcAddr GetInstanceProcAddr ;
22992284 const char * prog_name = NULL ;
23002285 video_driver_state_t * video_st = video_state_get_ptr ();
2301- struct retro_hw_render_context_negotiation_interface_vulkan
2286+ struct retro_hw_render_context_negotiation_interface_vulkan
23022287 * iface = (struct retro_hw_render_context_negotiation_interface_vulkan * )video_st -> hw_render_context_negotiation ;
23032288
23042289 if (iface && iface -> interface_type != RETRO_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_VULKAN )
@@ -2418,8 +2403,8 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
24182403 }
24192404 else
24202405 {
2421- if ( iface
2422- && iface -> interface_version >= 2
2406+ if ( iface
2407+ && iface -> interface_version >= 2
24232408 && iface -> create_instance )
24242409 vk -> context .instance = iface -> create_instance (
24252410 GetInstanceProcAddr , & app ,
@@ -2495,7 +2480,7 @@ void vulkan_context_destroy(gfx_ctx_vulkan_data_t *vk,
24952480
24962481 vulkan_destroy_swapchain (vk );
24972482
2498- if ( destroy_surface
2483+ if ( destroy_surface
24992484 && (vk -> vk_surface != VK_NULL_HANDLE ))
25002485 {
25012486 vkDestroySurfaceKHR (vk -> context .instance ,
@@ -2570,9 +2555,9 @@ void vulkan_present(gfx_ctx_vulkan_data_t *vk, unsigned index)
25702555 err = vkQueuePresentKHR (vk -> context .queue , & present );
25712556
25722557#ifdef ANDROID
2573- /* VK_SUBOPTIMAL_KHR can be returned on
2558+ /* VK_SUBOPTIMAL_KHR can be returned on
25742559 * Android 10 when prerotate is not dealt with.
2575- * This is not an error we need to care about,
2560+ * This is not an error we need to care about,
25762561 * and we'll treat it as SUCCESS. */
25772562 if (result == VK_SUBOPTIMAL_KHR )
25782563 result = VK_SUCCESS ;
0 commit comments