Rename common files to _defines.h

This commit is contained in:
libretroadmin 2023-05-31 22:46:34 +02:00
parent 2bf08f5457
commit d1b9badf41
39 changed files with 295 additions and 292 deletions

View File

@ -34,7 +34,7 @@
/* Required for 3DS display mode setting */
#if defined(_3DS)
#include "gfx/common/ctr_common.h"
#include "gfx/common/ctr_defines.h"
#endif
/* Required for OpenDingux IPU filter + refresh

View File

@ -15,8 +15,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CACA_COMMON_H
#define __CACA_COMMON_H
#ifndef __CACA_DEFINES_H
#define __CACA_DEFINES_H
struct caca_canvas;
struct caca_dither;

View File

@ -13,8 +13,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CTR_COMMON_H__
#define CTR_COMMON_H__
#ifndef CTR_DEFINES_H__
#define CTR_DEFINES_H__
#include <3ds.h>
#include <retro_inline.h>
@ -33,33 +33,6 @@
(vec)->u = 1.0f / (texture_width); \
(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
{
CTR_VIDEO_MODE_3D = 0,
@ -76,6 +49,20 @@ typedef enum
CTR_BOTTOM_MENU_SELECT
} 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
{
struct
@ -191,4 +178,17 @@ struct ctr_overlay_data
};
#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__ */

View File

@ -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))
typedef enum {
typedef enum
{
DXGI_FORMAT_EX_A4R4G4B4_UNORM = 1000
} DXGI_FORMAT_EX;

View File

@ -15,8 +15,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDI_COMMON_H
#define __GDI_COMMON_H
#ifndef __GDI_DEFINES_H
#define __GDI_DEFINES_H
#include <stdint.h>

View File

@ -15,8 +15,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GL1_COMMON_H
#define __GL1_COMMON_H
#ifndef __GL1_DEFINES_H
#define __GL1_DEFINES_H
#include <retro_environment.h>
#include <retro_inline.h>

View File

@ -36,6 +36,13 @@
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)
#define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
#define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
@ -251,13 +258,6 @@ struct gl2
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(
const void *shader_data,
GLuint *textures_lut);

View File

@ -42,6 +42,7 @@ RETRO_BEGIN_DECLS
#define GL_CORE_NUM_PBOS 4
#define GL_CORE_NUM_VBOS 256
#define GL_CORE_NUM_FENCES 8
struct gl3_streamed_texture
{
GLuint tex;

View File

@ -1,4 +1,5 @@
#pragma once
#ifndef __GX2_DEFINES_H
#define __GX2_DEFINES_H
#include <wiiu/gx2.h>
@ -121,3 +122,5 @@ typedef struct
bool should_resize;
bool render_msg_enabled;
} wiiu_video_t;
#endif

View File

@ -1,5 +1,5 @@
#ifndef ORBIS_COMMON_H__
#define ORBIS_COMMON_H__
#ifndef ORBIS_DEFINES_H__
#define ORBIS_DEFINES_H__
#ifdef HAVE_EGL
#include <piglet.h>
@ -31,7 +31,6 @@ typedef struct
SceShdrCacheConfig shdr_cache_config;
#endif
#endif
SceWindow native_window;
bool resize;
unsigned width, height;

View File

@ -1,5 +1,5 @@
#ifndef PS2_COMMON_H__
#define PS2_COMMON_H__
#ifndef PS2_DEFINES_H__
#define PS2_DEFINES_H__
#include <stdint.h>
#include <stdbool.h>

View File

@ -14,8 +14,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef RSX_COMMON_H__
#define RSX_COMMON_H__
#ifndef RSX_DEFINES_H__
#define RSX_DEFINES_H__
#include <retro_inline.h>
#include <string/stdstring.h>

View File

@ -25,6 +25,12 @@
#include "../font_driver.h"
#include "../../retroarch.h"
enum sd2l_flags
{
SDL2_FLAG_QUITTING = (1 << 0),
SDL2_FLAG_SHOULD_RESIZE = (1 << 1)
};
typedef struct sdl2_tex
{
SDL_Texture *tex;
@ -36,12 +42,6 @@ typedef struct sdl2_tex
bool rgb32;
} sdl2_tex_t;
enum sd2l_flags
{
SDL2_FLAG_QUITTING = (1 << 0),
SDL2_FLAG_SHOULD_RESIZE = (1 << 1)
};
typedef struct _sdl2_video
{
double rotation;

View File

@ -15,8 +15,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __SIXEL_COMMON_H
#define __SIXEL_COMMON_H
#ifndef __SIXEL_DEFINES_H
#define __SIXEL_DEFINES_H
#include <sixel.h>

View File

@ -12,7 +12,7 @@ typedef struct
{
bool vsync;
bool rgb32;
bool smooth; // bilinear
bool smooth; /* bilinear */
unsigned width, height;
unsigned rotation;
struct video_viewport vp;
@ -62,7 +62,7 @@ typedef struct
NWindow *win;
Framebuffer fb;
// needed for the switch font driver
/* needed for the switch font driver */
uint32_t *out_buffer;
uint32_t stride;
} switch_video_t;
@ -85,6 +85,5 @@ typedef struct
} 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_cpy_dsp_buf(uint32_t *buffer, uint32_t *image, int w, int h, uint32_t stride, bool blend);
#endif

View File

@ -15,16 +15,16 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __VGA_COMMON_H
#define __VGA_COMMON_H
#ifndef __VGA_DEFINES_H
#define __VGA_DEFINES_H
#define VGA_WIDTH 320
#define VGA_HEIGHT 200
typedef struct vga
{
bool color;
bool vga_rgb32;
unsigned char *vga_menu_frame;
unsigned char *vga_frame;
unsigned vga_menu_width;
unsigned vga_menu_height;
@ -35,8 +35,8 @@ typedef struct vga
unsigned vga_video_pitch;
unsigned vga_video_bits;
unsigned char *vga_menu_frame;
unsigned char *vga_frame;
bool color;
bool vga_rgb32;
} vga_t;
#endif

View File

@ -14,8 +14,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VITA2D_COMMON_H__
#define VITA2D_COMMON_H__
#ifndef VITA2D_DEFINES_H__
#define VITA2D_DEFINES_H__
#include <vita2d.h>

View File

@ -52,6 +52,162 @@
#include "../drivers_shader/shader_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
enum vk_texture_type
@ -89,6 +245,46 @@ enum vulkan_wsi_type
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
#ifndef VKALIGN
@ -111,16 +307,6 @@ typedef struct VKALIGN(16)
} vulkan_hdr_uniform_t;
#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
{
slock_t *queue_lock;
@ -164,14 +350,6 @@ typedef struct vulkan_context
bool swapchain_fences_signalled[VULKAN_MAX_SWAPCHAIN_IMAGES];
} 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
{
sthread_t *thread;
@ -185,21 +363,6 @@ struct vulkan_emulated_mailbox
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
{
struct string_list *gpu_list;
@ -239,13 +402,6 @@ struct vk_image
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
{
VkDeviceSize memory_size; /* uint64_t alignment */
@ -497,145 +653,6 @@ typedef struct vk
uint32_t flags;
} 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,
struct vk_buffer_chain *chain, size_t size,
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);
/* 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(
VkDevice device,
VkDescriptorSet set,

View File

@ -21,14 +21,16 @@
#include "../../input/common/wayland_common.h"
typedef struct toplevel_listener {
typedef struct toplevel_listener
{
#ifdef HAVE_LIBDECOR_H
struct libdecor_frame_interface libdecor_frame_interface;
#endif
struct xdg_toplevel_listener xdg_toplevel_listener;
} toplevel_listener_t;
typedef struct shm_buffer {
typedef struct shm_buffer
{
struct wl_buffer *wl_buffer;
void *data;
size_t data_size;

View File

@ -40,7 +40,7 @@
#include "win32_common.h"
#ifdef HAVE_GDI
#include "gdi_common.h"
#include "gdi_defines.h"
#endif
#include "../../frontend/frontend_driver.h"

View File

@ -30,8 +30,7 @@
#include "../../menu/menu_driver.h"
#endif
#include "../common/caca_common.h"
#include "../common/caca_defines.h"
#include "../font_driver.h"
#include "../../driver.h"

View File

@ -50,7 +50,7 @@
#include "../../runloop.h"
#include "../../verbosity.h"
#include "../common/ctr_common.h"
#include "../common/ctr_defines.h"
#ifndef HAVE_THREADS
#include "../../tasks/tasks_internal.h"
#endif

View File

@ -40,7 +40,7 @@
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../../frontend/frontend_driver.h"
#include "../common/gdi_common.h"
#include "../common/gdi_defines.h"
#if defined(_WIN32) && !defined(_XBOX)
#include "../common/win32_common.h"

View File

@ -52,7 +52,7 @@
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../../frontend/frontend_driver.h"
#include "../common/gl1_common.h"
#include "../common/gl1_defines.h"
#if defined(_WIN32) && !defined(_XBOX)
#include "../common/win32_common.h"

View File

@ -47,7 +47,7 @@
#include "../gfx_widgets.h"
#endif
#include "gfx/common/gx2_common.h"
#include "gfx/common/gx2_defines.h"
#include "gfx/video_shader_parse.h"
#include "gfx/drivers_shader/slang_process.h"
#include "system/memory.h"

View File

@ -32,7 +32,7 @@
#include "../../verbosity.h"
#include "../gfx_display.h"
#include "../common/ps2_common.h"
#include "../common/ps2_defines.h"
/* Generic tint color */
#define GS_TEXT GS_SETREG_RGBA(0x80, 0x80, 0x80, 0x80)

View File

@ -38,7 +38,7 @@
#include "../gfx_widgets.h"
#endif
#include "../common/rsx_common.h"
#include "../common/rsx_defines.h"
#include "../font_driver.h"
#include "../../configuration.h"

View File

@ -37,7 +37,7 @@
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../../frontend/frontend_driver.h"
#include "../common/sixel_common.h"
#include "../common/sixel_defines.h"
#ifndef _WIN32
#define HAVE_SYS_IOCTL_H

View File

@ -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 *src = image;

View File

@ -30,7 +30,7 @@
#include "../../menu/menu_driver.h"
#endif
#include "../common/vga_common.h"
#include "../common/vga_defines.h"
#include "../font_driver.h"

View File

@ -34,7 +34,7 @@
#include "../font_driver.h"
#include "../common/vita2d_common.h"
#include "../common/vita2d_defines.h"
#include "../../driver.h"
#include "../video_coord_array.h"
#include "../../verbosity.h"

View File

@ -29,7 +29,7 @@
#include "../common/egl_common.h"
#endif
#include "../common/orbis_common.h"
#include "../common/orbis_defines.h"
#include "../../frontend/frontend_driver.h"
#include "../../configuration.h"
#include <defines/ps4_defines.h>

View File

@ -21,7 +21,7 @@
#include "../gfx_display.h"
#include "../common/ctr_common.h"
#include "../common/ctr_defines.h"
#include "../drivers/ctr_gu.h"
#include "../../ctr/gpu_old.h"

View File

@ -23,7 +23,7 @@
#if defined(_WIN32) && !defined(_XBOX)
#include "../common/win32_common.h"
#include "../common/gdi_common.h"
#include "../common/gdi_defines.h"
#endif
static const float *gfx_display_gdi_get_default_vertices(void)

View File

@ -21,8 +21,7 @@
#endif
#include "../gfx_display.h"
#include "../common/gl1_common.h"
#include "../common/gl1_defines.h"
static const GLfloat gl1_menu_vertexes[8] = {
0, 0,

View File

@ -21,7 +21,7 @@
#include "../gfx_display.h"
#include "../common/rsx_common.h"
#include "../common/rsx_defines.h"
static const float rsx_vertexes[8] = {
0, 0,

View File

@ -23,7 +23,7 @@
#include "../gfx_display.h"
#include "../common/vita2d_common.h"
#include "../common/vita2d_defines.h"
#include <defines/psp_defines.h>
static const float vita2d_vertexes[8] = {

View File

@ -22,7 +22,7 @@
#include "../gfx_display.h"
#include "../common/gx2_common.h"
#include "../common/gx2_defines.h"
#include "../../wiiu/system/memory.h"
#include "../../wiiu/wiiu_dbg.h"

View File

@ -122,8 +122,8 @@
/* Required for 3DS display mode setting */
#if defined(_3DS)
#include "gfx/common/ctr_common.h"
#include <3ds/services/cfgu.h>
#include "gfx/common/ctr_defines.h"
#endif
#if defined(DINGUX)