diff options
author | Subv <subv2112@gmail.com> | 2018-04-24 21:57:10 -0500 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2018-04-25 11:55:29 -0500 |
commit | a6da2b93c16fd09ef491606d9a0dc99b51f4186f (patch) | |
tree | bdb43a4548440b5ab958d16df87e144a2121cc7e /src/video_core/gpu.cpp | |
parent | 378c881427d34962461099ef3d55de871710b897 (diff) |
GPU: Added a function to retrieve the bytes per pixel of the render target formats.
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r-- | src/video_core/gpu.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 351d217116..9eb1439180 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -22,4 +22,16 @@ const Tegra::Engines::Maxwell3D& GPU::Get3DEngine() const { return *maxwell_3d; } +u32 RenderTargetBytesPerPixel(RenderTargetFormat format) { + ASSERT(format != RenderTargetFormat::NONE); + + switch (format) { + case RenderTargetFormat::RGBA8_UNORM: + case RenderTargetFormat::RGB10_A2_UNORM: + return 4; + default: + UNIMPLEMENTED_MSG("Unimplemented render target format %u", static_cast<u32>(format)); + } +} + } // namespace Tegra |