mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
core: Library cleanup (#1631)
* core: Split error codes into separate files * Reduces build times and is cleaner * core: Bring structs and enums to codebase style * core: More style changes
This commit is contained in:
@@ -95,7 +95,7 @@ Instance::Instance(bool enable_validation, bool enable_crash_diagnostic)
|
||||
|
||||
Instance::Instance(Frontend::WindowSDL& window, s32 physical_device_index,
|
||||
bool enable_validation /*= false*/, bool enable_crash_diagnostic /*= false*/)
|
||||
: instance{CreateInstance(window.getWindowInfo().type, enable_validation,
|
||||
: instance{CreateInstance(window.GetWindowInfo().type, enable_validation,
|
||||
enable_crash_diagnostic)},
|
||||
physical_devices{EnumeratePhysicalDevices(instance)} {
|
||||
if (enable_validation) {
|
||||
|
||||
@@ -73,7 +73,7 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL DebugUtilsCallback(
|
||||
}
|
||||
|
||||
vk::SurfaceKHR CreateSurface(vk::Instance instance, const Frontend::WindowSDL& emu_window) {
|
||||
const auto& window_info = emu_window.getWindowInfo();
|
||||
const auto& window_info = emu_window.GetWindowInfo();
|
||||
vk::SurfaceKHR surface{};
|
||||
|
||||
#if defined(VK_USE_PLATFORM_WIN32_KHR)
|
||||
|
||||
@@ -629,9 +629,9 @@ Frame* Presenter::PrepareFrameInternal(VideoCore::ImageId image_id, bool is_eop)
|
||||
|
||||
void Presenter::Present(Frame* frame) {
|
||||
// Recreate the swapchain if the window was resized.
|
||||
if (window.getWidth() != swapchain.GetExtent().width ||
|
||||
window.getHeight() != swapchain.GetExtent().height) {
|
||||
swapchain.Recreate(window.getWidth(), window.getHeight());
|
||||
if (window.GetWidth() != swapchain.GetExtent().width ||
|
||||
window.GetHeight() != swapchain.GetExtent().height) {
|
||||
swapchain.Recreate(window.GetWidth(), window.GetHeight());
|
||||
}
|
||||
|
||||
ImGui::Core::NewFrame();
|
||||
@@ -776,8 +776,8 @@ Frame* Presenter::GetRenderFrame() {
|
||||
device.resetFences(frame->present_done);
|
||||
|
||||
// If the window dimensions changed, recreate this frame
|
||||
if (frame->width != window.getWidth() || frame->height != window.getHeight()) {
|
||||
RecreateFrame(frame, window.getWidth(), window.getHeight());
|
||||
if (frame->width != window.GetWidth() || frame->height != window.GetHeight()) {
|
||||
RecreateFrame(frame, window.GetWidth(), window.GetHeight());
|
||||
}
|
||||
|
||||
return frame;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Vulkan {
|
||||
Swapchain::Swapchain(const Instance& instance_, const Frontend::WindowSDL& window)
|
||||
: instance{instance_}, surface{CreateSurface(instance.GetInstance(), window)} {
|
||||
FindPresentFormat();
|
||||
Create(window.getWidth(), window.getHeight(), surface);
|
||||
Create(window.GetWidth(), window.GetHeight(), surface);
|
||||
}
|
||||
|
||||
Swapchain::~Swapchain() {
|
||||
|
||||
Reference in New Issue
Block a user