RetroArch
shader_vulkan.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2010-2016 - Hans-Kristian Arntzen
3  * Copyright (C) 2011-2017 - Daniel De Matteis
4  *
5  * RetroArch is free software: you can redistribute it and/or modify it under the terms
6  * of the GNU General Public License as published by the Free Software Found-
7  * ation, either version 3 of the License, or (at your option) any later version.
8  *
9  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  * PURPOSE. See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along with RetroArch.
14  * If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef SHADER_VULKAN_H
18 #define SHADER_VULKAN_H
19 
20 #include <stdint.h>
21 #include <stddef.h>
22 
23 #include <boolean.h>
24 #include <retro_common_api.h>
25 
26 #include "../common/vulkan_common.h"
27 
29 
31 
33 {
37 };
38 
40 {
47 };
48 
50 {
51  VkImage image;
52  VkImageView view;
54  unsigned width;
55  unsigned height;
57 };
58 
60 {
65 };
66 
68 {
69  /* For the last pass, make sure VIEWPORT scale
70  * with scale factors of 1 are used. */
73  float scale_x;
74  float scale_y;
75 
76  /* Ignored for the last pass, swapchain info will be used instead. */
78 
79  /* The filter to use for source in this pass. */
83 
84  /* Maximum number of mip-levels to use. */
85  unsigned max_levels;
86 };
87 
89 {
92  VkRenderPass render_pass;
93  unsigned num_indices;
94 };
95 
97 {
98  VkDevice device;
99  VkPhysicalDevice gpu;
101  VkPipelineCache pipeline_cache;
102  VkQueue queue;
103  VkCommandPool command_pool;
104  unsigned num_passes;
105 
107  struct
108  {
109  unsigned width, height;
110  } max_input_size;
112 };
113 
115  const struct vulkan_filter_chain_create_info *info);
117 
119  unsigned pass,
120  VkShaderStageFlags stage,
121  const uint32_t *spirv,
122  size_t spirv_words);
123 
125  unsigned pass,
126  const struct vulkan_filter_chain_pass_info *info);
127 
130 
132  unsigned index);
133 
135 
137  const struct vulkan_filter_chain_texture *texture);
138 
140  uint64_t count);
141 
143  unsigned pass,
144  unsigned period);
145 
147  unsigned pass,
148  const char *name);
149 
151  VkCommandBuffer cmd, const VkViewport *vp);
153  VkCommandBuffer cmd, const VkViewport *vp, const float *mvp);
155  VkCommandBuffer cmd);
156 
160 
163  const char *path, enum vulkan_filter_chain_filter filter);
164 
166  vulkan_filter_chain_t *chain);
167 
169 
170 #endif
171 
Definition: shader_vulkan.h:34
vulkan_filter_chain_t * vulkan_filter_chain_create_default(const struct vulkan_filter_chain_create_info *info, enum vulkan_filter_chain_filter filter)
Definition: shader_vulkan.cpp:2488
GLuint const GLchar * name
Definition: glext.h:6671
Definition: shader_vulkan.h:67
unsigned max_levels
Definition: shader_vulkan.h:85
vulkan_filter_chain_t * vulkan_filter_chain_create_from_preset(const struct vulkan_filter_chain_create_info *info, const char *path, enum vulkan_filter_chain_filter filter)
Definition: shader_vulkan.cpp:2801
Definition: shader_vulkan.cpp:481
enum vulkan_filter_chain_scale scale_type_y
Definition: shader_vulkan.h:72
bool vulkan_filter_chain_update_swapchain_info(vulkan_filter_chain_t *chain, const struct vulkan_filter_chain_swapchain_info *info)
const VkPhysicalDeviceMemoryProperties * memory_properties
Definition: shader_vulkan.h:100
VkQueue queue
Definition: shader_vulkan.h:102
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
unsigned height
Definition: shader_vulkan.h:109
void vulkan_filter_chain_set_pass_name(vulkan_filter_chain_t *chain, unsigned pass, const char *name)
Definition: shader_vulkan.cpp:3138
struct video_shader * vulkan_filter_chain_get_preset(vulkan_filter_chain_t *chain)
Definition: shader_vulkan.cpp:3067
VkFormat format
Definition: shader_vulkan.h:91
Definition: shader_vulkan.h:63
Definition: libretro.h:2275
GLsizei const GLchar ** path
Definition: glext.h:7901
Definition: shader_vulkan.h:96
Definition: shader_vulkan.h:36
Definition: shader_vulkan.h:49
enum vulkan_filter_chain_filter mip_filter
Definition: shader_vulkan.h:81
float scale_y
Definition: shader_vulkan.h:74
struct vulkan_filter_chain_swapchain_info swapchain
Definition: shader_vulkan.h:111
vulkan_filter_chain_address
Definition: shader_vulkan.h:39
VkFormat format
Definition: shader_vulkan.h:56
enum vulkan_filter_chain_filter source_filter
Definition: shader_vulkan.h:80
VkFormat
Definition: vulkan_core.h:480
unsigned height
Definition: shader_vulkan.h:55
GLuint GLuint GLsizei count
Definition: glext.h:6292
Definition: video_shader_parse.h:143
VkImage image
Definition: shader_vulkan.h:51
unsigned width
Definition: shader_vulkan.h:54
void vulkan_filter_chain_set_frame_count(vulkan_filter_chain_t *chain, uint64_t count)
Definition: shader_vulkan.cpp:3123
void vulkan_filter_chain_notify_sync_index(vulkan_filter_chain_t *chain, unsigned index)
Definition: shader_vulkan.cpp:3104
void vulkan_filter_chain_end_frame(vulkan_filter_chain_t *chain, VkCommandBuffer cmd)
Definition: shader_vulkan.cpp:3160
VkImageLayout
Definition: vulkan_core.h:798
float scale_x
Definition: shader_vulkan.h:73
Definition: shader_vulkan.h:41
void vulkan_filter_chain_set_input_texture(vulkan_filter_chain_t *chain, const struct vulkan_filter_chain_texture *texture)
Definition: shader_vulkan.cpp:3116
void vulkan_filter_chain_build_offscreen_passes(vulkan_filter_chain_t *chain, VkCommandBuffer cmd, const VkViewport *vp)
Definition: shader_vulkan.cpp:3146
unsigned num_indices
Definition: shader_vulkan.h:93
ubyte cmd
Definition: wiiuse_internal.h:319
struct vulkan_filter_chain_create_info::@249 max_input_size
Definition: shader_vulkan.h:62
VkFormat rt_format
Definition: shader_vulkan.h:77
Definition: shader_vulkan.h:43
void vulkan_filter_chain_free(vulkan_filter_chain_t *chain)
Definition: shader_vulkan.cpp:3073
Definition: vulkan_core.h:2226
VkRenderPass render_pass
Definition: shader_vulkan.h:92
Definition: shader_vulkan.h:42
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
VkImageLayout layout
Definition: shader_vulkan.h:53
void vulkan_filter_chain_set_shader(vulkan_filter_chain_t *chain, unsigned pass, VkShaderStageFlags stage, const uint32_t *spirv, size_t spirv_words)
Definition: shader_vulkan.cpp:3079
GLuint index
Definition: glext.h:6671
Definition: vulkan_core.h:1898
void vulkan_filter_chain_set_frame_count_period(vulkan_filter_chain_t *chain, unsigned pass, unsigned period)
Definition: shader_vulkan.cpp:3130
vulkan_filter_chain_filter
Definition: shader_vulkan.h:32
void vulkan_filter_chain_build_viewport_pass(vulkan_filter_chain_t *chain, VkCommandBuffer cmd, const VkViewport *vp, const float *mvp)
Definition: shader_vulkan.cpp:3153
unsigned width
Definition: shader_vulkan.h:109
VkImageView view
Definition: shader_vulkan.h:52
Definition: shader_vulkan.h:46
Definition: shader_vulkan.h:61
vulkan_filter_chain_scale
Definition: shader_vulkan.h:59
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7672
unsigned num_passes
Definition: shader_vulkan.h:104
Definition: shader_vulkan.h:88
void vulkan_filter_chain_set_pass_info(vulkan_filter_chain_t *chain, unsigned pass, const struct vulkan_filter_chain_pass_info *info)
Definition: shader_vulkan.cpp:3089
VkViewport viewport
Definition: shader_vulkan.h:90
bool vulkan_filter_chain_init(vulkan_filter_chain_t *chain)
Definition: shader_vulkan.cpp:3111
Definition: shader_vulkan.h:35
Definition: metal_common.m:516
Definition: shader_vulkan.h:44
VkFlags VkShaderStageFlags
Definition: vulkan_core.h:1505
VkDevice device
Definition: shader_vulkan.h:98
enum vulkan_filter_chain_scale scale_type_x
Definition: shader_vulkan.h:71
VkPipelineCache pipeline_cache
Definition: shader_vulkan.h:101
typedefRETRO_BEGIN_DECLS struct vulkan_filter_chain vulkan_filter_chain_t
Definition: shader_vulkan.h:30
VkCommandPool command_pool
Definition: shader_vulkan.h:103
vulkan_filter_chain_t * vulkan_filter_chain_new(const struct vulkan_filter_chain_create_info *info)
enum vulkan_filter_chain_address address
Definition: shader_vulkan.h:82
VkFormat original_format
Definition: shader_vulkan.h:106
unsigned __int64 uint64_t
Definition: stdint.h:136
unsigned int uint32_t
Definition: stdint.h:126
VkPhysicalDevice gpu
Definition: shader_vulkan.h:99
Definition: shader_vulkan.h:64