diff options
| author | 2018-03-23 23:30:48 -0400 | |
|---|---|---|
| committer | 2018-03-23 23:30:48 -0400 | |
| commit | a10baacf9e5ab48af7fb0ccbdc75371c9287d3ba (patch) | |
| tree | 9ed56f99b9d2564f9250d3754e429eb0c8b43323 /src/video_core/renderer_base.h | |
| parent | Merge pull request #255 from Subv/sd_card (diff) | |
| parent | gl_rasterizer: Fake render in green, because it's cooler. (diff) | |
| download | yuzu-a10baacf9e5ab48af7fb0ccbdc75371c9287d3ba.tar.gz yuzu-a10baacf9e5ab48af7fb0ccbdc75371c9287d3ba.tar.xz yuzu-a10baacf9e5ab48af7fb0ccbdc75371c9287d3ba.zip | |
Merge pull request #265 from bunnei/tegra-progress-2
Tegra progress 2
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 @@ | |||
| 8 | #include <boost/optional.hpp> | 8 | #include <boost/optional.hpp> |
| 9 | #include "common/assert.h" | 9 | #include "common/assert.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "video_core/gpu.h" | ||
| 12 | #include "video_core/rasterizer_interface.h" | ||
| 11 | 13 | ||
| 12 | class EmuWindow; | 14 | class EmuWindow; |
| 13 | 15 | ||
| @@ -16,40 +18,10 @@ public: | |||
| 16 | /// Used to reference a framebuffer | 18 | /// Used to reference a framebuffer |
| 17 | enum kFramebuffer { kFramebuffer_VirtualXFB = 0, kFramebuffer_EFB, kFramebuffer_Texture }; | 19 | enum kFramebuffer { kFramebuffer_VirtualXFB = 0, kFramebuffer_EFB, kFramebuffer_Texture }; |
| 18 | 20 | ||
| 19 | /** | ||
| 20 | * Struct describing framebuffer metadata | ||
| 21 | * TODO(bunnei): This struct belongs in the GPU code, but we don't have a good place for it yet. | ||
| 22 | */ | ||
| 23 | struct FramebufferInfo { | ||
| 24 | enum class PixelFormat : u32 { | ||
| 25 | ABGR8 = 1, | ||
| 26 | }; | ||
| 27 | |||
| 28 | /** | ||
| 29 | * Returns the number of bytes per pixel. | ||
| 30 | */ | ||
| 31 | static u32 BytesPerPixel(PixelFormat format) { | ||
| 32 | switch (format) { | ||
| 33 | case PixelFormat::ABGR8: | ||
| 34 | return 4; | ||
| 35 | } | ||
| 36 | |||
| 37 | UNREACHABLE(); | ||
| 38 | } | ||
| 39 | |||
| 40 | VAddr address; | ||
| 41 | u32 offset; | ||
| 42 | u32 width; | ||
| 43 | u32 height; | ||
| 44 | u32 stride; | ||
| 45 | PixelFormat pixel_format; | ||
| 46 | bool flip_vertical; | ||
| 47 | }; | ||
| 48 | |||
| 49 | virtual ~RendererBase() {} | 21 | virtual ~RendererBase() {} |
| 50 | 22 | ||
| 51 | /// Swap buffers (render frame) | 23 | /// Swap buffers (render frame) |
| 52 | virtual void SwapBuffers(boost::optional<const FramebufferInfo&> framebuffer_info) = 0; | 24 | virtual void SwapBuffers(boost::optional<const Tegra::FramebufferConfig&> framebuffer) = 0; |
| 53 | 25 | ||
| 54 | /** | 26 | /** |
| 55 | * Set the emulator window to use for renderer | 27 | * Set the emulator window to use for renderer |
| @@ -74,12 +46,16 @@ public: | |||
| 74 | return m_current_frame; | 46 | return m_current_frame; |
| 75 | } | 47 | } |
| 76 | 48 | ||
| 49 | VideoCore::RasterizerInterface* Rasterizer() const { | ||
| 50 | return rasterizer.get(); | ||
| 51 | } | ||
| 52 | |||
| 77 | void RefreshRasterizerSetting(); | 53 | void RefreshRasterizerSetting(); |
| 78 | 54 | ||
| 79 | protected: | 55 | protected: |
| 56 | std::unique_ptr<VideoCore::RasterizerInterface> rasterizer; | ||
| 80 | f32 m_current_fps = 0.0f; ///< Current framerate, should be set by the renderer | 57 | f32 m_current_fps = 0.0f; ///< Current framerate, should be set by the renderer |
| 81 | int m_current_frame = 0; ///< Current frame, should be set by the renderer | 58 | int m_current_frame = 0; ///< Current frame, should be set by the renderer |
| 82 | 59 | ||
| 83 | private: | 60 | private: |
| 84 | bool opengl_rasterizer_active = false; | ||
| 85 | }; | 61 | }; |