summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-04-25 04:57:10 +0200
committerSubv <subv2112@gmail.com>2018-04-25 18:55:29 +0200
commita6da2b93c16fd09ef491606d9a0dc99b51f4186f (patch)
treebdb43a4548440b5ab958d16df87e144a2121cc7e
parentGPU: Added surface copy registers to Fermi2D (diff)
downloadyuzu-a6da2b93c16fd09ef491606d9a0dc99b51f4186f.tar
yuzu-a6da2b93c16fd09ef491606d9a0dc99b51f4186f.tar.gz
yuzu-a6da2b93c16fd09ef491606d9a0dc99b51f4186f.tar.bz2
yuzu-a6da2b93c16fd09ef491606d9a0dc99b51f4186f.tar.lz
yuzu-a6da2b93c16fd09ef491606d9a0dc99b51f4186f.tar.xz
yuzu-a6da2b93c16fd09ef491606d9a0dc99b51f4186f.tar.zst
yuzu-a6da2b93c16fd09ef491606d9a0dc99b51f4186f.zip
-rw-r--r--src/video_core/gpu.cpp12
-rw-r--r--src/video_core/gpu.h3
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 {
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
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 {
RGBA8_SRGB = 0xD6,
};
+/// Returns the number of bytes per pixel of each rendertarget format.
+u32 RenderTargetBytesPerPixel(RenderTargetFormat format);
+
class DebugContext;
/**