Rename common files to _defines.h
This commit is contained in:
parent
2bf08f5457
commit
d1b9badf41
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
/* Required for 3DS display mode setting */
|
/* Required for 3DS display mode setting */
|
||||||
#if defined(_3DS)
|
#if defined(_3DS)
|
||||||
#include "gfx/common/ctr_common.h"
|
#include "gfx/common/ctr_defines.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Required for OpenDingux IPU filter + refresh
|
/* Required for OpenDingux IPU filter + refresh
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CACA_COMMON_H
|
#ifndef __CACA_DEFINES_H
|
||||||
#define __CACA_COMMON_H
|
#define __CACA_DEFINES_H
|
||||||
|
|
||||||
struct caca_canvas;
|
struct caca_canvas;
|
||||||
struct caca_dither;
|
struct caca_dither;
|
|
@ -13,8 +13,8 @@
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CTR_COMMON_H__
|
#ifndef CTR_DEFINES_H__
|
||||||
#define CTR_COMMON_H__
|
#define CTR_DEFINES_H__
|
||||||
|
|
||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
#include <retro_inline.h>
|
#include <retro_inline.h>
|
||||||
|
@ -33,33 +33,6 @@
|
||||||
(vec)->u = 1.0f / (texture_width); \
|
(vec)->u = 1.0f / (texture_width); \
|
||||||
(vec)->v = -1.0f / (texture_height)
|
(vec)->v = -1.0f / (texture_height)
|
||||||
|
|
||||||
#ifdef USE_CTRULIB_2
|
|
||||||
extern u8* gfxTopLeftFramebuffers[2];
|
|
||||||
extern u8* gfxTopRightFramebuffers[2];
|
|
||||||
extern u8* gfxBottomFramebuffers[2];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONSOLE_LOG
|
|
||||||
extern PrintConsole* ctrConsole;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern const u8 ctr_sprite_shbin[];
|
|
||||||
extern const u32 ctr_sprite_shbin_size;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
float v;
|
|
||||||
float u;
|
|
||||||
float y;
|
|
||||||
float x;
|
|
||||||
} ctr_scale_vector_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
s16 x0, y0, x1, y1;
|
|
||||||
s16 u0, v0, u1, v1;
|
|
||||||
} ctr_vertex_t;
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
CTR_VIDEO_MODE_3D = 0,
|
CTR_VIDEO_MODE_3D = 0,
|
||||||
|
@ -76,6 +49,20 @@ typedef enum
|
||||||
CTR_BOTTOM_MENU_SELECT
|
CTR_BOTTOM_MENU_SELECT
|
||||||
} ctr_bottom_menu;
|
} ctr_bottom_menu;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
float v;
|
||||||
|
float u;
|
||||||
|
float y;
|
||||||
|
float x;
|
||||||
|
} ctr_scale_vector_t;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
s16 x0, y0, x1, y1;
|
||||||
|
s16 u0, v0, u1, v1;
|
||||||
|
} ctr_vertex_t;
|
||||||
|
|
||||||
typedef struct ctr_video
|
typedef struct ctr_video
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
|
@ -191,4 +178,17 @@ struct ctr_overlay_data
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CTR_COMMON_H__ */
|
#ifdef USE_CTRULIB_2
|
||||||
|
extern u8* gfxTopLeftFramebuffers[2];
|
||||||
|
extern u8* gfxTopRightFramebuffers[2];
|
||||||
|
extern u8* gfxBottomFramebuffers[2];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONSOLE_LOG
|
||||||
|
extern PrintConsole* ctrConsole;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern const u8 ctr_sprite_shbin[];
|
||||||
|
extern const u32 ctr_sprite_shbin_size;
|
||||||
|
|
||||||
|
#endif /* CTR_DEFINES_H__ */
|
|
@ -420,7 +420,8 @@ static INLINE HRESULT DXGICreateFactory2(DXGIFactory2* factory)
|
||||||
|
|
||||||
#define DXGI_COLOR_RGBA(r, g, b, a) (((UINT32)(a) << 24) | ((UINT32)(b) << 16) | ((UINT32)(g) << 8) | ((UINT32)(r) << 0))
|
#define DXGI_COLOR_RGBA(r, g, b, a) (((UINT32)(a) << 24) | ((UINT32)(b) << 16) | ((UINT32)(g) << 8) | ((UINT32)(r) << 0))
|
||||||
|
|
||||||
typedef enum {
|
typedef enum
|
||||||
|
{
|
||||||
DXGI_FORMAT_EX_A4R4G4B4_UNORM = 1000
|
DXGI_FORMAT_EX_A4R4G4B4_UNORM = 1000
|
||||||
} DXGI_FORMAT_EX;
|
} DXGI_FORMAT_EX;
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __GDI_COMMON_H
|
#ifndef __GDI_DEFINES_H
|
||||||
#define __GDI_COMMON_H
|
#define __GDI_DEFINES_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __GL1_COMMON_H
|
#ifndef __GL1_DEFINES_H
|
||||||
#define __GL1_COMMON_H
|
#define __GL1_DEFINES_H
|
||||||
|
|
||||||
#include <retro_environment.h>
|
#include <retro_environment.h>
|
||||||
#include <retro_inline.h>
|
#include <retro_inline.h>
|
|
@ -36,6 +36,13 @@
|
||||||
|
|
||||||
RETRO_BEGIN_DECLS
|
RETRO_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define GL2_BIND_TEXTURE(id, wrap_mode, mag_filter, min_filter) \
|
||||||
|
glBindTexture(GL_TEXTURE_2D, id); \
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_mode); \
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_mode); \
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter); \
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter)
|
||||||
|
|
||||||
#if defined(HAVE_PSGL)
|
#if defined(HAVE_PSGL)
|
||||||
#define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
#define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
||||||
#define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
|
#define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
|
||||||
|
@ -251,13 +258,6 @@ struct gl2
|
||||||
bool pbo_readback_valid[4];
|
bool pbo_readback_valid[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GL2_BIND_TEXTURE(id, wrap_mode, mag_filter, min_filter) \
|
|
||||||
glBindTexture(GL_TEXTURE_2D, id); \
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_mode); \
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_mode); \
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter); \
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter)
|
|
||||||
|
|
||||||
bool gl2_load_luts(
|
bool gl2_load_luts(
|
||||||
const void *shader_data,
|
const void *shader_data,
|
||||||
GLuint *textures_lut);
|
GLuint *textures_lut);
|
||||||
|
|
|
@ -42,6 +42,7 @@ RETRO_BEGIN_DECLS
|
||||||
#define GL_CORE_NUM_PBOS 4
|
#define GL_CORE_NUM_PBOS 4
|
||||||
#define GL_CORE_NUM_VBOS 256
|
#define GL_CORE_NUM_VBOS 256
|
||||||
#define GL_CORE_NUM_FENCES 8
|
#define GL_CORE_NUM_FENCES 8
|
||||||
|
|
||||||
struct gl3_streamed_texture
|
struct gl3_streamed_texture
|
||||||
{
|
{
|
||||||
GLuint tex;
|
GLuint tex;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#pragma once
|
#ifndef __GX2_DEFINES_H
|
||||||
|
#define __GX2_DEFINES_H
|
||||||
|
|
||||||
#include <wiiu/gx2.h>
|
#include <wiiu/gx2.h>
|
||||||
|
|
||||||
|
@ -121,3 +122,5 @@ typedef struct
|
||||||
bool should_resize;
|
bool should_resize;
|
||||||
bool render_msg_enabled;
|
bool render_msg_enabled;
|
||||||
} wiiu_video_t;
|
} wiiu_video_t;
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef ORBIS_COMMON_H__
|
#ifndef ORBIS_DEFINES_H__
|
||||||
#define ORBIS_COMMON_H__
|
#define ORBIS_DEFINES_H__
|
||||||
|
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
#include <piglet.h>
|
#include <piglet.h>
|
||||||
|
@ -31,7 +31,6 @@ typedef struct
|
||||||
SceShdrCacheConfig shdr_cache_config;
|
SceShdrCacheConfig shdr_cache_config;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SceWindow native_window;
|
SceWindow native_window;
|
||||||
bool resize;
|
bool resize;
|
||||||
unsigned width, height;
|
unsigned width, height;
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef PS2_COMMON_H__
|
#ifndef PS2_DEFINES_H__
|
||||||
#define PS2_COMMON_H__
|
#define PS2_DEFINES_H__
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
|
@ -14,8 +14,8 @@
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef RSX_COMMON_H__
|
#ifndef RSX_DEFINES_H__
|
||||||
#define RSX_COMMON_H__
|
#define RSX_DEFINES_H__
|
||||||
|
|
||||||
#include <retro_inline.h>
|
#include <retro_inline.h>
|
||||||
#include <string/stdstring.h>
|
#include <string/stdstring.h>
|
|
@ -25,6 +25,12 @@
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
#include "../../retroarch.h"
|
#include "../../retroarch.h"
|
||||||
|
|
||||||
|
enum sd2l_flags
|
||||||
|
{
|
||||||
|
SDL2_FLAG_QUITTING = (1 << 0),
|
||||||
|
SDL2_FLAG_SHOULD_RESIZE = (1 << 1)
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct sdl2_tex
|
typedef struct sdl2_tex
|
||||||
{
|
{
|
||||||
SDL_Texture *tex;
|
SDL_Texture *tex;
|
||||||
|
@ -36,12 +42,6 @@ typedef struct sdl2_tex
|
||||||
bool rgb32;
|
bool rgb32;
|
||||||
} sdl2_tex_t;
|
} sdl2_tex_t;
|
||||||
|
|
||||||
enum sd2l_flags
|
|
||||||
{
|
|
||||||
SDL2_FLAG_QUITTING = (1 << 0),
|
|
||||||
SDL2_FLAG_SHOULD_RESIZE = (1 << 1)
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct _sdl2_video
|
typedef struct _sdl2_video
|
||||||
{
|
{
|
||||||
double rotation;
|
double rotation;
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __SIXEL_COMMON_H
|
#ifndef __SIXEL_DEFINES_H
|
||||||
#define __SIXEL_COMMON_H
|
#define __SIXEL_DEFINES_H
|
||||||
|
|
||||||
#include <sixel.h>
|
#include <sixel.h>
|
||||||
|
|
|
@ -12,7 +12,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
bool vsync;
|
bool vsync;
|
||||||
bool rgb32;
|
bool rgb32;
|
||||||
bool smooth; // bilinear
|
bool smooth; /* bilinear */
|
||||||
unsigned width, height;
|
unsigned width, height;
|
||||||
unsigned rotation;
|
unsigned rotation;
|
||||||
struct video_viewport vp;
|
struct video_viewport vp;
|
||||||
|
@ -62,7 +62,7 @@ typedef struct
|
||||||
NWindow *win;
|
NWindow *win;
|
||||||
Framebuffer fb;
|
Framebuffer fb;
|
||||||
|
|
||||||
// needed for the switch font driver
|
/* needed for the switch font driver */
|
||||||
uint32_t *out_buffer;
|
uint32_t *out_buffer;
|
||||||
uint32_t stride;
|
uint32_t stride;
|
||||||
} switch_video_t;
|
} switch_video_t;
|
||||||
|
@ -85,6 +85,5 @@ typedef struct
|
||||||
} switch_ctx_data_t;
|
} switch_ctx_data_t;
|
||||||
|
|
||||||
void gfx_slow_swizzling_blit(uint32_t *buffer, uint32_t *image, int w, int h, int tx, int ty, bool blend);
|
void gfx_slow_swizzling_blit(uint32_t *buffer, uint32_t *image, int w, int h, int tx, int ty, bool blend);
|
||||||
void gfx_cpy_dsp_buf(uint32_t *buffer, uint32_t *image, int w, int h, uint32_t stride, bool blend);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,16 +15,16 @@
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __VGA_COMMON_H
|
#ifndef __VGA_DEFINES_H
|
||||||
#define __VGA_COMMON_H
|
#define __VGA_DEFINES_H
|
||||||
|
|
||||||
#define VGA_WIDTH 320
|
#define VGA_WIDTH 320
|
||||||
#define VGA_HEIGHT 200
|
#define VGA_HEIGHT 200
|
||||||
|
|
||||||
typedef struct vga
|
typedef struct vga
|
||||||
{
|
{
|
||||||
bool color;
|
unsigned char *vga_menu_frame;
|
||||||
bool vga_rgb32;
|
unsigned char *vga_frame;
|
||||||
|
|
||||||
unsigned vga_menu_width;
|
unsigned vga_menu_width;
|
||||||
unsigned vga_menu_height;
|
unsigned vga_menu_height;
|
||||||
|
@ -35,8 +35,8 @@ typedef struct vga
|
||||||
unsigned vga_video_pitch;
|
unsigned vga_video_pitch;
|
||||||
unsigned vga_video_bits;
|
unsigned vga_video_bits;
|
||||||
|
|
||||||
unsigned char *vga_menu_frame;
|
bool color;
|
||||||
unsigned char *vga_frame;
|
bool vga_rgb32;
|
||||||
} vga_t;
|
} vga_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -14,8 +14,8 @@
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef VITA2D_COMMON_H__
|
#ifndef VITA2D_DEFINES_H__
|
||||||
#define VITA2D_COMMON_H__
|
#define VITA2D_DEFINES_H__
|
||||||
|
|
||||||
#include <vita2d.h>
|
#include <vita2d.h>
|
||||||
|
|
|
@ -52,6 +52,162 @@
|
||||||
#include "../drivers_shader/shader_vulkan.h"
|
#include "../drivers_shader/shader_vulkan.h"
|
||||||
#include "../include/vulkan/vulkan.h"
|
#include "../include/vulkan/vulkan.h"
|
||||||
|
|
||||||
|
#define VK_BUFFER_CHAIN_DISCARD(chain) \
|
||||||
|
{ \
|
||||||
|
chain->current = chain->head; \
|
||||||
|
chain->offset = 0; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define VULKAN_SYNC_TEXTURE_TO_GPU(device, tex_memory) \
|
||||||
|
{ \
|
||||||
|
VkMappedMemoryRange range; \
|
||||||
|
range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; \
|
||||||
|
range.pNext = NULL; \
|
||||||
|
range.memory = tex_memory; \
|
||||||
|
range.offset = 0; \
|
||||||
|
range.size = VK_WHOLE_SIZE; \
|
||||||
|
vkFlushMappedMemoryRanges(device, 1, &range); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define VULKAN_SYNC_TEXTURE_TO_CPU(device, tex_memory) \
|
||||||
|
{ \
|
||||||
|
VkMappedMemoryRange range; \
|
||||||
|
range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; \
|
||||||
|
range.pNext = NULL; \
|
||||||
|
range.memory = tex_memory; \
|
||||||
|
range.offset = 0; \
|
||||||
|
range.size = VK_WHOLE_SIZE; \
|
||||||
|
vkInvalidateMappedMemoryRanges(device, 1, &range); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define VULKAN_IMAGE_LAYOUT_TRANSITION_LEVELS(cmd, img, levels, old_layout, new_layout, src_access, dst_access, src_stages, dst_stages, src_queue_family_idx, dst_queue_family_idx) \
|
||||||
|
{ \
|
||||||
|
VkImageMemoryBarrier barrier; \
|
||||||
|
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; \
|
||||||
|
barrier.pNext = NULL; \
|
||||||
|
barrier.srcAccessMask = src_access; \
|
||||||
|
barrier.dstAccessMask = dst_access; \
|
||||||
|
barrier.oldLayout = old_layout; \
|
||||||
|
barrier.newLayout = new_layout; \
|
||||||
|
barrier.srcQueueFamilyIndex = src_queue_family_idx; \
|
||||||
|
barrier.dstQueueFamilyIndex = dst_queue_family_idx; \
|
||||||
|
barrier.image = img; \
|
||||||
|
barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; \
|
||||||
|
barrier.subresourceRange.baseMipLevel = 0; \
|
||||||
|
barrier.subresourceRange.levelCount = levels; \
|
||||||
|
barrier.subresourceRange.baseArrayLayer = 0; \
|
||||||
|
barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS; \
|
||||||
|
vkCmdPipelineBarrier(cmd, src_stages, dst_stages, 0, 0, NULL, 0, NULL, 1, &barrier); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define VULKAN_TRANSFER_IMAGE_OWNERSHIP(cmd, img, layout, src_stages, dst_stages, src_queue_family, dst_queue_family) VULKAN_IMAGE_LAYOUT_TRANSITION_LEVELS(cmd, img, VK_REMAINING_MIP_LEVELS, layout, layout, 0, 0, src_stages, dst_stages, src_queue_family, dst_queue_family)
|
||||||
|
|
||||||
|
#define VULKAN_IMAGE_LAYOUT_TRANSITION(cmd, img, old_layout, new_layout, src_access, dst_access, src_stages, dst_stages) VULKAN_IMAGE_LAYOUT_TRANSITION_LEVELS(cmd, img, VK_REMAINING_MIP_LEVELS, old_layout, new_layout, src_access, dst_access, src_stages, dst_stages, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED)
|
||||||
|
|
||||||
|
#define VK_DESCRIPTOR_MANAGER_RESTART(manager) \
|
||||||
|
{ \
|
||||||
|
manager->current = manager->head; \
|
||||||
|
manager->count = 0; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define VK_MAP_PERSISTENT_TEXTURE(device, texture) \
|
||||||
|
{ \
|
||||||
|
vkMapMemory(device, texture->memory, texture->offset, texture->size, 0, &texture->mapped); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define VULKAN_PASS_SET_TEXTURE(device, set, _sampler, binding, image_view, image_layout) \
|
||||||
|
{ \
|
||||||
|
VkDescriptorImageInfo image_info; \
|
||||||
|
VkWriteDescriptorSet write; \
|
||||||
|
image_info.sampler = _sampler; \
|
||||||
|
image_info.imageView = image_view; \
|
||||||
|
image_info.imageLayout = image_layout; \
|
||||||
|
write.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; \
|
||||||
|
write.pNext = NULL; \
|
||||||
|
write.dstSet = set; \
|
||||||
|
write.dstBinding = binding; \
|
||||||
|
write.dstArrayElement = 0; \
|
||||||
|
write.descriptorCount = 1; \
|
||||||
|
write.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; \
|
||||||
|
write.pImageInfo = &image_info; \
|
||||||
|
write.pBufferInfo = NULL; \
|
||||||
|
write.pTexelBufferView = NULL; \
|
||||||
|
vkUpdateDescriptorSets(device, 1, &write, 0, NULL); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define VULKAN_WRITE_QUAD_VBO(pv, _x, _y, _width, _height, _tex_x, _tex_y, _tex_width, _tex_height, vulkan_color) \
|
||||||
|
{ \
|
||||||
|
float r = (vulkan_color)->r; \
|
||||||
|
float g = (vulkan_color)->g; \
|
||||||
|
float b = (vulkan_color)->b; \
|
||||||
|
float a = (vulkan_color)->a; \
|
||||||
|
pv[0].x = (_x) + 0.0f * (_width); \
|
||||||
|
pv[0].y = (_y) + 0.0f * (_height); \
|
||||||
|
pv[0].tex_x = (_tex_x) + 0.0f * (_tex_width); \
|
||||||
|
pv[0].tex_y = (_tex_y) + 0.0f * (_tex_height); \
|
||||||
|
pv[0].color.r = r; \
|
||||||
|
pv[0].color.g = g; \
|
||||||
|
pv[0].color.b = b; \
|
||||||
|
pv[0].color.a = a; \
|
||||||
|
pv[1].x = (_x) + 0.0f * (_width); \
|
||||||
|
pv[1].y = (_y) + 1.0f * (_height); \
|
||||||
|
pv[1].tex_x = (_tex_x) + 0.0f * (_tex_width); \
|
||||||
|
pv[1].tex_y = (_tex_y) + 1.0f * (_tex_height); \
|
||||||
|
pv[1].color.r = r; \
|
||||||
|
pv[1].color.g = g; \
|
||||||
|
pv[1].color.b = b; \
|
||||||
|
pv[1].color.a = a; \
|
||||||
|
pv[2].x = (_x) + 1.0f * (_width); \
|
||||||
|
pv[2].y = (_y) + 0.0f * (_height); \
|
||||||
|
pv[2].tex_x = (_tex_x) + 1.0f * (_tex_width); \
|
||||||
|
pv[2].tex_y = (_tex_y) + 0.0f * (_tex_height); \
|
||||||
|
pv[2].color.r = r; \
|
||||||
|
pv[2].color.g = g; \
|
||||||
|
pv[2].color.b = b; \
|
||||||
|
pv[2].color.a = a; \
|
||||||
|
pv[3].x = (_x) + 1.0f * (_width); \
|
||||||
|
pv[3].y = (_y) + 1.0f * (_height); \
|
||||||
|
pv[3].tex_x = (_tex_x) + 1.0f * (_tex_width); \
|
||||||
|
pv[3].tex_y = (_tex_y) + 1.0f * (_tex_height); \
|
||||||
|
pv[3].color.r = r; \
|
||||||
|
pv[3].color.g = g; \
|
||||||
|
pv[3].color.b = b; \
|
||||||
|
pv[3].color.a = a; \
|
||||||
|
pv[4].x = (_x) + 1.0f * (_width); \
|
||||||
|
pv[4].y = (_y) + 0.0f * (_height); \
|
||||||
|
pv[4].tex_x = (_tex_x) + 1.0f * (_tex_width); \
|
||||||
|
pv[4].tex_y = (_tex_y) + 0.0f * (_tex_height); \
|
||||||
|
pv[4].color.r = r; \
|
||||||
|
pv[4].color.g = g; \
|
||||||
|
pv[4].color.b = b; \
|
||||||
|
pv[4].color.a = a; \
|
||||||
|
pv[5].x = (_x) + 0.0f * (_width); \
|
||||||
|
pv[5].y = (_y) + 1.0f * (_height); \
|
||||||
|
pv[5].tex_x = (_tex_x) + 0.0f * (_tex_width); \
|
||||||
|
pv[5].tex_y = (_tex_y) + 1.0f * (_tex_height); \
|
||||||
|
pv[5].color.r = r; \
|
||||||
|
pv[5].color.g = g; \
|
||||||
|
pv[5].color.b = b; \
|
||||||
|
pv[5].color.a = a; \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We don't have to sync against previous TRANSFER,
|
||||||
|
* since we observed the completion by fences.
|
||||||
|
*
|
||||||
|
* If we have a single texture_optimal, we would need to sync against
|
||||||
|
* previous transfers to avoid races.
|
||||||
|
*
|
||||||
|
* We would also need to optionally maintain extra textures due to
|
||||||
|
* changes in resolution, so this seems like the sanest and
|
||||||
|
* simplest solution. */
|
||||||
|
#define VULKAN_SYNC_TEXTURE_TO_GPU_COND_PTR(vk, tex) \
|
||||||
|
if (((tex)->flags & VK_TEX_FLAG_NEED_MANUAL_CACHE_MANAGEMENT) && (tex)->memory != VK_NULL_HANDLE) \
|
||||||
|
VULKAN_SYNC_TEXTURE_TO_GPU(vk->context->device, (tex)->memory) \
|
||||||
|
|
||||||
|
#define VULKAN_SYNC_TEXTURE_TO_GPU_COND_OBJ(vk, tex) \
|
||||||
|
if (((tex).flags & VK_TEX_FLAG_NEED_MANUAL_CACHE_MANAGEMENT) && (tex).memory != VK_NULL_HANDLE) \
|
||||||
|
VULKAN_SYNC_TEXTURE_TO_GPU(vk->context->device, (tex).memory) \
|
||||||
|
|
||||||
RETRO_BEGIN_DECLS
|
RETRO_BEGIN_DECLS
|
||||||
|
|
||||||
enum vk_texture_type
|
enum vk_texture_type
|
||||||
|
@ -89,6 +245,46 @@ enum vulkan_wsi_type
|
||||||
VULKAN_WSI_MVK_IOS,
|
VULKAN_WSI_MVK_IOS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum vulkan_context_flags
|
||||||
|
{
|
||||||
|
VK_CTX_FLAG_INVALID_SWAPCHAIN = (1 << 0),
|
||||||
|
VK_CTX_FLAG_HDR_ENABLE = (1 << 1),
|
||||||
|
/* Used by screenshot to get blits with correct colorspace. */
|
||||||
|
VK_CTX_FLAG_SWAPCHAIN_IS_SRGB = (1 << 2),
|
||||||
|
VK_CTX_FLAG_SWAP_INTERVAL_EMULATION_LOCK = (1 << 3),
|
||||||
|
VK_CTX_FLAG_HAS_ACQUIRED_SWAPCHAIN = (1 << 4),
|
||||||
|
};
|
||||||
|
|
||||||
|
enum vulkan_emulated_mailbox_flags
|
||||||
|
{
|
||||||
|
VK_MAILBOX_FLAG_ACQUIRED = (1 << 0),
|
||||||
|
VK_MAILBOX_FLAG_REQUEST_ACQUIRE = (1 << 1),
|
||||||
|
VK_MAILBOX_FLAG_DEAD = (1 << 2),
|
||||||
|
VK_MAILBOX_FLAG_HAS_PENDING_REQUEST = (1 << 3)
|
||||||
|
};
|
||||||
|
|
||||||
|
enum gfx_ctx_vulkan_data_flags
|
||||||
|
{
|
||||||
|
/* If set, prefer a path where we use
|
||||||
|
* semaphores instead of fences for vkAcquireNextImageKHR.
|
||||||
|
* Helps workaround certain performance issues on some drivers. */
|
||||||
|
VK_DATA_FLAG_USE_WSI_SEMAPHORE = (1 << 0),
|
||||||
|
VK_DATA_FLAG_NEED_NEW_SWAPCHAIN = (1 << 1),
|
||||||
|
VK_DATA_FLAG_CREATED_NEW_SWAPCHAIN = (1 << 2),
|
||||||
|
VK_DATA_FLAG_EMULATE_MAILBOX = (1 << 3),
|
||||||
|
VK_DATA_FLAG_EMULATING_MAILBOX = (1 << 4),
|
||||||
|
/* Used to check if we need to use mailbox emulation or not.
|
||||||
|
* Only relevant on Windows for now. */
|
||||||
|
VK_DATA_FLAG_FULLSCREEN = (1 << 5)
|
||||||
|
};
|
||||||
|
|
||||||
|
enum vk_texture_flags
|
||||||
|
{
|
||||||
|
VK_TEX_FLAG_DEFAULT_SMOOTH = (1 << 0),
|
||||||
|
VK_TEX_FLAG_NEED_MANUAL_CACHE_MANAGEMENT = (1 << 1),
|
||||||
|
VK_TEX_FLAG_MIPMAP = (1 << 2)
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef VULKAN_HDR_SWAPCHAIN
|
#ifdef VULKAN_HDR_SWAPCHAIN
|
||||||
|
|
||||||
#ifndef VKALIGN
|
#ifndef VKALIGN
|
||||||
|
@ -111,16 +307,6 @@ typedef struct VKALIGN(16)
|
||||||
} vulkan_hdr_uniform_t;
|
} vulkan_hdr_uniform_t;
|
||||||
#endif /* VULKAN_HDR_SWAPCHAIN */
|
#endif /* VULKAN_HDR_SWAPCHAIN */
|
||||||
|
|
||||||
enum vulkan_context_flags
|
|
||||||
{
|
|
||||||
VK_CTX_FLAG_INVALID_SWAPCHAIN = (1 << 0),
|
|
||||||
VK_CTX_FLAG_HDR_ENABLE = (1 << 1),
|
|
||||||
/* Used by screenshot to get blits with correct colorspace. */
|
|
||||||
VK_CTX_FLAG_SWAPCHAIN_IS_SRGB = (1 << 2),
|
|
||||||
VK_CTX_FLAG_SWAP_INTERVAL_EMULATION_LOCK = (1 << 3),
|
|
||||||
VK_CTX_FLAG_HAS_ACQUIRED_SWAPCHAIN = (1 << 4),
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct vulkan_context
|
typedef struct vulkan_context
|
||||||
{
|
{
|
||||||
slock_t *queue_lock;
|
slock_t *queue_lock;
|
||||||
|
@ -164,14 +350,6 @@ typedef struct vulkan_context
|
||||||
bool swapchain_fences_signalled[VULKAN_MAX_SWAPCHAIN_IMAGES];
|
bool swapchain_fences_signalled[VULKAN_MAX_SWAPCHAIN_IMAGES];
|
||||||
} vulkan_context_t;
|
} vulkan_context_t;
|
||||||
|
|
||||||
enum vulkan_emulated_mailbox_flags
|
|
||||||
{
|
|
||||||
VK_MAILBOX_FLAG_ACQUIRED = (1 << 0),
|
|
||||||
VK_MAILBOX_FLAG_REQUEST_ACQUIRE = (1 << 1),
|
|
||||||
VK_MAILBOX_FLAG_DEAD = (1 << 2),
|
|
||||||
VK_MAILBOX_FLAG_HAS_PENDING_REQUEST = (1 << 3)
|
|
||||||
};
|
|
||||||
|
|
||||||
struct vulkan_emulated_mailbox
|
struct vulkan_emulated_mailbox
|
||||||
{
|
{
|
||||||
sthread_t *thread;
|
sthread_t *thread;
|
||||||
|
@ -185,21 +363,6 @@ struct vulkan_emulated_mailbox
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum gfx_ctx_vulkan_data_flags
|
|
||||||
{
|
|
||||||
/* If set, prefer a path where we use
|
|
||||||
* semaphores instead of fences for vkAcquireNextImageKHR.
|
|
||||||
* Helps workaround certain performance issues on some drivers. */
|
|
||||||
VK_DATA_FLAG_USE_WSI_SEMAPHORE = (1 << 0),
|
|
||||||
VK_DATA_FLAG_NEED_NEW_SWAPCHAIN = (1 << 1),
|
|
||||||
VK_DATA_FLAG_CREATED_NEW_SWAPCHAIN = (1 << 2),
|
|
||||||
VK_DATA_FLAG_EMULATE_MAILBOX = (1 << 3),
|
|
||||||
VK_DATA_FLAG_EMULATING_MAILBOX = (1 << 4),
|
|
||||||
/* Used to check if we need to use mailbox emulation or not.
|
|
||||||
* Only relevant on Windows for now. */
|
|
||||||
VK_DATA_FLAG_FULLSCREEN = (1 << 5)
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct gfx_ctx_vulkan_data
|
typedef struct gfx_ctx_vulkan_data
|
||||||
{
|
{
|
||||||
struct string_list *gpu_list;
|
struct string_list *gpu_list;
|
||||||
|
@ -239,13 +402,6 @@ struct vk_image
|
||||||
VkDeviceMemory memory; /* ptr alignment */
|
VkDeviceMemory memory; /* ptr alignment */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum vk_texture_flags
|
|
||||||
{
|
|
||||||
VK_TEX_FLAG_DEFAULT_SMOOTH = (1 << 0),
|
|
||||||
VK_TEX_FLAG_NEED_MANUAL_CACHE_MANAGEMENT = (1 << 1),
|
|
||||||
VK_TEX_FLAG_MIPMAP = (1 << 2)
|
|
||||||
};
|
|
||||||
|
|
||||||
struct vk_texture
|
struct vk_texture
|
||||||
{
|
{
|
||||||
VkDeviceSize memory_size; /* uint64_t alignment */
|
VkDeviceSize memory_size; /* uint64_t alignment */
|
||||||
|
@ -497,145 +653,6 @@ typedef struct vk
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
} vk_t;
|
} vk_t;
|
||||||
|
|
||||||
#define VK_BUFFER_CHAIN_DISCARD(chain) \
|
|
||||||
{ \
|
|
||||||
chain->current = chain->head; \
|
|
||||||
chain->offset = 0; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define VULKAN_SYNC_TEXTURE_TO_GPU(device, tex_memory) \
|
|
||||||
{ \
|
|
||||||
VkMappedMemoryRange range; \
|
|
||||||
range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; \
|
|
||||||
range.pNext = NULL; \
|
|
||||||
range.memory = tex_memory; \
|
|
||||||
range.offset = 0; \
|
|
||||||
range.size = VK_WHOLE_SIZE; \
|
|
||||||
vkFlushMappedMemoryRanges(device, 1, &range); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define VULKAN_SYNC_TEXTURE_TO_CPU(device, tex_memory) \
|
|
||||||
{ \
|
|
||||||
VkMappedMemoryRange range; \
|
|
||||||
range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; \
|
|
||||||
range.pNext = NULL; \
|
|
||||||
range.memory = tex_memory; \
|
|
||||||
range.offset = 0; \
|
|
||||||
range.size = VK_WHOLE_SIZE; \
|
|
||||||
vkInvalidateMappedMemoryRanges(device, 1, &range); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define VULKAN_IMAGE_LAYOUT_TRANSITION_LEVELS(cmd, img, levels, old_layout, new_layout, src_access, dst_access, src_stages, dst_stages, src_queue_family_idx, dst_queue_family_idx) \
|
|
||||||
{ \
|
|
||||||
VkImageMemoryBarrier barrier; \
|
|
||||||
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; \
|
|
||||||
barrier.pNext = NULL; \
|
|
||||||
barrier.srcAccessMask = src_access; \
|
|
||||||
barrier.dstAccessMask = dst_access; \
|
|
||||||
barrier.oldLayout = old_layout; \
|
|
||||||
barrier.newLayout = new_layout; \
|
|
||||||
barrier.srcQueueFamilyIndex = src_queue_family_idx; \
|
|
||||||
barrier.dstQueueFamilyIndex = dst_queue_family_idx; \
|
|
||||||
barrier.image = img; \
|
|
||||||
barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; \
|
|
||||||
barrier.subresourceRange.baseMipLevel = 0; \
|
|
||||||
barrier.subresourceRange.levelCount = levels; \
|
|
||||||
barrier.subresourceRange.baseArrayLayer = 0; \
|
|
||||||
barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS; \
|
|
||||||
vkCmdPipelineBarrier(cmd, src_stages, dst_stages, 0, 0, NULL, 0, NULL, 1, &barrier); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define VULKAN_TRANSFER_IMAGE_OWNERSHIP(cmd, img, layout, src_stages, dst_stages, src_queue_family, dst_queue_family) VULKAN_IMAGE_LAYOUT_TRANSITION_LEVELS(cmd, img, VK_REMAINING_MIP_LEVELS, layout, layout, 0, 0, src_stages, dst_stages, src_queue_family, dst_queue_family)
|
|
||||||
|
|
||||||
#define VULKAN_IMAGE_LAYOUT_TRANSITION(cmd, img, old_layout, new_layout, src_access, dst_access, src_stages, dst_stages) VULKAN_IMAGE_LAYOUT_TRANSITION_LEVELS(cmd, img, VK_REMAINING_MIP_LEVELS, old_layout, new_layout, src_access, dst_access, src_stages, dst_stages, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED)
|
|
||||||
|
|
||||||
#define VK_DESCRIPTOR_MANAGER_RESTART(manager) \
|
|
||||||
{ \
|
|
||||||
manager->current = manager->head; \
|
|
||||||
manager->count = 0; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define VK_MAP_PERSISTENT_TEXTURE(device, texture) \
|
|
||||||
{ \
|
|
||||||
vkMapMemory(device, texture->memory, texture->offset, texture->size, 0, &texture->mapped); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define VULKAN_PASS_SET_TEXTURE(device, set, _sampler, binding, image_view, image_layout) \
|
|
||||||
{ \
|
|
||||||
VkDescriptorImageInfo image_info; \
|
|
||||||
VkWriteDescriptorSet write; \
|
|
||||||
image_info.sampler = _sampler; \
|
|
||||||
image_info.imageView = image_view; \
|
|
||||||
image_info.imageLayout = image_layout; \
|
|
||||||
write.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; \
|
|
||||||
write.pNext = NULL; \
|
|
||||||
write.dstSet = set; \
|
|
||||||
write.dstBinding = binding; \
|
|
||||||
write.dstArrayElement = 0; \
|
|
||||||
write.descriptorCount = 1; \
|
|
||||||
write.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; \
|
|
||||||
write.pImageInfo = &image_info; \
|
|
||||||
write.pBufferInfo = NULL; \
|
|
||||||
write.pTexelBufferView = NULL; \
|
|
||||||
vkUpdateDescriptorSets(device, 1, &write, 0, NULL); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define VULKAN_WRITE_QUAD_VBO(pv, _x, _y, _width, _height, _tex_x, _tex_y, _tex_width, _tex_height, vulkan_color) \
|
|
||||||
{ \
|
|
||||||
float r = (vulkan_color)->r; \
|
|
||||||
float g = (vulkan_color)->g; \
|
|
||||||
float b = (vulkan_color)->b; \
|
|
||||||
float a = (vulkan_color)->a; \
|
|
||||||
pv[0].x = (_x) + 0.0f * (_width); \
|
|
||||||
pv[0].y = (_y) + 0.0f * (_height); \
|
|
||||||
pv[0].tex_x = (_tex_x) + 0.0f * (_tex_width); \
|
|
||||||
pv[0].tex_y = (_tex_y) + 0.0f * (_tex_height); \
|
|
||||||
pv[0].color.r = r; \
|
|
||||||
pv[0].color.g = g; \
|
|
||||||
pv[0].color.b = b; \
|
|
||||||
pv[0].color.a = a; \
|
|
||||||
pv[1].x = (_x) + 0.0f * (_width); \
|
|
||||||
pv[1].y = (_y) + 1.0f * (_height); \
|
|
||||||
pv[1].tex_x = (_tex_x) + 0.0f * (_tex_width); \
|
|
||||||
pv[1].tex_y = (_tex_y) + 1.0f * (_tex_height); \
|
|
||||||
pv[1].color.r = r; \
|
|
||||||
pv[1].color.g = g; \
|
|
||||||
pv[1].color.b = b; \
|
|
||||||
pv[1].color.a = a; \
|
|
||||||
pv[2].x = (_x) + 1.0f * (_width); \
|
|
||||||
pv[2].y = (_y) + 0.0f * (_height); \
|
|
||||||
pv[2].tex_x = (_tex_x) + 1.0f * (_tex_width); \
|
|
||||||
pv[2].tex_y = (_tex_y) + 0.0f * (_tex_height); \
|
|
||||||
pv[2].color.r = r; \
|
|
||||||
pv[2].color.g = g; \
|
|
||||||
pv[2].color.b = b; \
|
|
||||||
pv[2].color.a = a; \
|
|
||||||
pv[3].x = (_x) + 1.0f * (_width); \
|
|
||||||
pv[3].y = (_y) + 1.0f * (_height); \
|
|
||||||
pv[3].tex_x = (_tex_x) + 1.0f * (_tex_width); \
|
|
||||||
pv[3].tex_y = (_tex_y) + 1.0f * (_tex_height); \
|
|
||||||
pv[3].color.r = r; \
|
|
||||||
pv[3].color.g = g; \
|
|
||||||
pv[3].color.b = b; \
|
|
||||||
pv[3].color.a = a; \
|
|
||||||
pv[4].x = (_x) + 1.0f * (_width); \
|
|
||||||
pv[4].y = (_y) + 0.0f * (_height); \
|
|
||||||
pv[4].tex_x = (_tex_x) + 1.0f * (_tex_width); \
|
|
||||||
pv[4].tex_y = (_tex_y) + 0.0f * (_tex_height); \
|
|
||||||
pv[4].color.r = r; \
|
|
||||||
pv[4].color.g = g; \
|
|
||||||
pv[4].color.b = b; \
|
|
||||||
pv[4].color.a = a; \
|
|
||||||
pv[5].x = (_x) + 0.0f * (_width); \
|
|
||||||
pv[5].y = (_y) + 1.0f * (_height); \
|
|
||||||
pv[5].tex_x = (_tex_x) + 0.0f * (_tex_width); \
|
|
||||||
pv[5].tex_y = (_tex_y) + 1.0f * (_tex_height); \
|
|
||||||
pv[5].color.r = r; \
|
|
||||||
pv[5].color.g = g; \
|
|
||||||
pv[5].color.b = b; \
|
|
||||||
pv[5].color.a = a; \
|
|
||||||
}
|
|
||||||
|
|
||||||
bool vulkan_buffer_chain_alloc(const struct vulkan_context *context,
|
bool vulkan_buffer_chain_alloc(const struct vulkan_context *context,
|
||||||
struct vk_buffer_chain *chain, size_t size,
|
struct vk_buffer_chain *chain, size_t size,
|
||||||
struct vk_buffer_range *range);
|
struct vk_buffer_range *range);
|
||||||
|
@ -657,23 +674,6 @@ void vulkan_transition_texture(vk_t *vk, VkCommandBuffer cmd, struct vk_texture
|
||||||
|
|
||||||
void vulkan_debug_mark_buffer(VkDevice device, VkBuffer buffer);
|
void vulkan_debug_mark_buffer(VkDevice device, VkBuffer buffer);
|
||||||
|
|
||||||
/* We don't have to sync against previous TRANSFER,
|
|
||||||
* since we observed the completion by fences.
|
|
||||||
*
|
|
||||||
* If we have a single texture_optimal, we would need to sync against
|
|
||||||
* previous transfers to avoid races.
|
|
||||||
*
|
|
||||||
* We would also need to optionally maintain extra textures due to
|
|
||||||
* changes in resolution, so this seems like the sanest and
|
|
||||||
* simplest solution. */
|
|
||||||
#define VULKAN_SYNC_TEXTURE_TO_GPU_COND_PTR(vk, tex) \
|
|
||||||
if (((tex)->flags & VK_TEX_FLAG_NEED_MANUAL_CACHE_MANAGEMENT) && (tex)->memory != VK_NULL_HANDLE) \
|
|
||||||
VULKAN_SYNC_TEXTURE_TO_GPU(vk->context->device, (tex)->memory) \
|
|
||||||
|
|
||||||
#define VULKAN_SYNC_TEXTURE_TO_GPU_COND_OBJ(vk, tex) \
|
|
||||||
if (((tex).flags & VK_TEX_FLAG_NEED_MANUAL_CACHE_MANAGEMENT) && (tex).memory != VK_NULL_HANDLE) \
|
|
||||||
VULKAN_SYNC_TEXTURE_TO_GPU(vk->context->device, (tex).memory) \
|
|
||||||
|
|
||||||
void vulkan_write_quad_descriptors(
|
void vulkan_write_quad_descriptors(
|
||||||
VkDevice device,
|
VkDevice device,
|
||||||
VkDescriptorSet set,
|
VkDescriptorSet set,
|
||||||
|
|
|
@ -21,14 +21,16 @@
|
||||||
|
|
||||||
#include "../../input/common/wayland_common.h"
|
#include "../../input/common/wayland_common.h"
|
||||||
|
|
||||||
typedef struct toplevel_listener {
|
typedef struct toplevel_listener
|
||||||
|
{
|
||||||
#ifdef HAVE_LIBDECOR_H
|
#ifdef HAVE_LIBDECOR_H
|
||||||
struct libdecor_frame_interface libdecor_frame_interface;
|
struct libdecor_frame_interface libdecor_frame_interface;
|
||||||
#endif
|
#endif
|
||||||
struct xdg_toplevel_listener xdg_toplevel_listener;
|
struct xdg_toplevel_listener xdg_toplevel_listener;
|
||||||
} toplevel_listener_t;
|
} toplevel_listener_t;
|
||||||
|
|
||||||
typedef struct shm_buffer {
|
typedef struct shm_buffer
|
||||||
|
{
|
||||||
struct wl_buffer *wl_buffer;
|
struct wl_buffer *wl_buffer;
|
||||||
void *data;
|
void *data;
|
||||||
size_t data_size;
|
size_t data_size;
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
#include "win32_common.h"
|
#include "win32_common.h"
|
||||||
|
|
||||||
#ifdef HAVE_GDI
|
#ifdef HAVE_GDI
|
||||||
#include "gdi_common.h"
|
#include "gdi_defines.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
|
|
|
@ -30,8 +30,7 @@
|
||||||
#include "../../menu/menu_driver.h"
|
#include "../../menu/menu_driver.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../common/caca_common.h"
|
#include "../common/caca_defines.h"
|
||||||
|
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
|
|
||||||
#include "../../driver.h"
|
#include "../../driver.h"
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
#include "../../runloop.h"
|
#include "../../runloop.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
|
|
||||||
#include "../common/ctr_common.h"
|
#include "../common/ctr_defines.h"
|
||||||
#ifndef HAVE_THREADS
|
#ifndef HAVE_THREADS
|
||||||
#include "../../tasks/tasks_internal.h"
|
#include "../../tasks/tasks_internal.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
#include "../../retroarch.h"
|
#include "../../retroarch.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
#include "../common/gdi_common.h"
|
#include "../common/gdi_defines.h"
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(_XBOX)
|
#if defined(_WIN32) && !defined(_XBOX)
|
||||||
#include "../common/win32_common.h"
|
#include "../common/win32_common.h"
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
#include "../../retroarch.h"
|
#include "../../retroarch.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
#include "../common/gl1_common.h"
|
#include "../common/gl1_defines.h"
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(_XBOX)
|
#if defined(_WIN32) && !defined(_XBOX)
|
||||||
#include "../common/win32_common.h"
|
#include "../common/win32_common.h"
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
#include "../gfx_widgets.h"
|
#include "../gfx_widgets.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gfx/common/gx2_common.h"
|
#include "gfx/common/gx2_defines.h"
|
||||||
#include "gfx/video_shader_parse.h"
|
#include "gfx/video_shader_parse.h"
|
||||||
#include "gfx/drivers_shader/slang_process.h"
|
#include "gfx/drivers_shader/slang_process.h"
|
||||||
#include "system/memory.h"
|
#include "system/memory.h"
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
|
|
||||||
#include "../gfx_display.h"
|
#include "../gfx_display.h"
|
||||||
#include "../common/ps2_common.h"
|
#include "../common/ps2_defines.h"
|
||||||
|
|
||||||
/* Generic tint color */
|
/* Generic tint color */
|
||||||
#define GS_TEXT GS_SETREG_RGBA(0x80, 0x80, 0x80, 0x80)
|
#define GS_TEXT GS_SETREG_RGBA(0x80, 0x80, 0x80, 0x80)
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include "../gfx_widgets.h"
|
#include "../gfx_widgets.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../common/rsx_common.h"
|
#include "../common/rsx_defines.h"
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
|
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "../../retroarch.h"
|
#include "../../retroarch.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
#include "../common/sixel_common.h"
|
#include "../common/sixel_defines.h"
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#define HAVE_SYS_IOCTL_H
|
#define HAVE_SYS_IOCTL_H
|
||||||
|
|
|
@ -125,7 +125,7 @@ void gfx_slow_swizzling_blit(uint32_t *buffer, uint32_t *image, int w, int h, in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_cpy_dsp_buf(uint32_t *buffer, uint32_t *image, int w, int h, uint32_t stride, bool blend)
|
static void gfx_cpy_dsp_buf(uint32_t *buffer, uint32_t *image, int w, int h, uint32_t stride, bool blend)
|
||||||
{
|
{
|
||||||
uint32_t *dest = buffer;
|
uint32_t *dest = buffer;
|
||||||
uint32_t *src = image;
|
uint32_t *src = image;
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "../../menu/menu_driver.h"
|
#include "../../menu/menu_driver.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../common/vga_common.h"
|
#include "../common/vga_defines.h"
|
||||||
|
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
|
|
||||||
#include "../common/vita2d_common.h"
|
#include "../common/vita2d_defines.h"
|
||||||
#include "../../driver.h"
|
#include "../../driver.h"
|
||||||
#include "../video_coord_array.h"
|
#include "../video_coord_array.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "../common/egl_common.h"
|
#include "../common/egl_common.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../common/orbis_common.h"
|
#include "../common/orbis_defines.h"
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include <defines/ps4_defines.h>
|
#include <defines/ps4_defines.h>
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "../gfx_display.h"
|
#include "../gfx_display.h"
|
||||||
|
|
||||||
#include "../common/ctr_common.h"
|
#include "../common/ctr_defines.h"
|
||||||
#include "../drivers/ctr_gu.h"
|
#include "../drivers/ctr_gu.h"
|
||||||
#include "../../ctr/gpu_old.h"
|
#include "../../ctr/gpu_old.h"
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(_XBOX)
|
#if defined(_WIN32) && !defined(_XBOX)
|
||||||
#include "../common/win32_common.h"
|
#include "../common/win32_common.h"
|
||||||
#include "../common/gdi_common.h"
|
#include "../common/gdi_defines.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const float *gfx_display_gdi_get_default_vertices(void)
|
static const float *gfx_display_gdi_get_default_vertices(void)
|
||||||
|
|
|
@ -21,8 +21,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../gfx_display.h"
|
#include "../gfx_display.h"
|
||||||
|
#include "../common/gl1_defines.h"
|
||||||
#include "../common/gl1_common.h"
|
|
||||||
|
|
||||||
static const GLfloat gl1_menu_vertexes[8] = {
|
static const GLfloat gl1_menu_vertexes[8] = {
|
||||||
0, 0,
|
0, 0,
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "../gfx_display.h"
|
#include "../gfx_display.h"
|
||||||
|
|
||||||
#include "../common/rsx_common.h"
|
#include "../common/rsx_defines.h"
|
||||||
|
|
||||||
static const float rsx_vertexes[8] = {
|
static const float rsx_vertexes[8] = {
|
||||||
0, 0,
|
0, 0,
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include "../gfx_display.h"
|
#include "../gfx_display.h"
|
||||||
|
|
||||||
#include "../common/vita2d_common.h"
|
#include "../common/vita2d_defines.h"
|
||||||
#include <defines/psp_defines.h>
|
#include <defines/psp_defines.h>
|
||||||
|
|
||||||
static const float vita2d_vertexes[8] = {
|
static const float vita2d_vertexes[8] = {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../gfx_display.h"
|
#include "../gfx_display.h"
|
||||||
|
|
||||||
#include "../common/gx2_common.h"
|
#include "../common/gx2_defines.h"
|
||||||
#include "../../wiiu/system/memory.h"
|
#include "../../wiiu/system/memory.h"
|
||||||
#include "../../wiiu/wiiu_dbg.h"
|
#include "../../wiiu/wiiu_dbg.h"
|
||||||
|
|
||||||
|
|
|
@ -122,8 +122,8 @@
|
||||||
|
|
||||||
/* Required for 3DS display mode setting */
|
/* Required for 3DS display mode setting */
|
||||||
#if defined(_3DS)
|
#if defined(_3DS)
|
||||||
#include "gfx/common/ctr_common.h"
|
|
||||||
#include <3ds/services/cfgu.h>
|
#include <3ds/services/cfgu.h>
|
||||||
|
#include "gfx/common/ctr_defines.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(DINGUX)
|
#if defined(DINGUX)
|
||||||
|
|
Loading…
Reference in New Issue