mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 13:20:30 +00:00
Cleanups
This commit is contained in:
parent
189542ea5f
commit
36cf7f00a8
@ -67,7 +67,7 @@
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
#define SD_PREFIX
|
||||
#include "../../gfx/common/switch_common.h"
|
||||
#include "../../gfx/common/switch_defines.h"
|
||||
#else
|
||||
#define SD_PREFIX "/sd"
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef SWITCH_COMMON_H__
|
||||
#define SWITCH_COMMON_H__
|
||||
#ifndef SWITCH_DEFINES_H__
|
||||
#define SWITCH_DEFINES_H__
|
||||
|
||||
#include <switch.h>
|
||||
#include <gfx/scaler/scaler.h>
|
||||
@ -84,6 +84,4 @@ typedef struct
|
||||
NWindow *win;
|
||||
} 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);
|
||||
|
||||
#endif
|
@ -2272,35 +2272,6 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
|
||||
return true;
|
||||
}
|
||||
|
||||
void vulkan_set_uniform_buffer(
|
||||
VkDevice device,
|
||||
VkDescriptorSet set,
|
||||
unsigned binding,
|
||||
VkBuffer buffer,
|
||||
VkDeviceSize offset,
|
||||
VkDeviceSize range)
|
||||
{
|
||||
VkWriteDescriptorSet write;
|
||||
VkDescriptorBufferInfo buffer_info;
|
||||
|
||||
buffer_info.buffer = buffer;
|
||||
buffer_info.offset = offset;
|
||||
buffer_info.range = range;
|
||||
|
||||
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_UNIFORM_BUFFER;
|
||||
write.pImageInfo = NULL;
|
||||
write.pBufferInfo = &buffer_info;
|
||||
write.pTexelBufferView = NULL;
|
||||
|
||||
vkUpdateDescriptorSets(device, 1, &write, 0, NULL);
|
||||
}
|
||||
|
||||
bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
|
||||
enum vulkan_wsi_type type)
|
||||
{
|
||||
|
@ -135,6 +135,26 @@
|
||||
vkUpdateDescriptorSets(device, 1, &write, 0, NULL); \
|
||||
}
|
||||
|
||||
#define VULKAN_SET_UNIFORM_BUFFER(_device, _set, _binding, _buffer, _offset, _range) \
|
||||
{ \
|
||||
VkWriteDescriptorSet write; \
|
||||
VkDescriptorBufferInfo buffer_info; \
|
||||
buffer_info.buffer = _buffer; \
|
||||
buffer_info.offset = _offset; \
|
||||
buffer_info.range = _range; \
|
||||
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_UNIFORM_BUFFER; \
|
||||
write.pImageInfo = NULL; \
|
||||
write.pBufferInfo = &buffer_info; \
|
||||
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; \
|
||||
@ -705,14 +725,6 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
|
||||
unsigned width, unsigned height,
|
||||
unsigned swap_interval);
|
||||
|
||||
void vulkan_set_uniform_buffer(
|
||||
VkDevice device,
|
||||
VkDescriptorSet set,
|
||||
unsigned binding,
|
||||
VkBuffer buffer,
|
||||
VkDeviceSize offset,
|
||||
VkDeviceSize range);
|
||||
|
||||
void vulkan_debug_mark_image(VkDevice device, VkImage image);
|
||||
void vulkan_debug_mark_memory(VkDevice device, VkDeviceMemory memory);
|
||||
|
||||
|
@ -199,7 +199,6 @@ d3d11_get_closest_match(D3D11Device device, DXGI_FORMAT desired_format, UINT des
|
||||
return *format;
|
||||
}
|
||||
|
||||
|
||||
static void d3d11_init_texture(D3D11Device device, d3d11_texture_t* texture)
|
||||
{
|
||||
bool is_render_target = texture->desc.BindFlags & D3D11_BIND_RENDER_TARGET;
|
||||
@ -719,10 +718,10 @@ static void d3d11_font_render_line(
|
||||
int i;
|
||||
unsigned count;
|
||||
D3D11_MAPPED_SUBRESOURCE mapped_vbo;
|
||||
d3d11_sprite_t *v = NULL;
|
||||
d3d11_sprite_t *v = NULL;
|
||||
const struct font_glyph* glyph_q = NULL;
|
||||
int x = roundf(pos_x * width);
|
||||
int y = roundf((1.0 - pos_y) * height);
|
||||
int x = roundf(pos_x * width);
|
||||
int y = roundf((1.0 - pos_y) * height);
|
||||
|
||||
if (d3d11->sprites.offset + msg_len > (unsigned)d3d11->sprites.capacity)
|
||||
d3d11->sprites.offset = 0;
|
||||
@ -828,9 +827,9 @@ static void d3d11_font_render_message(
|
||||
unsigned height,
|
||||
unsigned text_align)
|
||||
{
|
||||
float line_height;
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
int lines = 0;
|
||||
float line_height;
|
||||
|
||||
if (!msg || !*msg)
|
||||
return;
|
||||
|
@ -89,7 +89,7 @@ static INLINE D3D12_GPU_VIRTUAL_ADDRESS D3D12GetGPUVirtualAddress(void* resource
|
||||
return ((ID3D12Resource*)resource)->lpVtbl->GetGPUVirtualAddress((ID3D12Resource*)resource);
|
||||
}
|
||||
|
||||
D3D12_GPU_VIRTUAL_ADDRESS
|
||||
static D3D12_GPU_VIRTUAL_ADDRESS
|
||||
d3d12_create_buffer(D3D12Device device, UINT size_in_bytes, D3D12Resource* buffer)
|
||||
{
|
||||
D3D12_HEAP_PROPERTIES heap_props = { D3D12_HEAP_TYPE_UPLOAD, D3D12_CPU_PAGE_PROPERTY_UNKNOWN,
|
||||
|
@ -49,7 +49,7 @@
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
#include "../common/switch_common.h"
|
||||
#include "../common/switch_defines.h"
|
||||
|
||||
#ifndef HAVE_THREADS
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
@ -379,6 +379,7 @@ font_renderer_t switch_font =
|
||||
* VIDEO DRIVER
|
||||
*/
|
||||
|
||||
#if 0
|
||||
/* (C) libtransistor */
|
||||
static int pdep(uint32_t mask, uint32_t value)
|
||||
{
|
||||
@ -400,7 +401,7 @@ static int pdep(uint32_t mask, uint32_t value)
|
||||
static uint32_t swizzle_x(uint32_t v) { return pdep(~0x7B4u, v); }
|
||||
static uint32_t swizzle_y(uint32_t v) { return pdep(0x7B4, v); }
|
||||
|
||||
void gfx_slow_swizzling_blit(uint32_t *buffer, uint32_t *image, int w, int h, int tx, int ty, bool blend)
|
||||
static void gfx_slow_swizzling_blit(uint32_t *buffer, uint32_t *image, int w, int h, int tx, int ty, bool blend)
|
||||
{
|
||||
uint32_t *dest = buffer;
|
||||
uint32_t *src = image;
|
||||
@ -451,6 +452,7 @@ void gfx_slow_swizzling_blit(uint32_t *buffer, uint32_t *image, int w, int h, in
|
||||
offs_x0 += incr_y; /* wrap into next tile row */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void gfx_cpy_dsp_buf(uint32_t *buffer, uint32_t *image, int w, int h, uint32_t stride, bool blend)
|
||||
{
|
||||
|
@ -851,7 +851,7 @@ static void vulkan_copy_staging_to_dynamic(vk_t *vk, VkCommandBuffer cmd,
|
||||
return;
|
||||
|
||||
memcpy(range.data, ubo, sizeof(ubo));
|
||||
vulkan_set_uniform_buffer(vk->context->device,
|
||||
VULKAN_SET_UNIFORM_BUFFER(vk->context->device,
|
||||
set,
|
||||
0,
|
||||
range.buffer,
|
||||
@ -4408,7 +4408,7 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
vk->context->device,
|
||||
&vk->chain->descriptor_manager);
|
||||
|
||||
vulkan_set_uniform_buffer(vk->context->device,
|
||||
VULKAN_SET_UNIFORM_BUFFER(vk->context->device,
|
||||
set,
|
||||
0,
|
||||
vk->hdr.ubo.buffer,
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include <switch.h>
|
||||
|
||||
#include "../common/switch_common.h"
|
||||
#include "../common/switch_defines.h"
|
||||
#include "../../frontend/frontend_driver.h"
|
||||
|
||||
/* TODO/FIXME - global referenced */
|
||||
|
@ -2565,12 +2565,14 @@ void Pass::build_commands(
|
||||
build_semantics(sets[sync_index], u, mvp, original, source);
|
||||
|
||||
if (reflection.ubo_stage_mask)
|
||||
vulkan_set_uniform_buffer(device,
|
||||
{
|
||||
VULKAN_SET_UNIFORM_BUFFER(device,
|
||||
sets[sync_index],
|
||||
reflection.ubo_binding,
|
||||
common->ubo->get_buffer(),
|
||||
ubo_offset + sync_index * common->ubo_sync_index_stride,
|
||||
reflection.ubo_size);
|
||||
}
|
||||
|
||||
/* The final pass is always executed inside
|
||||
* another render pass since the frontend will
|
||||
|
Loading…
x
Reference in New Issue
Block a user