mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-10-25 13:31:41 +00:00
Implement libplacebo on MoltenVK
This commit is contained in:
1 parent
ec75f0d8de
commit
8c6b422040
6 files changed
+237
-15
No files matched your search
@@ -10,6 +10,21 @@
|
||||
#include <libplacebo/renderer.h>
|
||||
#include <libplacebo/vulkan.h>
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
class MetalVulkanTextureFactory {
|
||||
public:
|
||||
MetalVulkanTextureFactory(pl_vulkan vulkan);
|
||||
~MetalVulkanTextureFactory();
|
||||
|
||||
bool mapVideoToolboxToPlacebo(const AVFrame *frame, pl_frame* mappedFrame);
|
||||
void unmapVideoToolboxFromPlacebo(pl_frame* mappedFrame);
|
||||
|
||||
private:
|
||||
pl_vulkan m_Vulkan;
|
||||
/* CVMetalTextureCacheRef */ void* m_TextureCache = nullptr;
|
||||
};
|
||||
#endif
|
||||
|
||||
class PlVkRenderer : public IFFmpegRenderer {
|
||||
public:
|
||||
PlVkRenderer(AVHWDeviceType hwDeviceType = AV_HWDEVICE_TYPE_NONE, IFFmpegRenderer *backendRenderer = nullptr);
|
||||
@@ -35,6 +50,7 @@ private:
|
||||
static void overlayUploadComplete(void* opaque);
|
||||
|
||||
bool mapAvFrameToPlacebo(const AVFrame *frame, pl_frame* mappedFrame);
|
||||
void unmapAvFrameFromPlacebo(const AVFrame *frame, pl_frame* mappedFrame);
|
||||
bool populateQueues(int videoFormat);
|
||||
bool chooseVulkanDevice(PDECODER_PARAMETERS params, bool hdrOutputRequired);
|
||||
bool tryInitializeDevice(VkPhysicalDevice device, VkPhysicalDeviceProperties* deviceProps,
|
||||
@@ -48,6 +64,10 @@ private:
|
||||
IFFmpegRenderer* m_Backend;
|
||||
AVHWDeviceType m_HwDeviceType;
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
std::unique_ptr<MetalVulkanTextureFactory> m_MetalTextureFactory;
|
||||
#endif
|
||||
|
||||
// SDL state
|
||||
SDL_Window* m_Window = nullptr;
|
||||
|
||||
|
||||
Reference in new issue
Block a user