diff options
| author | 2018-04-24 21:57:10 -0500 | |
|---|---|---|
| committer | 2018-04-25 11:55:29 -0500 | |
| commit | a6da2b93c16fd09ef491606d9a0dc99b51f4186f (patch) | |
| tree | bdb43a4548440b5ab958d16df87e144a2121cc7e /src | |
| parent | GPU: Added surface copy registers to Fermi2D (diff) | |
| download | yuzu-a6da2b93c16fd09ef491606d9a0dc99b51f4186f.tar.gz yuzu-a6da2b93c16fd09ef491606d9a0dc99b51f4186f.tar.xz yuzu-a6da2b93c16fd09ef491606d9a0dc99b51f4186f.zip | |
GPU: Added a function to retrieve the bytes per pixel of the render target formats.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/gpu.cpp | 12 | ||||
| -rw-r--r-- | src/video_core/gpu.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 351d21711..9eb143918 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -22,4 +22,16 @@ const Tegra::Engines::Maxwell3D& GPU::Get3DEngine() const { | |||
| 22 | return *maxwell_3d; | 22 | return *maxwell_3d; |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | u32 RenderTargetBytesPerPixel(RenderTargetFormat format) { | ||
| 26 | ASSERT(format != RenderTargetFormat::NONE); | ||
| 27 | |||
| 28 | switch (format) { | ||
| 29 | case RenderTargetFormat::RGBA8_UNORM: | ||
| 30 | case RenderTargetFormat::RGB10_A2_UNORM: | ||
| 31 | return 4; | ||
| 32 | default: | ||
| 33 | UNIMPLEMENTED_MSG("Unimplemented render target format %u", static_cast<u32>(format)); | ||
| 34 | } | ||
| 35 | } | ||
| 36 | |||
| 25 | } // namespace Tegra | 37 | } // namespace Tegra |
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 7afa6aaef..f168a5171 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -21,6 +21,9 @@ enum class RenderTargetFormat : u32 { | |||
| 21 | RGBA8_SRGB = 0xD6, | 21 | RGBA8_SRGB = 0xD6, |
| 22 | }; | 22 | }; |
| 23 | 23 | ||
| 24 | /// Returns the number of bytes per pixel of each rendertarget format. | ||
| 25 | u32 RenderTargetBytesPerPixel(RenderTargetFormat format); | ||
| 26 | |||
| 24 | class DebugContext; | 27 | class DebugContext; |
| 25 | 28 | ||
| 26 | /** | 29 | /** |