RetroArch
Classes | Macros | Functions | Variables
shader_vulkan.cpp File Reference
#include "shader_vulkan.h"
#include "glslang_util.h"
#include <vector>
#include <memory>
#include <functional>
#include <utility>
#include <algorithm>
#include <string.h>
#include <math.h>
#include <compat/strl.h>
#include <formats/image.h>
#include <retro_miscellaneous.h>
#include "slang_reflection.h"
#include "../video_driver.h"
#include "../../verbosity.h"
#include "../../msg_hash.h"
#include "../drivers/vulkan_shaders/opaque.vert.inc"
#include "../drivers/vulkan_shaders/opaque.frag.inc"
Include dependency graph for shader_vulkan.cpp:

Classes

struct  Size2D
 
struct  Texture
 
class  DeferredDisposer
 
class  Buffer
 
class  StaticTexture
 
class  Framebuffer
 
struct  CommonResources
 
class  Pass
 
struct  Pass::Parameter
 
struct  Pass::PushConstant
 
struct  vulkan_filter_chain
 
struct  ConfigDeleter
 

Macros

#define FMT(x)   case SLANG_FORMAT_##x: return VK_FORMAT_##x
 

Functions

static unsigned num_miplevels (unsigned width, unsigned height)
 
static uint32_t find_memory_type_fallback (const VkPhysicalDeviceMemoryProperties &mem_props, uint32_t device_reqs, uint32_t host_reqs)
 
static void build_identity_matrix (float *data)
 
static void build_vec4 (float *data, unsigned width, unsigned height)
 
template<typename P >
static bool vk_shader_set_unique_map (unordered_map< string, P > &m, const string &name, const P &p)
 
vulkan_filter_chain_tvulkan_filter_chain_new (const vulkan_filter_chain_create_info *info)
 
vulkan_filter_chain_tvulkan_filter_chain_create_default (const struct vulkan_filter_chain_create_info *info, vulkan_filter_chain_filter filter)
 
static VkFormat glslang_format_to_vk (glslang_format fmt)
 
static vulkan_filter_chain_address wrap_to_address (gfx_wrap_type type)
 
static unique_ptr< StaticTexturevulkan_filter_chain_load_lut (VkCommandBuffer cmd, const struct vulkan_filter_chain_create_info *info, vulkan_filter_chain *chain, const video_shader_lut *shader)
 
static bool vulkan_filter_chain_load_luts (const struct vulkan_filter_chain_create_info *info, vulkan_filter_chain *chain, video_shader *shader)
 
vulkan_filter_chain_tvulkan_filter_chain_create_from_preset (const struct vulkan_filter_chain_create_info *info, const char *path, vulkan_filter_chain_filter filter)
 
struct video_shadervulkan_filter_chain_get_preset (vulkan_filter_chain_t *chain)
 
void vulkan_filter_chain_free (vulkan_filter_chain_t *chain)
 
void vulkan_filter_chain_set_shader (vulkan_filter_chain_t *chain, unsigned pass, VkShaderStageFlags stage, const uint32_t *spirv, size_t spirv_words)
 
void vulkan_filter_chain_set_pass_info (vulkan_filter_chain_t *chain, unsigned pass, const struct vulkan_filter_chain_pass_info *info)
 
bool vulkan_filter_chain_update_swapchain_info (vulkan_filter_chain_t *chain, const vulkan_filter_chain_swapchain_info *info)
 
void vulkan_filter_chain_notify_sync_index (vulkan_filter_chain_t *chain, unsigned index)
 
bool vulkan_filter_chain_init (vulkan_filter_chain_t *chain)
 
void vulkan_filter_chain_set_input_texture (vulkan_filter_chain_t *chain, const struct vulkan_filter_chain_texture *texture)
 
void vulkan_filter_chain_set_frame_count (vulkan_filter_chain_t *chain, uint64_t count)
 
void vulkan_filter_chain_set_frame_count_period (vulkan_filter_chain_t *chain, unsigned pass, unsigned period)
 
void vulkan_filter_chain_set_pass_name (vulkan_filter_chain_t *chain, unsigned pass, const char *name)
 
void vulkan_filter_chain_build_offscreen_passes (vulkan_filter_chain_t *chain, VkCommandBuffer cmd, const VkViewport *vp)
 
void vulkan_filter_chain_build_viewport_pass (vulkan_filter_chain_t *chain, VkCommandBuffer cmd, const VkViewport *vp, const float *mvp)
 
void vulkan_filter_chain_end_frame (vulkan_filter_chain_t *chain, VkCommandBuffer cmd)
 

Variables

static const uint32_t opaque_vert []
 
static const uint32_t opaque_frag []
 

Macro Definition Documentation

◆ FMT

#define FMT (   x)    case SLANG_FORMAT_##x: return VK_FORMAT_##x

Function Documentation

◆ build_identity_matrix()

static void build_identity_matrix ( float *  data)
static
Here is the caller graph for this function:

◆ build_vec4()

static void build_vec4 ( float *  data,
unsigned  width,
unsigned  height 
)
static
Here is the caller graph for this function:

◆ find_memory_type_fallback()

static uint32_t find_memory_type_fallback ( const VkPhysicalDeviceMemoryProperties mem_props,
uint32_t  device_reqs,
uint32_t  host_reqs 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ glslang_format_to_vk()

static VkFormat glslang_format_to_vk ( glslang_format  fmt)
static
Here is the caller graph for this function:

◆ num_miplevels()

static unsigned num_miplevels ( unsigned  width,
unsigned  height 
)
static
Here is the caller graph for this function:

◆ vk_shader_set_unique_map()

template<typename P >
static bool vk_shader_set_unique_map ( unordered_map< string, P > &  m,
const string name,
const P p 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_filter_chain_build_offscreen_passes()

void vulkan_filter_chain_build_offscreen_passes ( vulkan_filter_chain_t chain,
VkCommandBuffer  cmd,
const VkViewport vp 
)
Here is the caller graph for this function:

◆ vulkan_filter_chain_build_viewport_pass()

void vulkan_filter_chain_build_viewport_pass ( vulkan_filter_chain_t chain,
VkCommandBuffer  cmd,
const VkViewport vp,
const float *  mvp 
)
Here is the caller graph for this function:

◆ vulkan_filter_chain_create_default()

vulkan_filter_chain_t* vulkan_filter_chain_create_default ( const struct vulkan_filter_chain_create_info info,
vulkan_filter_chain_filter  filter 
)
Here is the caller graph for this function:

◆ vulkan_filter_chain_create_from_preset()

vulkan_filter_chain_t* vulkan_filter_chain_create_from_preset ( const struct vulkan_filter_chain_create_info info,
const char *  path,
vulkan_filter_chain_filter  filter 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_filter_chain_end_frame()

void vulkan_filter_chain_end_frame ( vulkan_filter_chain_t chain,
VkCommandBuffer  cmd 
)
Here is the caller graph for this function:

◆ vulkan_filter_chain_free()

void vulkan_filter_chain_free ( vulkan_filter_chain_t chain)
Here is the caller graph for this function:

◆ vulkan_filter_chain_get_preset()

struct video_shader* vulkan_filter_chain_get_preset ( vulkan_filter_chain_t chain)
Here is the caller graph for this function:

◆ vulkan_filter_chain_init()

bool vulkan_filter_chain_init ( vulkan_filter_chain_t chain)

◆ vulkan_filter_chain_load_lut()

static unique_ptr<StaticTexture> vulkan_filter_chain_load_lut ( VkCommandBuffer  cmd,
const struct vulkan_filter_chain_create_info info,
vulkan_filter_chain chain,
const video_shader_lut shader 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_filter_chain_load_luts()

static bool vulkan_filter_chain_load_luts ( const struct vulkan_filter_chain_create_info info,
vulkan_filter_chain chain,
video_shader shader 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vulkan_filter_chain_new()

vulkan_filter_chain_t* vulkan_filter_chain_new ( const vulkan_filter_chain_create_info info)

◆ vulkan_filter_chain_notify_sync_index()

void vulkan_filter_chain_notify_sync_index ( vulkan_filter_chain_t chain,
unsigned  index 
)
Here is the caller graph for this function:

◆ vulkan_filter_chain_set_frame_count()

void vulkan_filter_chain_set_frame_count ( vulkan_filter_chain_t chain,
uint64_t  count 
)
Here is the caller graph for this function:

◆ vulkan_filter_chain_set_frame_count_period()

void vulkan_filter_chain_set_frame_count_period ( vulkan_filter_chain_t chain,
unsigned  pass,
unsigned  period 
)

◆ vulkan_filter_chain_set_input_texture()

void vulkan_filter_chain_set_input_texture ( vulkan_filter_chain_t chain,
const struct vulkan_filter_chain_texture texture 
)
Here is the caller graph for this function:

◆ vulkan_filter_chain_set_pass_info()

void vulkan_filter_chain_set_pass_info ( vulkan_filter_chain_t chain,
unsigned  pass,
const struct vulkan_filter_chain_pass_info info 
)

◆ vulkan_filter_chain_set_pass_name()

void vulkan_filter_chain_set_pass_name ( vulkan_filter_chain_t chain,
unsigned  pass,
const char *  name 
)

◆ vulkan_filter_chain_set_shader()

void vulkan_filter_chain_set_shader ( vulkan_filter_chain_t chain,
unsigned  pass,
VkShaderStageFlags  stage,
const uint32_t spirv,
size_t  spirv_words 
)

◆ vulkan_filter_chain_update_swapchain_info()

bool vulkan_filter_chain_update_swapchain_info ( vulkan_filter_chain_t chain,
const vulkan_filter_chain_swapchain_info info 
)
Here is the caller graph for this function:

◆ wrap_to_address()

static vulkan_filter_chain_address wrap_to_address ( gfx_wrap_type  type)
static
Here is the caller graph for this function:

Variable Documentation

◆ opaque_frag

const uint32_t opaque_frag[]
static
Initial value:
=
# 44 "/storage/doxygen/retroarch/gfx/drivers_shader/shader_vulkan.cpp" 2

◆ opaque_vert

const uint32_t opaque_vert[]
static
Initial value:
=
# 40 "/storage/doxygen/retroarch/gfx/drivers_shader/shader_vulkan.cpp" 2