mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
Reformat all the things. Have fun with merge conflicts.
This commit is contained in:
@ -9,7 +9,6 @@
|
||||
|
||||
namespace DX12
|
||||
{
|
||||
|
||||
// On the GameCube, the game sends a request for the graphics processor to
|
||||
// transfer its internal EFB (Embedded Framebuffer) to an area in GameCube RAM
|
||||
// called the XFB (External Framebuffer). The size and location of the XFB is
|
||||
@ -44,77 +43,79 @@ namespace DX12
|
||||
|
||||
struct XFBSource final : public XFBSourceBase
|
||||
{
|
||||
XFBSource(D3DTexture2D* tex, int slices) : m_tex(tex), m_slices(slices) {}
|
||||
~XFBSource() { m_tex->Release(); }
|
||||
XFBSource(D3DTexture2D* tex, int slices) : m_tex(tex), m_slices(slices) {}
|
||||
~XFBSource() { m_tex->Release(); }
|
||||
void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight) override;
|
||||
void CopyEFB(float gamma) override;
|
||||
|
||||
void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight) override;
|
||||
void CopyEFB(float gamma) override;
|
||||
|
||||
D3DTexture2D* m_tex;
|
||||
const int m_slices;
|
||||
D3DTexture2D* m_tex;
|
||||
const int m_slices;
|
||||
};
|
||||
|
||||
class FramebufferManager final : public FramebufferManagerBase
|
||||
{
|
||||
public:
|
||||
FramebufferManager();
|
||||
~FramebufferManager();
|
||||
FramebufferManager();
|
||||
~FramebufferManager();
|
||||
|
||||
static D3DTexture2D*& GetEFBColorTexture();
|
||||
static D3DTexture2D*& GetEFBDepthTexture();
|
||||
static D3DTexture2D*& GetResolvedEFBColorTexture();
|
||||
static D3DTexture2D*& GetResolvedEFBDepthTexture();
|
||||
static D3DTexture2D*& GetEFBColorTexture();
|
||||
static D3DTexture2D*& GetEFBDepthTexture();
|
||||
static D3DTexture2D*& GetResolvedEFBColorTexture();
|
||||
static D3DTexture2D*& GetResolvedEFBDepthTexture();
|
||||
|
||||
static D3DTexture2D*& GetEFBColorTempTexture();
|
||||
static void SwapReinterpretTexture();
|
||||
static D3DTexture2D*& GetEFBColorTempTexture();
|
||||
static void SwapReinterpretTexture();
|
||||
|
||||
static void ResolveDepthTexture();
|
||||
static void ResolveDepthTexture();
|
||||
|
||||
static void RestoreEFBRenderTargets();
|
||||
static void RestoreEFBRenderTargets();
|
||||
|
||||
// Access EFB from CPU
|
||||
static u32 ReadEFBColorAccessCopy(u32 x, u32 y);
|
||||
static float ReadEFBDepthAccessCopy(u32 x, u32 y);
|
||||
static void UpdateEFBColorAccessCopy(u32 x, u32 y, u32 color);
|
||||
static void UpdateEFBDepthAccessCopy(u32 x, u32 y, float depth);
|
||||
static void InitializeEFBAccessCopies();
|
||||
static void MapEFBColorAccessCopy();
|
||||
static void MapEFBDepthAccessCopy();
|
||||
static void InvalidateEFBAccessCopies();
|
||||
static void DestroyEFBAccessCopies();
|
||||
// Access EFB from CPU
|
||||
static u32 ReadEFBColorAccessCopy(u32 x, u32 y);
|
||||
static float ReadEFBDepthAccessCopy(u32 x, u32 y);
|
||||
static void UpdateEFBColorAccessCopy(u32 x, u32 y, u32 color);
|
||||
static void UpdateEFBDepthAccessCopy(u32 x, u32 y, float depth);
|
||||
static void InitializeEFBAccessCopies();
|
||||
static void MapEFBColorAccessCopy();
|
||||
static void MapEFBDepthAccessCopy();
|
||||
static void InvalidateEFBAccessCopies();
|
||||
static void DestroyEFBAccessCopies();
|
||||
|
||||
private:
|
||||
std::unique_ptr<XFBSourceBase> CreateXFBSource(unsigned int target_width, unsigned int target_height, unsigned int layers) override;
|
||||
void GetTargetSize(unsigned int* width, unsigned int* height) override;
|
||||
std::unique_ptr<XFBSourceBase> CreateXFBSource(unsigned int target_width,
|
||||
unsigned int target_height,
|
||||
unsigned int layers) override;
|
||||
void GetTargetSize(unsigned int* width, unsigned int* height) override;
|
||||
|
||||
void CopyToRealXFB(u32 xfbAddr, u32 fbStride, u32 fbHeight, const EFBRectangle& sourceRc, float gamma) override;
|
||||
void CopyToRealXFB(u32 xfbAddr, u32 fbStride, u32 fbHeight, const EFBRectangle& sourceRc,
|
||||
float gamma) override;
|
||||
|
||||
static struct Efb
|
||||
{
|
||||
D3DTexture2D* color_tex;
|
||||
static struct Efb
|
||||
{
|
||||
D3DTexture2D* color_tex;
|
||||
|
||||
D3DTexture2D* depth_tex;
|
||||
D3DTexture2D* depth_tex;
|
||||
|
||||
D3DTexture2D* color_temp_tex;
|
||||
D3DTexture2D* color_temp_tex;
|
||||
|
||||
D3DTexture2D* resolved_color_tex;
|
||||
D3DTexture2D* resolved_depth_tex;
|
||||
D3DTexture2D* resolved_color_tex;
|
||||
D3DTexture2D* resolved_depth_tex;
|
||||
|
||||
D3DTexture2D* color_access_resize_tex;
|
||||
ID3D12Resource* color_access_readback_buffer;
|
||||
u8* color_access_readback_map;
|
||||
u32 color_access_readback_pitch;
|
||||
D3DTexture2D* color_access_resize_tex;
|
||||
ID3D12Resource* color_access_readback_buffer;
|
||||
u8* color_access_readback_map;
|
||||
u32 color_access_readback_pitch;
|
||||
|
||||
D3DTexture2D* depth_access_resize_tex;
|
||||
ID3D12Resource* depth_access_readback_buffer;
|
||||
u8* depth_access_readback_map;
|
||||
u32 depth_access_readback_pitch;
|
||||
D3DTexture2D* depth_access_resize_tex;
|
||||
ID3D12Resource* depth_access_readback_buffer;
|
||||
u8* depth_access_readback_map;
|
||||
u32 depth_access_readback_pitch;
|
||||
|
||||
int slices;
|
||||
} m_efb;
|
||||
int slices;
|
||||
} m_efb;
|
||||
|
||||
static unsigned int m_target_width;
|
||||
static unsigned int m_target_height;
|
||||
static unsigned int m_target_width;
|
||||
static unsigned int m_target_height;
|
||||
};
|
||||
|
||||
} // namespace DX12
|
||||
|
Reference in New Issue
Block a user