mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-25 12:55:00 +00:00
Dear ImGui Implementation (#598)
* added imgui as dependency * imgui renderer/basic input implementation * imgui: add layers system Add video info layer to show fps. Press F10 to toggle it. * imgui: add custom imgui config * imgui: gamepad capture, stopping propagation * imgui: changed config & log file path to use portable dir * videoout: render blank frame when video output is closed required to render imgui even when game has no video output - fixed merge compile-error
This commit is contained in:
parent
f1becb2507
commit
035cb3eeaa
23 changed files with 2386 additions and 8 deletions
43
src/imgui/renderer/imgui_impl_vulkan.h
Normal file
43
src/imgui/renderer/imgui_impl_vulkan.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
// Based on imgui_impl_vulkan.h from Dear ImGui repository
|
||||
|
||||
#pragma once
|
||||
|
||||
#define VULKAN_HPP_NO_EXCEPTIONS
|
||||
#include "video_core/renderer_vulkan/vk_common.h"
|
||||
|
||||
struct ImDrawData;
|
||||
|
||||
namespace ImGui::Vulkan {
|
||||
|
||||
struct InitInfo {
|
||||
vk::Instance instance;
|
||||
vk::PhysicalDevice physical_device;
|
||||
vk::Device device;
|
||||
uint32_t queue_family;
|
||||
vk::Queue queue;
|
||||
uint32_t image_count; // >= 2
|
||||
vk::DeviceSize min_allocation_size; // Minimum allocation size
|
||||
vk::PipelineCache pipeline_cache;
|
||||
uint32_t subpass;
|
||||
vk::PipelineRenderingCreateInfoKHR pipeline_rendering_create_info;
|
||||
|
||||
// (Optional) Allocation, Logging
|
||||
const vk::AllocationCallbacks* allocator{};
|
||||
void (*check_vk_result_fn)(vk::Result err);
|
||||
};
|
||||
|
||||
vk::DescriptorSet AddTexture(vk::Sampler sampler, vk::ImageView image_view,
|
||||
vk::ImageLayout image_layout);
|
||||
|
||||
void RemoveTexture(vk::DescriptorSet descriptor_set);
|
||||
|
||||
bool Init(InitInfo info);
|
||||
void Shutdown();
|
||||
void NewFrame();
|
||||
void RenderDrawData(ImDrawData& draw_data, vk::CommandBuffer command_buffer,
|
||||
vk::Pipeline pipeline = VK_NULL_HANDLE);
|
||||
|
||||
} // namespace ImGui::Vulkan
|
Loading…
Add table
Add a link
Reference in a new issue