review comments

This commit is contained in:
psucien 2024-05-15 20:54:45 +02:00 committed by georgemoralis
parent 3d5be23671
commit 8c4f72f404
4 changed files with 19 additions and 16 deletions

View File

@ -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);
}

View File

@ -166,6 +166,7 @@ bool RendererVulkan::ShowSplash(Frame* frame /*= nullptr*/) {
}
if (!frame) {
if (!splash_img.has_value()) {
const auto* splash = Common::Singleton<Splash>::Instance();
VideoCore::ImageInfo info{};
@ -175,9 +176,10 @@ bool RendererVulkan::ShowSplash(Frame* frame /*= nullptr*/) {
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);
splash_img.emplace(instance, scheduler, info, VAddr(splash->GetImageData().data()));
texture_cache.RefreshImage(*splash_img);
}
frame = PrepareFrameInternal(*splash_img);
}
Present(frame);
return true;

View File

@ -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

View File

@ -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);