RetroArch
Macros | Functions | Variables
vulkan.c File Reference
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#include <string.h>
#include <compat/strl.h>
#include <gfx/scaler/scaler.h>
#include <gfx/video_frame.h>
#include <formats/image.h>
#include <retro_inline.h>
#include <retro_miscellaneous.h>
#include <retro_math.h>
#include <retro_assert.h>
#include <libretro.h>
#include "../font_driver.h"
#include "../common/vulkan_common.h"
#include "../../driver.h"
#include "../../configuration.h"
#include "../../record/record_driver.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../video_coord_array.h"
#include "vulkan_shaders/alpha_blend.vert.inc"
#include "vulkan_shaders/alpha_blend.frag.inc"
#include "vulkan_shaders/font.frag.inc"
#include "vulkan_shaders/pipeline_ribbon.vert.inc"
#include "vulkan_shaders/pipeline_ribbon.frag.inc"
#include "vulkan_shaders/pipeline_ribbon_simple.vert.inc"
#include "vulkan_shaders/pipeline_ribbon_simple.frag.inc"
#include "vulkan_shaders/pipeline_snow_simple.frag.inc"
#include "vulkan_shaders/pipeline_snow.frag.inc"
#include "vulkan_shaders/pipeline_bokeh.frag.inc"
Include dependency graph for vulkan.c:

Macros

#define T0   0xff000000u
 
#define T1   0xffffffffu
 

Functions

static void vulkan_set_viewport (void *data, unsigned viewport_width, unsigned viewport_height, bool force_full, bool allow_rotate)
 
static void vulkan_viewport_info (void *data, struct video_viewport *vp)
 
static const gfx_ctx_driver_tvulkan_get_context (vk_t *vk)
 
static void vulkan_init_render_pass (vk_t *vk)
 
static void vulkan_init_framebuffers (vk_t *vk)
 
static void vulkan_init_pipeline_layout (vk_t *vk)
 
static void vulkan_init_pipelines (vk_t *vk)
 
static void vulkan_init_command_buffers (vk_t *vk)
 
static void vulkan_init_samplers (vk_t *vk)
 
static void vulkan_deinit_samplers (vk_t *vk)
 
static void vulkan_init_buffers (vk_t *vk)
 
static void vulkan_deinit_buffers (vk_t *vk)
 
static void vulkan_init_descriptor_pool (vk_t *vk)
 
static void vulkan_deinit_descriptor_pool (vk_t *vk)
 
static void vulkan_init_textures (vk_t *vk)
 
static void vulkan_deinit_textures (vk_t *vk)
 
static void vulkan_deinit_command_buffers (vk_t *vk)
 
static void vulkan_deinit_pipeline_layout (vk_t *vk)
 
static void vulkan_deinit_pipelines (vk_t *vk)
 
static void vulkan_deinit_framebuffers (vk_t *vk)
 
static bool vulkan_init_default_filter_chain (vk_t *vk)
 
static bool vulkan_init_filter_chain_preset (vk_t *vk, const char *shader_path)
 
static bool vulkan_init_filter_chain (vk_t *vk)
 
static void vulkan_init_resources (vk_t *vk)
 
static void vulkan_init_static_resources (vk_t *vk)
 
static void vulkan_deinit_static_resources (vk_t *vk)
 
static void vulkan_deinit_resources (vk_t *vk)
 
static void vulkan_deinit_menu (vk_t *vk)
 
static void vulkan_free (void *data)
 
static uint32_t vulkan_get_sync_index (void *handle)
 
static uint32_t vulkan_get_sync_index_mask (void *handle)
 
static void vulkan_set_image (void *handle, const struct retro_vulkan_image *image, uint32_t num_semaphores, const VkSemaphore *semaphores, uint32_t src_queue_family)
 
static void vulkan_wait_sync_index (void *handle)
 
static void vulkan_set_command_buffers (void *handle, uint32_t num_cmd, const VkCommandBuffer *cmd)
 
static void vulkan_lock_queue (void *handle)
 
static void vulkan_unlock_queue (void *handle)
 
static void vulkan_set_signal_semaphore (void *handle, VkSemaphore semaphore)
 
static void vulkan_init_hw_render (vk_t *vk)
 
static void vulkan_init_readback (vk_t *vk)
 
static voidvulkan_init (const video_info_t *video, const input_driver_t **input, void **input_data)
 
static void vulkan_update_filter_chain (vk_t *vk)
 
static void vulkan_check_swapchain (vk_t *vk)
 
static void vulkan_set_nonblock_state (void *data, bool state)
 
static bool vulkan_alive (void *data)
 
static bool vulkan_suppress_screensaver (void *data, bool enable)
 
static bool vulkan_set_shader (void *data, enum rarch_shader_type type, const char *path)
 
static void vulkan_set_projection (vk_t *vk, struct video_ortho *ortho, bool allow_rotate)
 
static void vulkan_set_rotation (void *data, unsigned rotation)
 
static void vulkan_set_video_mode (void *data, unsigned width, unsigned height, bool fullscreen)
 
static void vulkan_readback (vk_t *vk)
 
static void vulkan_inject_black_frame (vk_t *vk, video_frame_info_t *video_info)
 
static bool vulkan_frame (void *data, const void *frame, unsigned frame_width, unsigned frame_height, uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t *video_info)
 
static void vulkan_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
 
static void vulkan_apply_state_changes (void *data)
 
static void vulkan_show_mouse (void *data, bool state)
 
static struct video_shadervulkan_get_current_shader (void *data)
 
static bool vulkan_get_current_sw_framebuffer (void *data, struct retro_framebuffer *framebuffer)
 
static bool vulkan_get_hw_render_interface (void *data, const struct retro_hw_render_interface **iface)
 
static void vulkan_set_texture_frame (void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
 
static void vulkan_set_texture_enable (void *data, bool state, bool full_screen)
 
static void vulkan_set_osd_msg (void *data, video_frame_info_t *video_info, const char *msg, const void *params, void *font)
 
static uintptr_t vulkan_load_texture (void *video_data, void *data, bool threaded, enum texture_filter_type filter_type)
 
static void vulkan_unload_texture (void *data, uintptr_t handle)
 
static float vulkan_get_refresh_rate (void *data)
 
static uint32_t vulkan_get_flags (void *data)
 
static void vulkan_get_poke_interface (void *data, const video_poke_interface_t **iface)
 
static bool vulkan_read_viewport (void *data, uint8_t *buffer, bool is_idle)
 

Variables

static const video_poke_interface_t vulkan_poke_interface
 
video_driver_t video_vulkan
 

Macro Definition Documentation

◆ T0

#define T0   0xff000000u

◆ T1

#define T1   0xffffffffu

Function Documentation

◆ vulkan_alive()

static bool vulkan_alive ( void data)
static
Here is the call graph for this function:

◆ vulkan_apply_state_changes()

static void vulkan_apply_state_changes ( void data)
static

◆ vulkan_check_swapchain()

static void vulkan_check_swapchain ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_deinit_buffers()

static void vulkan_deinit_buffers ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_deinit_command_buffers()

static void vulkan_deinit_command_buffers ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_deinit_descriptor_pool()

static void vulkan_deinit_descriptor_pool ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_deinit_framebuffers()

static void vulkan_deinit_framebuffers ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_deinit_menu()

static void vulkan_deinit_menu ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_deinit_pipeline_layout()

static void vulkan_deinit_pipeline_layout ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_deinit_pipelines()

static void vulkan_deinit_pipelines ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_deinit_resources()

static void vulkan_deinit_resources ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_deinit_samplers()

static void vulkan_deinit_samplers ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_deinit_static_resources()

static void vulkan_deinit_static_resources ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_deinit_textures()

static void vulkan_deinit_textures ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_frame()

static bool vulkan_frame ( void data,
const void frame,
unsigned  frame_width,
unsigned  frame_height,
uint64_t  frame_count,
unsigned  pitch,
const char *  msg,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:

◆ vulkan_free()

static void vulkan_free ( void data)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_get_context()

static const gfx_ctx_driver_t* vulkan_get_context ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_get_current_shader()

static struct video_shader* vulkan_get_current_shader ( void data)
static
Here is the call graph for this function:

◆ vulkan_get_current_sw_framebuffer()

static bool vulkan_get_current_sw_framebuffer ( void data,
struct retro_framebuffer framebuffer 
)
static
Here is the call graph for this function:

◆ vulkan_get_flags()

static uint32_t vulkan_get_flags ( void data)
static

◆ vulkan_get_hw_render_interface()

static bool vulkan_get_hw_render_interface ( void data,
const struct retro_hw_render_interface **  iface 
)
static

◆ vulkan_get_poke_interface()

static void vulkan_get_poke_interface ( void data,
const video_poke_interface_t **  iface 
)
static
Here is the call graph for this function:

◆ vulkan_get_refresh_rate()

static float vulkan_get_refresh_rate ( void data)
static
Here is the call graph for this function:

◆ vulkan_get_sync_index()

static uint32_t vulkan_get_sync_index ( void handle)
static
Here is the caller graph for this function:

◆ vulkan_get_sync_index_mask()

static uint32_t vulkan_get_sync_index_mask ( void handle)
static
Here is the caller graph for this function:

◆ vulkan_init()

static void* vulkan_init ( const video_info_t video,
const input_driver_t **  input,
void **  input_data 
)
static
Here is the call graph for this function:

◆ vulkan_init_buffers()

static void vulkan_init_buffers ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_command_buffers()

static void vulkan_init_command_buffers ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_default_filter_chain()

static bool vulkan_init_default_filter_chain ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_descriptor_pool()

static void vulkan_init_descriptor_pool ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_filter_chain()

static bool vulkan_init_filter_chain ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_filter_chain_preset()

static bool vulkan_init_filter_chain_preset ( vk_t vk,
const char *  shader_path 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_framebuffers()

static void vulkan_init_framebuffers ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_hw_render()

static void vulkan_init_hw_render ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_pipeline_layout()

static void vulkan_init_pipeline_layout ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_pipelines()

static void vulkan_init_pipelines ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_readback()

static void vulkan_init_readback ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_render_pass()

static void vulkan_init_render_pass ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_resources()

static void vulkan_init_resources ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_samplers()

static void vulkan_init_samplers ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_static_resources()

static void vulkan_init_static_resources ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_init_textures()

static void vulkan_init_textures ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_inject_black_frame()

static void vulkan_inject_black_frame ( vk_t vk,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_load_texture()

static uintptr_t vulkan_load_texture ( void video_data,
void data,
bool  threaded,
enum texture_filter_type  filter_type 
)
static
Here is the call graph for this function:

◆ vulkan_lock_queue()

static void vulkan_lock_queue ( void handle)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_read_viewport()

static bool vulkan_read_viewport ( void data,
uint8_t buffer,
bool  is_idle 
)
static
Here is the call graph for this function:

◆ vulkan_readback()

static void vulkan_readback ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_set_aspect_ratio()

static void vulkan_set_aspect_ratio ( void data,
unsigned  aspect_ratio_idx 
)
static
Here is the call graph for this function:

◆ vulkan_set_command_buffers()

static void vulkan_set_command_buffers ( void handle,
uint32_t  num_cmd,
const VkCommandBuffer *  cmd 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_set_image()

static void vulkan_set_image ( void handle,
const struct retro_vulkan_image image,
uint32_t  num_semaphores,
const VkSemaphore *  semaphores,
uint32_t  src_queue_family 
)
static
Here is the caller graph for this function:

◆ vulkan_set_nonblock_state()

static void vulkan_set_nonblock_state ( void data,
bool  state 
)
static
Here is the call graph for this function:

◆ vulkan_set_osd_msg()

static void vulkan_set_osd_msg ( void data,
video_frame_info_t video_info,
const char *  msg,
const void params,
void font 
)
static
Here is the call graph for this function:

◆ vulkan_set_projection()

static void vulkan_set_projection ( vk_t vk,
struct video_ortho ortho,
bool  allow_rotate 
)
static
Here is the caller graph for this function:

◆ vulkan_set_rotation()

static void vulkan_set_rotation ( void data,
unsigned  rotation 
)
static
Here is the call graph for this function:

◆ vulkan_set_shader()

static bool vulkan_set_shader ( void data,
enum rarch_shader_type  type,
const char *  path 
)
static
Here is the call graph for this function:

◆ vulkan_set_signal_semaphore()

static void vulkan_set_signal_semaphore ( void handle,
VkSemaphore  semaphore 
)
static
Here is the caller graph for this function:

◆ vulkan_set_texture_enable()

static void vulkan_set_texture_enable ( void data,
bool  state,
bool  full_screen 
)
static

◆ vulkan_set_texture_frame()

static void vulkan_set_texture_frame ( void data,
const void frame,
bool  rgb32,
unsigned  width,
unsigned  height,
float  alpha 
)
static
Here is the call graph for this function:

◆ vulkan_set_video_mode()

static void vulkan_set_video_mode ( void data,
unsigned  width,
unsigned  height,
bool  fullscreen 
)
static
Here is the call graph for this function:

◆ vulkan_set_viewport()

static void vulkan_set_viewport ( void data,
unsigned  viewport_width,
unsigned  viewport_height,
bool  force_full,
bool  allow_rotate 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_show_mouse()

static void vulkan_show_mouse ( void data,
bool  state 
)
static
Here is the call graph for this function:

◆ vulkan_suppress_screensaver()

static bool vulkan_suppress_screensaver ( void data,
bool  enable 
)
static
Here is the call graph for this function:

◆ vulkan_unload_texture()

static void vulkan_unload_texture ( void data,
uintptr_t  handle 
)
static
Here is the call graph for this function:

◆ vulkan_unlock_queue()

static void vulkan_unlock_queue ( void handle)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_update_filter_chain()

static void vulkan_update_filter_chain ( vk_t vk)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_viewport_info()

static void vulkan_viewport_info ( void data,
struct video_viewport vp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_wait_sync_index()

static void vulkan_wait_sync_index ( void handle)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ video_vulkan

video_driver_t video_vulkan
Initial value:
= {
NULL,
NULL,
"vulkan",
NULL,
NULL,
}
static void * vulkan_init(const video_info_t *video, const input_driver_t **input, void **input_data)
Definition: vulkan.c:1131
static bool vulkan_read_viewport(void *data, uint8_t *buffer, bool is_idle)
Definition: vulkan.c:2424
static void vulkan_set_viewport(void *data, unsigned viewport_width, unsigned viewport_height, bool force_full, bool allow_rotate)
Definition: vulkan.c:1409
static bool vulkan_set_shader(void *data, enum rarch_shader_type type, const char *path)
Definition: vulkan.c:1330
static bool vulkan_suppress_screensaver(void *data, bool enable)
Definition: vulkan.c:1322
static bool vulkan_alive(void *data)
Definition: vulkan.c:1294
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static bool vulkan_frame(void *data, const void *frame, unsigned frame_width, unsigned frame_height, uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t *video_info)
Definition: vulkan.c:1620
static void vulkan_get_poke_interface(void *data, const video_poke_interface_t **iface)
Definition: vulkan.c:2399
static void vulkan_free(void *data)
Definition: vulkan.c:940
static void vulkan_viewport_info(void *data, struct video_viewport *vp)
Definition: vulkan.c:2406
static void vulkan_set_nonblock_state(void *data, bool state)
Definition: vulkan.c:1273
static void vulkan_set_rotation(void *data, unsigned rotation)
Definition: vulkan.c:1382

◆ vulkan_poke_interface

const video_poke_interface_t vulkan_poke_interface
static
Initial value:
= {
NULL,
NULL,
NULL,
}
static uint32_t vulkan_get_flags(void *data)
Definition: vulkan.c:2363
static void vulkan_set_osd_msg(void *data, video_frame_info_t *video_info, const char *msg, const void *params, void *font)
Definition: vulkan.c:2272
static void vulkan_set_texture_enable(void *data, bool state, bool full_screen)
Definition: vulkan.c:2262
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static void vulkan_set_texture_frame(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
Definition: vulkan.c:2198
static void vulkan_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
Definition: vulkan.c:2092
static void vulkan_set_video_mode(void *data, unsigned width, unsigned height, bool fullscreen)
Definition: vulkan.c:1394
static void vulkan_show_mouse(void *data, bool state)
Definition: vulkan.c:2131
static uintptr_t vulkan_load_texture(void *video_data, void *data, bool threaded, enum texture_filter_type filter_type)
Definition: vulkan.c:2280
static float vulkan_get_refresh_rate(void *data)
Definition: vulkan.c:2353
static bool vulkan_get_current_sw_framebuffer(void *data, struct retro_framebuffer *framebuffer)
Definition: vulkan.c:2146
static bool vulkan_get_hw_render_interface(void *data, const struct retro_hw_render_interface **iface)
Definition: vulkan.c:2190
static struct video_shader * vulkan_get_current_shader(void *data)
Definition: vulkan.c:2137
static void vulkan_apply_state_changes(void *data)
Definition: vulkan.c:2124
static void vulkan_unload_texture(void *data, uintptr_t handle)
Definition: vulkan.c:2332