mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-29 23:41:19 -06:00
* Implement screenshot functionality with overlays and game-only options
* CLang 🤦
* video: F12 game screenshot, Alt+F12 HUD screenshot
- Capture game-only screenshots from the VideoOut image before FSR/PP scaling (native guest output res)
- Capture overlay screenshots from the swapchain/output image; HDR screenshots are tone-mapped to SDR PNG
- Split screenshot request counters + consumption for game-only vs with-overlays
- Add A2R10G10B10 readback handling and force opaque alpha in PNG output
- Update default hotkeys (keep backward-compat with hotkey_renderdoc_capture)
- Ignore tmp/artifacts/
* Add legacy capture binding support in input configuration
---------
Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <filesystem>
|
|
#include <string>
|
|
#include "common/types.h"
|
|
|
|
namespace VideoCore {
|
|
|
|
/// Loads renderdoc dynamic library module.
|
|
void LoadRenderDoc();
|
|
|
|
/// Begins a capture if a renderdoc instance is attached.
|
|
void StartCapture();
|
|
|
|
/// Ends current renderdoc capture.
|
|
void EndCapture();
|
|
|
|
/// Triggers capturing process.
|
|
void TriggerCapture();
|
|
|
|
/// Sets output directory for captures
|
|
void SetOutputDir(const std::filesystem::path& path, const std::string& prefix);
|
|
|
|
/// Returns true when RenderDoc API was loaded and is usable.
|
|
bool IsRenderDocLoaded();
|
|
|
|
enum class ScreenshotRequest : u32 {
|
|
None = 0,
|
|
GameOnly = 1,
|
|
WithOverlays = 2,
|
|
};
|
|
|
|
struct ScreenshotRequests {
|
|
u32 game_only_count{};
|
|
u32 with_overlays_count{};
|
|
};
|
|
|
|
/// Queues an in-emulator screenshot request to be consumed by the presenter.
|
|
void RequestScreenshot(ScreenshotRequest request);
|
|
|
|
/// Atomically consumes and returns pending "game only" screenshot request counter.
|
|
u32 ConsumeGameOnlyScreenshotRequests();
|
|
|
|
/// Atomically consumes and returns pending "with overlays" screenshot request counter.
|
|
u32 ConsumeWithOverlaysScreenshotRequests();
|
|
|
|
/// Atomically consumes and returns pending screenshot request counters.
|
|
ScreenshotRequests ConsumeScreenshotRequests();
|
|
|
|
} // namespace VideoCore
|