mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
Only use mailbox emulation on AMD.
This commit is contained in:
parent
66c4f8fd35
commit
157d1e7e63
@ -38,6 +38,10 @@
|
|||||||
#include "../../libretro-common/include/retro_math.h"
|
#include "../../libretro-common/include/retro_math.h"
|
||||||
#include "../../libretro-common/include/string/stdstring.h"
|
#include "../../libretro-common/include/string/stdstring.h"
|
||||||
|
|
||||||
|
#define VENDOR_ID_AMD 0x1002
|
||||||
|
#define VENDOR_ID_NV 0x10DE
|
||||||
|
#define VENDOR_ID_INTEL 0x8086
|
||||||
|
|
||||||
// Windows is not particularly good at recreating swapchains.
|
// Windows is not particularly good at recreating swapchains.
|
||||||
// Emulate vsync toggling by using vkAcquireNextImageKHR timeouts.
|
// Emulate vsync toggling by using vkAcquireNextImageKHR timeouts.
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
@ -1500,10 +1504,6 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
|
|||||||
"VK_KHR_sampler_mirror_clamp_to_edge",
|
"VK_KHR_sampler_mirror_clamp_to_edge",
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef VULKAN_EMULATE_MAILBOX
|
|
||||||
vk->emulate_mailbox = true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef VULKAN_DEBUG
|
#ifdef VULKAN_DEBUG
|
||||||
static const char *device_layers[] = { "VK_LAYER_LUNARG_standard_validation" };
|
static const char *device_layers[] = { "VK_LAYER_LUNARG_standard_validation" };
|
||||||
#endif
|
#endif
|
||||||
@ -1578,6 +1578,13 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
|
|||||||
vkGetPhysicalDeviceMemoryProperties(vk->context.gpu,
|
vkGetPhysicalDeviceMemoryProperties(vk->context.gpu,
|
||||||
&vk->context.memory_properties);
|
&vk->context.memory_properties);
|
||||||
|
|
||||||
|
#ifdef VULKAN_EMULATE_MAILBOX
|
||||||
|
// AMD can emulate Mailbox on Windows, but not NV.
|
||||||
|
// Not tested on Intel.
|
||||||
|
if (vk->context.gpu_properties.vendorID == VENDOR_ID_AMD)
|
||||||
|
vk->emulate_mailbox = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
RARCH_LOG("[Vulkan]: Using GPU: %s\n", vk->context.gpu_properties.deviceName);
|
RARCH_LOG("[Vulkan]: Using GPU: %s\n", vk->context.gpu_properties.deviceName);
|
||||||
|
|
||||||
if (vk->context.device == VK_NULL_HANDLE)
|
if (vk->context.device == VK_NULL_HANDLE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user