2016-03-06 08:48:35 +00:00
|
|
|
// Copyright 2016 Dolphin Emulator Project
|
2016-01-08 03:40:35 +00:00
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-03-06 08:48:35 +00:00
|
|
|
#include <d3d12.h>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "VideoBackends/D3D12/D3DStreamBuffer.h"
|
|
|
|
#include "VideoBackends/D3D12/D3DTexture.h"
|
2016-01-08 03:40:35 +00:00
|
|
|
#include "VideoCommon/VideoCommon.h"
|
|
|
|
|
|
|
|
namespace DX12
|
|
|
|
{
|
2016-03-06 08:48:35 +00:00
|
|
|
class D3DTexture2D;
|
|
|
|
|
2016-01-08 03:40:35 +00:00
|
|
|
class XFBEncoder
|
|
|
|
{
|
|
|
|
public:
|
2016-06-24 08:43:46 +00:00
|
|
|
XFBEncoder();
|
|
|
|
~XFBEncoder();
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void EncodeTextureToRam(u8* dst, u32 dst_pitch, u32 dst_height, D3DTexture2D* src_texture,
|
|
|
|
const TargetRectangle& src_rect, u32 src_width, u32 src_height,
|
|
|
|
float gamma);
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void DecodeToTexture(D3DTexture2D* dst_texture, const u8* src, u32 src_width, u32 src_height);
|
2016-01-08 03:40:35 +00:00
|
|
|
|
|
|
|
private:
|
2016-06-24 08:43:46 +00:00
|
|
|
D3DTexture2D* m_yuyv_texture;
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
ID3D12Resource* m_readback_buffer;
|
2016-03-06 08:48:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
std::unique_ptr<D3DStreamBuffer> m_upload_buffer;
|
|
|
|
std::unique_ptr<D3DStreamBuffer> m_encode_params_buffer;
|
2016-01-08 03:40:35 +00:00
|
|
|
};
|
|
|
|
|
2016-03-06 08:48:35 +00:00
|
|
|
extern std::unique_ptr<XFBEncoder> g_xfb_encoder;
|
2016-01-08 03:40:35 +00:00
|
|
|
}
|