From b1109931b9a92ce89635cb7c0c0c1c0c7e6866ed Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 23 Apr 2018 20:12:40 -0500 Subject: GPU: Added boilerplate code for the Fermi2D engine --- src/video_core/gpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/video_core/gpu.cpp') diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 9463cd5d6..351d21711 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -12,7 +12,7 @@ namespace Tegra { GPU::GPU() { memory_manager = std::make_unique(); maxwell_3d = std::make_unique(*memory_manager); - fermi_2d = std::make_unique(); + fermi_2d = std::make_unique(*memory_manager); maxwell_compute = std::make_unique(); } -- cgit v1.2.3 From a6da2b93c16fd09ef491606d9a0dc99b51f4186f Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 24 Apr 2018 21:57:10 -0500 Subject: GPU: Added a function to retrieve the bytes per pixel of the render target formats. --- src/video_core/gpu.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/video_core/gpu.cpp') 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(format)); + } +} + } // namespace Tegra -- cgit v1.2.3