citra_qt: Improve graphics API intergration

* Add renderer debug option which toggles debug output in OpenGL/validation layers in Vulkan

* Fix many warnings and replace deprecated Qt functionailty with newer alternatives
This commit is contained in:
GPUCode
2022-10-02 18:54:00 +03:00
parent 62e88fbeb3
commit eea914ba84
16 changed files with 56 additions and 40 deletions

View File

@@ -183,8 +183,9 @@ static std::array<float, 3 * 2> MakeOrthographicMatrix(float width, float height
}
RendererVulkan::RendererVulkan(Frontend::EmuWindow& window)
: RendererBase{window}, instance{window}, scheduler{instance, *this}, renderpass_cache{instance, scheduler},
runtime{instance, scheduler, renderpass_cache}, swapchain{instance, renderpass_cache},
: RendererBase{window}, instance{window, Settings::values.renderer_debug}, scheduler{instance, *this},
renderpass_cache{instance, scheduler}, runtime{instance, scheduler, renderpass_cache},
swapchain{instance, renderpass_cache},
vertex_buffer{instance, scheduler, VERTEX_BUFFER_SIZE, vk::BufferUsageFlagBits::eVertexBuffer, {}} {
auto& telemetry_session = Core::System::GetInstance().TelemetrySession();

View File

@@ -38,7 +38,7 @@ vk::Format ToVkFormat(VideoCore::PixelFormat format) {
}
}
Instance::Instance(Frontend::EmuWindow& window) {
Instance::Instance(Frontend::EmuWindow& window, bool enable_validation) {
auto window_info = window.GetWindowInfo();
// Fetch instance independant function pointers
@@ -64,9 +64,10 @@ Instance::Instance(Frontend::EmuWindow& window) {
};
const std::array layers = {"VK_LAYER_KHRONOS_validation"};
const u32 layer_count = enable_validation ? 1u : 0u;
const vk::InstanceCreateInfo instance_info = {
.pApplicationInfo = &application_info,
.enabledLayerCount = static_cast<u32>(layers.size()),
.enabledLayerCount = layer_count,
.ppEnabledLayerNames = layers.data(),
.enabledExtensionCount = static_cast<u32>(extensions.size()),
.ppEnabledExtensionNames = extensions.data()

View File

@@ -27,7 +27,7 @@ struct FormatTraits {
/// The global Vulkan instance
class Instance {
public:
Instance(Frontend::EmuWindow& window);
Instance(Frontend::EmuWindow& window, bool enable_validation);
~Instance();
/// Returns the FormatTraits struct for the provided pixel format