Debian Codegraph @

Source/Core/VideoBackends/Software/SWEfbInterface.h

raw symbols SCIP
1 // Copyright 2009 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include "Common/CommonTypes.h"
7 #include "Common/MathUtil.h"
8 #include "VideoCommon/EFBInterface.h"
9 #include "VideoCommon/PerfQueryBase.h"
10
11 namespace EfbInterface
12 {
13 // xfb color format - packed so the compiler doesn't mess with alignment
14 #pragma pack(push, 1)
15 struct yuv422_packed
16 {
17 u8 Y;
18 u8 UV;
19 };
20 #pragma pack(pop)
21
22 // But this struct is only used internally, so we could optimise alignment
23 struct yuv444
24 {
25 u8 Y;
26 s8 U;
27 s8 V;
28 };
29
30 enum
31 {
32 ALP_C,
33 BLU_C,
34 GRN_C,
35 RED_C
36 };
37
38 // color order is ABGR in order to emulate RGBA on little-endian hardware
39
40 // does full blending of an incoming pixel
41 void BlendTev(u16 x, u16 y, u8* color);
42
43 // compare z at location x,y
44 // writes it if it passes
45 // returns result of compare.
46 bool ZCompare(u16 x, u16 y, u32 z);
47
48 // sets the color and alpha
49 void SetColor(u16 x, u16 y, u8* color);
50 void SetDepth(u16 x, u16 y, u32 depth);
51
52 u8* GetPixelPointer(u16 x, u16 y, bool depth);
53
54 void EncodeXFB(u8* xfb_in_ram, u32 memory_stride, const MathUtil::Rectangle<int>& source_rect,
55 float y_scale, float gamma);
56
57 u32 GetPerfQueryResult(PerfQueryType type);
58 void ResetPerfQuery();
59 void IncPerfCounterQuadCount(PerfQueryType type);
60 } // namespace EfbInterface
61
62 namespace SW
63 {
64 class SWEFBInterface final : public EFBInterfaceBase
65 {
66 void ReinterpretPixelData(EFBReinterpretType convtype) override;
67
68 void PokeColor(u16 x, u16 y, u32 color) override;
69 void PokeDepth(u16 x, u16 y, u32 depth) override;
70
71 u32 PeekColorInternal(u16 x, u16 y) override;
72 u32 PeekDepthInternal(u16 x, u16 y) override;
73 };
74 } // namespace SW