---
name: "SDL_AddVulkanRenderSemaphores"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_AddVulkanRenderSemaphores"
---

# SDL\_AddVulkanRenderSemaphores(3)

Add a set of synchronization semaphores for the current frame.

## NAME

SDL\_AddVulkanRenderSemaphores - Add a set of synchronization semaphores for the current frame.

## HEADER FILE

Defined in SDL3/SDL\_render.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**bool SDL\_AddVulkanRenderSemaphores(SDL\_Renderer \*renderer, Uint32 wait\_stage\_mask, Sint64 wait\_semaphore, Sint64 signal\_semaphore);**

## DESCRIPTION

The Vulkan renderer will wait for **wait\_semaphore** before submitting rendering commands and signal **signal\_semaphore** after rendering commands are complete for this frame.

This should be called each frame that you want semaphore synchronization. The Vulkan renderer may have multiple frames in flight on the GPU, so you should have multiple semaphores that are used for synchronization. Querying

**SDL\_PROP\_RENDERER\_VULKAN\_SWAPCHAIN\_IMAGE\_COUNT\_NUMBER**

will give you the maximum number of semaphores you'll need.

## FUNCTION PARAMETERS

- *renderer*

  the rendering context.

- *wait\_stage\_mask*

  the VkPipelineStageFlags for the wait.

- *wait\_semaphore*

  a VkSempahore to wait on before rendering the current frame, or 0 if not needed.

- *signal\_semaphore*

  a VkSempahore that SDL will signal when rendering for the current frame is complete, or 0 if not needed.

## RETURN VALUE

Returns true on success or false on failure; call

**SDL\_GetError** () for more information.

## THREAD SAFETY

It is **NOT** safe to call this function from two threads at once.

## AVAILABILITY

This function is available since SDL 3.2.0.
