diff options
Diffstat (limited to 'src/video_core/renderer_base.h')
-rw-r--r-- | src/video_core/renderer_base.h | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index 2aba50eda..89a960eaf 100644 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h @@ -8,6 +8,8 @@ #include <boost/optional.hpp> #include "common/assert.h" #include "common/common_types.h" +#include "video_core/gpu.h" +#include "video_core/rasterizer_interface.h" class EmuWindow; @@ -16,40 +18,10 @@ public: /// Used to reference a framebuffer enum kFramebuffer { kFramebuffer_VirtualXFB = 0, kFramebuffer_EFB, kFramebuffer_Texture }; - /** - * Struct describing framebuffer metadata - * TODO(bunnei): This struct belongs in the GPU code, but we don't have a good place for it yet. - */ - struct FramebufferInfo { - enum class PixelFormat : u32 { - ABGR8 = 1, - }; - - /** - * Returns the number of bytes per pixel. - */ - static u32 BytesPerPixel(PixelFormat format) { - switch (format) { - case PixelFormat::ABGR8: - return 4; - } - - UNREACHABLE(); - } - - VAddr address; - u32 offset; - u32 width; - u32 height; - u32 stride; - PixelFormat pixel_format; - bool flip_vertical; - }; - virtual ~RendererBase() {} /// Swap buffers (render frame) - virtual void SwapBuffers(boost::optional<const FramebufferInfo&> framebuffer_info) = 0; + virtual void SwapBuffers(boost::optional<const Tegra::FramebufferConfig&> framebuffer) = 0; /** * Set the emulator window to use for renderer @@ -74,12 +46,16 @@ public: return m_current_frame; } + VideoCore::RasterizerInterface* Rasterizer() const { + return rasterizer.get(); + } + void RefreshRasterizerSetting(); protected: + std::unique_ptr<VideoCore::RasterizerInterface> rasterizer; f32 m_current_fps = 0.0f; ///< Current framerate, should be set by the renderer int m_current_frame = 0; ///< Current frame, should be set by the renderer private: - bool opengl_rasterizer_active = false; }; |