mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-06-02 06:08:44 +02:00
8ceed74371
The GPU class has been extended in this for Vulkan initialization, this is done to the point of initializing the instance alongside loading in `VK_LAYER_KHRONOS_validation` which is also now packed into all Debug APKs for Skyline. In addition, `VK_EXT_debug_report` is also initialized and it's output is piped directly into the Logger. A minor change regarding the type of the `Fps` and `Frametime` globals was changed to `skyline::i32`s which is a more suitable type due to those having a smaller chance of overflowing while being signed as Java doesn't have unsigned integral types.
31 lines
1.1 KiB
C++
31 lines
1.1 KiB
C++
// SPDX-License-Identifier: MPL-2.0
|
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
|
|
|
#pragma once
|
|
|
|
#include "gpu/presentation_engine.h"
|
|
|
|
namespace skyline::gpu {
|
|
/**
|
|
* @brief An interface to host GPU structures, anything concerning host GPU/Presentation APIs is encapsulated by this
|
|
*/
|
|
class GPU {
|
|
private:
|
|
vk::raii::Context context;
|
|
vk::raii::Instance instance;
|
|
vk::raii::DebugReportCallbackEXT debugReportCallback;
|
|
vk::Device device;
|
|
|
|
static vk::raii::Instance CreateInstance(const DeviceState &state, const vk::raii::Context &context);
|
|
|
|
static vk::raii::DebugReportCallbackEXT CreateDebugReportCallback(const DeviceState &state, const vk::raii::Instance &instance);
|
|
|
|
static VKAPI_ATTR VkBool32 VKAPI_CALL DebugCallback(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char *layerPrefix, const char *message, Logger *logger);
|
|
|
|
public:
|
|
PresentationEngine presentation;
|
|
|
|
GPU(const DeviceState &state);
|
|
};
|
|
}
|