mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-23 18:49:37 -10:00
Connect the admitted desktop Vulkan encode queue to viewport recording through an asynchronous worker. Capture GPU pixels in the renderer submission, publish only successful submissions, and retain source/device resources through stop, resize and deferred video reinitialization. Refuse unsupported devices, HDR, formats and audio layouts before creating output. Start after the first core frame so admission uses its actual audio layout. Hold PCM on the existing worker queue until encoded video establishes its clock limit. Trim trailing queued PCM at video EOS before AC-3 padding and publish the actual consumed count after worker retirement. This prevents a threaded resize from leaving audio beyond the last captured picture. Add no producer locks, waits, pixel readbacks or pacing logs. Configure selects the driver on desktop Vulkan builds with its dependencies; existing default driver priority is retained. Add frontend admission/lifetime, delayed-video PCM, terminal-result publication and native isolated-window resize/reinit/stop regression coverage. Validation: GCC/Clang ASan+UBSan frontend contracts, Vulkan encode contracts, recording output/session/dispatch contracts and independent MP4 A/V checks. Windows native recording passes threaded/direct multichannel float PCM at 32/44.1/48 kHz, plus resize, reinit and stop with Khronos sync validation. Desktop Linux and Windows frontends build with automatic feature selection. Native Linux GPU acceptance remains open. The unrelated extended RSLC unsized uniform-buffer fixture is rejected by the installed standalone SPIR-V validator; that check is retained as a failure, not reported as an extended-suite pass.
41 lines
1.6 KiB
C
41 lines
1.6 KiB
C
/* Copyright (C) 2026 The RetroArch team. SPDX-License-Identifier: GPL-3.0-or-later */
|
|
#ifndef RECORD_VULKAN_H
|
|
#define RECORD_VULKAN_H
|
|
#ifdef HAVE_RECORD_VULKAN
|
|
#include "../record_driver.h"
|
|
#include "../record_gpu_renderer_vulkan.h"
|
|
RETRO_BEGIN_DECLS
|
|
/* Renderer-owned immutable device snapshot, borrowed until driver teardown. */
|
|
typedef struct record_vulkan_device
|
|
{
|
|
VkInstance instance;
|
|
VkPhysicalDevice physical;
|
|
VkDevice device;
|
|
VkQueue queue;
|
|
PFN_vkGetInstanceProcAddr get_proc;
|
|
uint32_t api_version;
|
|
unsigned family, producer_family;
|
|
bool storage_images;
|
|
} record_vulkan_device_t;
|
|
extern const record_driver_t record_vulkan;
|
|
struct video_frame_info;
|
|
bool record_vulkan_frame_info(struct video_frame_info *info, bool capture);
|
|
void record_vulkan_poll(void);
|
|
void record_vulkan_stop(void);
|
|
bool record_vulkan_pending(void);
|
|
bool record_vulkan_defer_start(void);
|
|
bool record_vulkan_cancel_start(void);
|
|
/* Render producer. Source and primary command belong to this frame. */
|
|
bool record_vulkan_gpu_capture(void *data, VkCommandBuffer command,
|
|
const vulkan_encode_capture_source_t *source, uint64_t timestamp,
|
|
unsigned dims, unsigned output_mode);
|
|
const VkSubmitInfo *record_vulkan_gpu_submission(void *data, const VkSubmitInfo *submit);
|
|
void record_vulkan_gpu_submitted(void *data, VkResult result);
|
|
/* Only after permanently discarding the unsubmitted primary contents. */
|
|
void record_vulkan_gpu_discard(void *data);
|
|
/* Stop before a resize can skip the next captured picture. */
|
|
void record_vulkan_gpu_reconfigure(void *data);
|
|
RETRO_END_DECLS
|
|
#endif
|
|
#endif
|