summaryrefslogtreecommitdiff
path: root/src/video_core/capture.h
diff options
context:
space:
mode:
authorGravatar Liam2024-01-26 16:10:21 -0500
committerGravatar Liam2024-02-09 09:20:53 -0500
commit0cb413c3d31b93ce347e997b9674c304094dab09 (patch)
tree959ef73963ea1e7975690d31eaf4ddc2f2ad6e19 /src/video_core/capture.h
parentnvnflinger/gpu: implement blending (diff)
downloadyuzu-0cb413c3d31b93ce347e997b9674c304094dab09.tar.gz
yuzu-0cb413c3d31b93ce347e997b9674c304094dab09.tar.xz
yuzu-0cb413c3d31b93ce347e997b9674c304094dab09.zip
nvnflinger/gpu: implement applet capture
Diffstat (limited to 'src/video_core/capture.h')
-rw-r--r--src/video_core/capture.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/video_core/capture.h b/src/video_core/capture.h
new file mode 100644
index 000000000..8db14a8ec
--- /dev/null
+++ b/src/video_core/capture.h
@@ -0,0 +1,36 @@
1// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "common/alignment.h"
7#include "common/bit_util.h"
8#include "common/common_types.h"
9#include "core/frontend/framebuffer_layout.h"
10#include "video_core/surface.h"
11
12namespace VideoCore::Capture {
13
14constexpr u32 BlockHeight = 4;
15constexpr u32 BlockDepth = 0;
16constexpr u32 BppLog2 = 2;
17
18constexpr auto PixelFormat = Surface::PixelFormat::B8G8R8A8_UNORM;
19
20constexpr auto LinearWidth = Layout::ScreenUndocked::Width;
21constexpr auto LinearHeight = Layout::ScreenUndocked::Height;
22constexpr auto LinearDepth = 1U;
23constexpr auto BytesPerPixel = 4U;
24
25constexpr auto TiledWidth = LinearWidth;
26constexpr auto TiledHeight = Common::AlignUpLog2(LinearHeight, BlockHeight + BlockDepth + BppLog2);
27constexpr auto TiledSize = TiledWidth * TiledHeight * (1 << BppLog2);
28
29constexpr Layout::FramebufferLayout Layout{
30 .width = LinearWidth,
31 .height = LinearHeight,
32 .screen = {0, 0, LinearWidth, LinearHeight},
33 .is_srgb = false,
34};
35
36} // namespace VideoCore::Capture