Clang-Format run over changed files

This commit is contained in:
matthieu.ranger
2020-06-25 17:58:48 -04:00
parent a4fcd02ee7
commit ad7e5c84d4
2 changed files with 16 additions and 13 deletions

View File

@@ -42,10 +42,10 @@
#ifdef __APPLE__ #ifdef __APPLE__
#define VK_USE_PLATFORM_METAL_EXT #define VK_USE_PLATFORM_METAL_EXT
#include "vulkan/vulkan_macos.h"
#include "vulkan/vulkan_metal.h"
#include <objc/message.h> #include <objc/message.h>
#include "common/file_util.h" #include "common/file_util.h"
#include "vulkan/vulkan_macos.h"
#include "vulkan/vulkan_metal.h"
#endif #endif
#if !defined(_WIN32) && !defined(__APPLE__) #if !defined(_WIN32) && !defined(__APPLE__)
@@ -54,7 +54,6 @@
#include <vulkan/vulkan_xlib.h> #include <vulkan/vulkan_xlib.h>
#endif #endif
namespace Vulkan { namespace Vulkan {
namespace { namespace {
@@ -280,7 +279,8 @@ bool RendererVulkan::TryPresent(int /*timeout_ms*/) {
void PrepareWindow(Core::Frontend::EmuWindow::WindowSystemInfo& wsi) { void PrepareWindow(Core::Frontend::EmuWindow::WindowSystemInfo& wsi) {
#if defined(VK_USE_PLATFORM_METAL_EXT) #if defined(VK_USE_PLATFORM_METAL_EXT)
// This is kinda messy, but it avoids having to write Objective C++ just to create a metal layer. // This is kinda messy, but it avoids having to write Objective C++ just to create a metal
// layer.
id view = reinterpret_cast<id>(wsi.render_surface); id view = reinterpret_cast<id>(wsi.render_surface);
Class clsCAMetalLayer = objc_getClass("CAMetalLayer"); Class clsCAMetalLayer = objc_getClass("CAMetalLayer");
if (!clsCAMetalLayer) { if (!clsCAMetalLayer) {
@@ -290,25 +290,27 @@ void PrepareWindow(Core::Frontend::EmuWindow::WindowSystemInfo& wsi) {
// [CAMetalLayer layer] // [CAMetalLayer layer]
id layer = reinterpret_cast<id (*)(Class, SEL)>(objc_msgSend)(objc_getClass("CAMetalLayer"), id layer = reinterpret_cast<id (*)(Class, SEL)>(objc_msgSend)(objc_getClass("CAMetalLayer"),
sel_getUid("layer")); sel_getUid("layer"));
if (!layer) { if (!layer) {
LOG_ERROR(Render_Vulkan, "Failed to create Metal layer."); LOG_ERROR(Render_Vulkan, "Failed to create Metal layer.");
return; return;
} }
// [view setWantsLayer:YES] // [view setWantsLayer:YES]
reinterpret_cast<void (*)(id, SEL, BOOL)>(objc_msgSend)(view, sel_getUid("setWantsLayer:"), YES); reinterpret_cast<void (*)(id, SEL, BOOL)>(objc_msgSend)(view, sel_getUid("setWantsLayer:"),
YES);
// [view setLayer:layer] // [view setLayer:layer]
reinterpret_cast<void (*)(id, SEL, id)>(objc_msgSend)(view, sel_getUid("setLayer:"), layer); reinterpret_cast<void (*)(id, SEL, id)>(objc_msgSend)(view, sel_getUid("setLayer:"), layer);
// NSScreen* screen = [NSScreen mainScreen] // NSScreen* screen = [NSScreen mainScreen]
id screen = reinterpret_cast<id (*)(Class, SEL)>(objc_msgSend)(objc_getClass("NSScreen"), id screen = reinterpret_cast<id (*)(Class, SEL)>(objc_msgSend)(objc_getClass("NSScreen"),
sel_getUid("mainScreen")); sel_getUid("mainScreen"));
// CGFloat factor = [screen backingScaleFactor] // CGFloat factor = [screen backingScaleFactor]
double factor = double factor = reinterpret_cast<double (*)(id, SEL)>(objc_msgSend)(
reinterpret_cast<double (*)(id, SEL)>(objc_msgSend)(screen, sel_getUid("backingScaleFactor")); screen, sel_getUid("backingScaleFactor"));
// layer.contentsScale = factor // layer.contentsScale = factor
reinterpret_cast<void (*)(id, SEL, double)>(objc_msgSend)(layer, sel_getUid("setContentsScale:"), reinterpret_cast<void (*)(id, SEL, double)>(objc_msgSend)(
factor); layer, sel_getUid("setContentsScale:"), factor);
// Store the layer pointer, that way MoltenVK doesn't call [NSView layer] outside the main thread. // Store the layer pointer, that way MoltenVK doesn't call [NSView layer] outside the main
// thread.
wsi.render_surface = layer; wsi.render_surface = layer;
#endif #endif
} }

View File

@@ -46,7 +46,8 @@ std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Cor
return std::make_unique<VideoCommon::GPUAsynch>(system, std::move(renderer), return std::make_unique<VideoCommon::GPUAsynch>(system, std::move(renderer),
std::move(context)); std::move(context));
} }
auto res = std::make_unique<VideoCommon::GPUSynch>(system, std::move(renderer), std::move(context)); auto res =
std::make_unique<VideoCommon::GPUSynch>(system, std::move(renderer), std::move(context));
return res; return res;
} }