clang format fixes

This commit is contained in:
matthieu.ranger
2020-04-17 10:32:08 -04:00
parent 30ccec00b8
commit 0d1da72d03
5 changed files with 33 additions and 29 deletions

View File

@@ -86,7 +86,8 @@ Common::DynamicLibrary OpenVulkanLibrary() {
char* libvulkan_env = getenv("LIBVULKAN_PATH");
if (!libvulkan_env || !library.Open(libvulkan_env)) {
// Use the libvulkan.dylib from the application bundle.
std::string filename = FileUtil::GetBundleDirectory() + "/Contents/Frameworks/libvulkan.dylib";
std::string filename =
FileUtil::GetBundleDirectory() + "/Contents/Frameworks/libvulkan.dylib";
library.Open(filename.c_str());
}
#else
@@ -176,7 +177,8 @@ vk::Instance CreateInstance(Common::DynamicLibrary& library, vk::InstanceDispatc
// application_info.engineVersion = VK_MAKE_VERSION(0, 1, 0);
// // Try for Vulkan 1.1 if the loader supports it.
// if (dld.vkEnumerateInstanceVersion && vk::enumerateInstanceVersion(dld) >= VK_MAKE_VERSION(1, 1, 0)) {
// if (dld.vkEnumerateInstanceVersion && vk::enumerateInstanceVersion(dld) >= VK_MAKE_VERSION(1,
// 1, 0)) {
// application_info.apiVersion = VK_MAKE_VERSION(1, 1, 0);
// } else {
// LOG_ERROR(Render_Vulkan, "Vulkan 1.1 is not susupported! Try updating your drivers");
@@ -184,10 +186,11 @@ vk::Instance CreateInstance(Common::DynamicLibrary& library, vk::InstanceDispatc
// }
// const std::array layers = {"VK_LAYER_LUNARG_standard_validation"};
// const vk::InstanceCreateInfo instance_ci(
// {}, &application_info, enable_layers ? static_cast<u32>(layers.size()) : 0, layers.data(),
// static_cast<u32>(extensions.size()), extensions.data());
// {}, &application_info, enable_layers ? static_cast<u32>(layers.size()) : 0,
// layers.data(), static_cast<u32>(extensions.size()), extensions.data());
// vk::Instance unsafe_instance;
// if (vk::createInstance(&instance_ci, nullptr, &unsafe_instance, dld) != vk::Result::eSuccess) {
// if (vk::createInstance(&instance_ci, nullptr, &unsafe_instance, dld) != vk::Result::eSuccess)
// {
// static constexpr std::array layers_data{"VK_LAYER_LUNARG_standard_validation"};
static constexpr std::array layers_data{"VK_LAYER_KHRONOS_validation"};
@@ -252,7 +255,8 @@ std::string BuildCommaSeparatedExtensions(std::vector<std::string> available_ext
void PrepareWindow(Core::Frontend::EmuWindow::WindowSystemInfo& wsi) {
#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);
Class clsCAMetalLayer = objc_getClass("CAMetalLayer");
if (!clsCAMetalLayer) {
@@ -269,7 +273,8 @@ void PrepareWindow(Core::Frontend::EmuWindow::WindowSystemInfo& wsi) {
}
// [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]
reinterpret_cast<void (*)(id, SEL, id)>(objc_msgSend)(view, sel_getUid("setLayer:"), layer);
@@ -279,14 +284,15 @@ void PrepareWindow(Core::Frontend::EmuWindow::WindowSystemInfo& wsi) {
sel_getUid("mainScreen"));
// CGFloat factor = [screen backingScaleFactor]
double factor =
reinterpret_cast<double (*)(id, SEL)>(objc_msgSend)(screen, sel_getUid("backingScaleFactor"));
double factor = reinterpret_cast<double (*)(id, SEL)>(objc_msgSend)(
screen, sel_getUid("backingScaleFactor"));
// layer.contentsScale = factor
reinterpret_cast<void (*)(id, SEL, double)>(objc_msgSend)(layer, sel_getUid("setContentsScale:"),
factor);
reinterpret_cast<void (*)(id, SEL, double)>(objc_msgSend)(
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;
#endif
}

View File

@@ -278,7 +278,6 @@ public:
InputCommon::GetMotionEmu()->Tilt(pos.x(), pos.y());
}
void SetFillBackground(bool fill) {
setAutoFillBackground(fill);
setAttribute(Qt::WA_OpaquePaintEvent, !fill);
@@ -290,7 +289,6 @@ private:
GRenderWindow* render_window;
};
#ifndef __APPLE__
class OpenGLRenderWidget : public RenderWidget {
public: