diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2017-11-19 04:58:59 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-19 04:58:59 +0100 |
| commit | 609a17a0cd41a12c0fbf9a7c47c8889232594778 (patch) | |
| tree | 0a5f6f4b0a7d480accc4dfbcc3e9c1c6e3652dc0 /Source/Core/VideoCommon/FramebufferManagerBase.h | |
| parent | d800b0f79868a28356b4e40cb9b2e5af43977042 (diff) | |
| parent | 1f1574b7ab032afa7b3a600a071699f2cbea124e (diff) | |
Merge pull request #5498 from iwubcode/hybrid_xfb
Hybrid xfb
Diffstat (limited to 'Source/Core/VideoCommon/FramebufferManagerBase.h')
| -rw-r--r-- | Source/Core/VideoCommon/FramebufferManagerBase.h | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/Source/Core/VideoCommon/FramebufferManagerBase.h b/Source/Core/VideoCommon/FramebufferManagerBase.h index c780a3fa21..5e645dc7f7 100644 --- a/Source/Core/VideoCommon/FramebufferManagerBase.h +++ b/Source/Core/VideoCommon/FramebufferManagerBase.h @@ -17,94 +17,14 @@ inline bool AddressRangesOverlap(u32 aLower, u32 aUpper, u32 bLower, u32 bUpper) return !((aLower >= bUpper) || (bLower >= aUpper)); } -struct XFBSourceBase -{ - virtual ~XFBSourceBase() {} - virtual void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight) = 0; - - virtual void CopyEFB(float Gamma) = 0; - - u32 srcAddr; - u32 srcWidth; - u32 srcHeight; - - unsigned int texWidth; - unsigned int texHeight; - - // TODO: only used by OGL - TargetRectangle sourceRc; -}; - class FramebufferManagerBase { public: - enum - { - // There may be multiple XFBs in GameCube RAM. This is the maximum number to - // virtualize. - MAX_VIRTUAL_XFB = 8 - }; - - FramebufferManagerBase(); virtual ~FramebufferManagerBase(); - static void CopyToXFB(u32 xfbAddr, u32 fbStride, u32 fbHeight, const EFBRectangle& sourceRc, - float Gamma); - static const XFBSourceBase* const* GetXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, - u32* xfbCount); - - static void SetLastXfbWidth(unsigned int width) { s_last_xfb_width = width; } - static void SetLastXfbHeight(unsigned int height) { s_last_xfb_height = height; } - static unsigned int LastXfbWidth() { return s_last_xfb_width; } - static unsigned int LastXfbHeight() { return s_last_xfb_height; } - static int ScaleToVirtualXfbWidth(int x, const TargetRectangle& target_rectangle); - static int ScaleToVirtualXfbHeight(int y, const TargetRectangle& target_rectangle); - static unsigned int GetEFBLayers() { return m_EFBLayers; } - virtual std::pair<u32, u32> GetTargetSize() const = 0; - protected: - struct VirtualXFB - { - VirtualXFB() {} - // Address and size in GameCube RAM - u32 xfbAddr = 0; - u32 xfbWidth = 0; - u32 xfbHeight = 0; - - std::unique_ptr<XFBSourceBase> xfbSource; - }; - - typedef std::list<VirtualXFB> VirtualXFBListType; - static unsigned int m_EFBLayers; - -private: - virtual std::unique_ptr<XFBSourceBase> - CreateXFBSource(unsigned int target_width, unsigned int target_height, unsigned int layers) = 0; - - static VirtualXFBListType::iterator FindVirtualXFB(u32 xfbAddr, u32 width, u32 height); - - static void ReplaceVirtualXFB(); - - // TODO: merge these virtual funcs, they are nearly all the same - virtual void CopyToRealXFB(u32 xfbAddr, u32 fbStride, u32 fbHeight, const EFBRectangle& sourceRc, - float Gamma = 1.0f) = 0; - static void CopyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, - float Gamma = 1.0f); - - static const XFBSourceBase* const* GetRealXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, - u32* xfbCount); - static const XFBSourceBase* const* GetVirtualXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, - u32* xfbCount); - - static std::unique_ptr<XFBSourceBase> m_realXFBSource; // Only used in Real XFB mode - static VirtualXFBListType m_virtualXFBList; // Only used in Virtual XFB mode - - static std::array<const XFBSourceBase*, MAX_VIRTUAL_XFB> m_overlappingXFBArray; - - static unsigned int s_last_xfb_width; - static unsigned int s_last_xfb_height; }; extern std::unique_ptr<FramebufferManagerBase> g_framebuffer_manager; |
