diff options
| author | 2015-12-06 19:06:12 -0800 | |
|---|---|---|
| committer | 2015-12-07 20:20:38 -0800 | |
| commit | 195fedccf07b909c95e5905c7154c595bb260fc7 (patch) | |
| tree | b36ecb555672b6994e4bd11812a605fe2726d172 /src/video_core/rasterizer_interface.h | |
| parent | VideoCore: Rename HWRasterizer methods to be less confusing (diff) | |
| download | yuzu-195fedccf07b909c95e5905c7154c595bb260fc7.tar.gz yuzu-195fedccf07b909c95e5905c7154c595bb260fc7.tar.xz yuzu-195fedccf07b909c95e5905c7154c595bb260fc7.zip | |
VideoCore: Unify interface to OpenGL and SW rasterizers
This removes explicit checks sprinkled all over the codebase to instead
just have the SW rasterizer expose an implementation with no-ops for
most operations.
Diffstat (limited to 'src/video_core/rasterizer_interface.h')
| -rw-r--r-- | src/video_core/rasterizer_interface.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h new file mode 100644 index 000000000..008c5827b --- /dev/null +++ b/src/video_core/rasterizer_interface.h | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "common/common_types.h" | ||
| 8 | |||
| 9 | namespace Pica { | ||
| 10 | namespace Shader { | ||
| 11 | struct OutputVertex; | ||
| 12 | } | ||
| 13 | } | ||
| 14 | |||
| 15 | namespace VideoCore { | ||
| 16 | |||
| 17 | class RasterizerInterface { | ||
| 18 | public: | ||
| 19 | virtual ~RasterizerInterface() {} | ||
| 20 | |||
| 21 | /// Initialize API-specific GPU objects | ||
| 22 | virtual void InitObjects() = 0; | ||
| 23 | |||
| 24 | /// Reset the rasterizer, such as flushing all caches and updating all state | ||
| 25 | virtual void Reset() = 0; | ||
| 26 | |||
| 27 | /// Queues the primitive formed by the given vertices for rendering | ||
| 28 | virtual void AddTriangle(const Pica::Shader::OutputVertex& v0, | ||
| 29 | const Pica::Shader::OutputVertex& v1, | ||
| 30 | const Pica::Shader::OutputVertex& v2) = 0; | ||
| 31 | |||
| 32 | /// Draw the current batch of triangles | ||
| 33 | virtual void DrawTriangles() = 0; | ||
| 34 | |||
| 35 | /// Commit the rasterizer's framebuffer contents immediately to the current 3DS memory framebuffer | ||
| 36 | virtual void FlushFramebuffer() = 0; | ||
| 37 | |||
| 38 | /// Notify rasterizer that the specified PICA register has been changed | ||
| 39 | virtual void NotifyPicaRegisterChanged(u32 id) = 0; | ||
| 40 | |||
| 41 | /// Notify rasterizer that any caches of the specified region should be flushed to 3DS memory. | ||
| 42 | virtual void FlushRegion(PAddr addr, u32 size) = 0; | ||
| 43 | |||
| 44 | /// Notify rasterizer that any caches of the specified region should be discraded and reloaded from 3DS memory. | ||
| 45 | virtual void InvalidateRegion(PAddr addr, u32 size) = 0; | ||
| 46 | }; | ||
| 47 | |||
| 48 | } | ||