mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-09 12:13:15 +00:00
show title splash while the game is loading
This commit is contained in:
parent
55855b4195
commit
c9b5b5e963
14 changed files with 8147 additions and 12 deletions
|
@ -2,6 +2,9 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/config.h"
|
||||
#include "common/singleton.h"
|
||||
#include "core/file_format/splash.h"
|
||||
#include "core/libraries/system/systemservice.h"
|
||||
#include "sdl_window.h"
|
||||
#include "video_core/renderer_vulkan/renderer_vulkan.h"
|
||||
|
||||
|
@ -157,10 +160,38 @@ void RendererVulkan::RecreateFrame(Frame* frame, u32 width, u32 height) {
|
|||
frame->height = height;
|
||||
}
|
||||
|
||||
bool RendererVulkan::ShowSplash(Frame* frame /*= nullptr*/) {
|
||||
if (!Libraries::SystemService::IsSplashVisible()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!frame) {
|
||||
const auto* splash = Common::Singleton<Splash>::Instance();
|
||||
|
||||
VideoCore::ImageInfo info{};
|
||||
info.pixel_format = vk::Format::eR8G8B8A8Srgb;
|
||||
info.type = vk::ImageType::e2D;
|
||||
info.size =
|
||||
VideoCore::Extent3D{splash->GetImageInfo().width, splash->GetImageInfo().height, 1};
|
||||
info.pitch = splash->GetImageInfo().width * 4;
|
||||
info.guest_size_bytes = splash->GetImageData().size();
|
||||
auto& image = texture_cache.FindImage(info, VAddr(splash->GetImageData().data()));
|
||||
|
||||
frame = PrepareFrameInternal(image);
|
||||
}
|
||||
Present(frame);
|
||||
return true;
|
||||
}
|
||||
|
||||
Frame* RendererVulkan::PrepareFrame(const Libraries::VideoOut::BufferAttributeGroup& attribute,
|
||||
VAddr cpu_address) {
|
||||
// Request presentation image from the texture cache.
|
||||
auto& image = texture_cache.FindDisplayBuffer(attribute, cpu_address);
|
||||
const auto info = VideoCore::ImageInfo{attribute};
|
||||
auto& image = texture_cache.FindImage(info, cpu_address);
|
||||
return PrepareFrameInternal(image);
|
||||
}
|
||||
|
||||
Frame* RendererVulkan::PrepareFrameInternal(VideoCore::Image& image) {
|
||||
|
||||
// Request a free presentation frame.
|
||||
Frame* frame = GetRenderFrame();
|
||||
|
|
|
@ -34,10 +34,12 @@ public:
|
|||
Frame* PrepareFrame(const Libraries::VideoOut::BufferAttributeGroup& attribute,
|
||||
VAddr cpu_address);
|
||||
|
||||
bool ShowSplash(Frame* frame = nullptr);
|
||||
void Present(Frame* frame);
|
||||
void RecreateFrame(Frame* frame, u32 width, u32 height);
|
||||
|
||||
private:
|
||||
Frame* PrepareFrameInternal(VideoCore::Image& image);
|
||||
Frame* GetRenderFrame();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue