mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2024-12-28 18:46:06 +00:00
review comments
This commit is contained in:
parent
3d5be23671
commit
8c4f72f404
|
@ -176,8 +176,8 @@ void VideoOutDriver::Flip(std::chrono::microseconds timeout) {
|
|||
requests.pop();
|
||||
}
|
||||
|
||||
if (!renderer->ShowSplash(
|
||||
req.frame)) { // Whatever the game is rendering show splash if it is active
|
||||
// Whatever the game is rendering show splash if it is active
|
||||
if (!renderer->ShowSplash(req.frame)) {
|
||||
// Present the frame.
|
||||
renderer->Present(req.frame);
|
||||
}
|
||||
|
|
|
@ -166,18 +166,20 @@ bool RendererVulkan::ShowSplash(Frame* frame /*= nullptr*/) {
|
|||
}
|
||||
|
||||
if (!frame) {
|
||||
const auto* splash = Common::Singleton<Splash>::Instance();
|
||||
if (!splash_img.has_value()) {
|
||||
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);
|
||||
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();
|
||||
splash_img.emplace(instance, scheduler, info, VAddr(splash->GetImageData().data()));
|
||||
texture_cache.RefreshImage(*splash_img);
|
||||
}
|
||||
frame = PrepareFrameInternal(*splash_img);
|
||||
}
|
||||
Present(frame);
|
||||
return true;
|
||||
|
|
|
@ -54,6 +54,7 @@ private:
|
|||
std::mutex free_mutex;
|
||||
std::condition_variable free_cv;
|
||||
std::condition_variable_any frame_cv;
|
||||
std::optional<VideoCore::Image> splash_img;
|
||||
};
|
||||
|
||||
} // namespace Vulkan
|
||||
|
|
|
@ -35,6 +35,9 @@ public:
|
|||
/// Retrieves the image handle of the image with the provided attributes and address.
|
||||
Image& FindImage(const ImageInfo& info, VAddr cpu_address);
|
||||
|
||||
/// Reuploads image contents.
|
||||
void RefreshImage(Image& image);
|
||||
|
||||
private:
|
||||
/// Iterate over all page indices in a range
|
||||
template <typename Func>
|
||||
|
@ -93,9 +96,6 @@ private:
|
|||
/// Create an image from the given parameters
|
||||
[[nodiscard]] ImageId InsertImage(const ImageInfo& info, VAddr cpu_addr);
|
||||
|
||||
/// Reuploads image contents.
|
||||
void RefreshImage(Image& image);
|
||||
|
||||
/// Register image in the page table
|
||||
void RegisterImage(ImageId image);
|
||||
|
||||
|
|
Loading…
Reference in a new issue