diff options
| author | Scott Mansell <phiren@gmail.com> | 2023-01-31 17:26:46 +1300 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2023-02-09 18:36:20 +1300 |
| commit | 11de923dcb7e6a7e1b29e5b15cb2bf71ede22b97 (patch) | |
| tree | 52769efe7cac3f705d0daddb83ab59f68d9511ed /Source/Core/VideoCommon/FramebufferManager.h | |
| parent | e0090024119184238032923987af1c8d7167b7b5 (diff) | |
Move xfb tracking and IR scaling out of RenderBase
Diffstat (limited to 'Source/Core/VideoCommon/FramebufferManager.h')
| -rw-r--r-- | Source/Core/VideoCommon/FramebufferManager.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/FramebufferManager.h b/Source/Core/VideoCommon/FramebufferManager.h index c3871c8e15..0eb5d4aa93 100644 --- a/Source/Core/VideoCommon/FramebufferManager.h +++ b/Source/Core/VideoCommon/FramebufferManager.h @@ -6,6 +6,7 @@ #include <array> #include <memory> #include <optional> +#include <tuple> #include "Common/CommonTypes.h" #include "Common/EnumFormatter.h" @@ -54,8 +55,8 @@ public: static AbstractTextureFormat GetEFBColorFormat(); static AbstractTextureFormat GetEFBDepthFormat(); static AbstractTextureFormat GetEFBDepthCopyFormat(); - static TextureConfig GetEFBColorTextureConfig(); - static TextureConfig GetEFBDepthTextureConfig(); + static TextureConfig GetEFBColorTextureConfig(u32 width, u32 height); + static TextureConfig GetEFBDepthTextureConfig(u32 width, u32 height); // Accessors. AbstractTexture* GetEFBColorTexture() const { return m_efb_color_texture.get(); } @@ -69,6 +70,20 @@ public: bool IsEFBStereo() const { return m_efb_color_texture->GetLayers() > 1; } FramebufferState GetEFBFramebufferState() const; + // EFB coordinate conversion functions + // Use this to convert a whole native EFB rect to backbuffer coordinates + MathUtil::Rectangle<int> ConvertEFBRectangle(const MathUtil::Rectangle<int>& rc) const; + + unsigned int GetEFBScale() const; + + // Use this to upscale native EFB coordinates to IDEAL internal resolution + int EFBToScaledX(int x) const; + int EFBToScaledY(int y) const; + + // Floating point versions of the above - only use them if really necessary + float EFBToScaledXf(float x) const; + float EFBToScaledYf(float y) const; + // First-time setup. bool Initialize(); @@ -172,9 +187,13 @@ protected: void DrawPokeVertices(const EFBPokeVertex* vertices, u32 vertex_count, const AbstractPipeline* pipeline); + std::tuple<u32, u32> CalculateTargetSize(); + void DoLoadState(PointerWrap& p); void DoSaveState(PointerWrap& p); + float m_efb_scale = 0.0f; + std::unique_ptr<AbstractTexture> m_efb_color_texture; std::unique_ptr<AbstractTexture> m_efb_convert_color_texture; std::unique_ptr<AbstractTexture> m_efb_depth_texture; |
