File: EfbInterface.h

package info (click to toggle)
dolphin-emu 2503%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 111,624 kB
  • sloc: cpp: 787,747; ansic: 217,914; xml: 31,400; python: 4,226; yacc: 3,985; javascript: 2,430; makefile: 777; asm: 726; sh: 281; pascal: 257; perl: 97; objc: 75
file content (62 lines) | stat: -rw-r--r-- 1,332 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright 2009 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include "Common/CommonTypes.h"
#include "Common/MathUtil.h"
#include "VideoCommon/PerfQueryBase.h"

namespace EfbInterface
{
// xfb color format - packed so the compiler doesn't mess with alignment
#pragma pack(push, 1)
struct yuv422_packed
{
  u8 Y;
  u8 UV;
};
#pragma pack(pop)

// But this struct is only used internally, so we could optimise alignment
struct yuv444
{
  u8 Y;
  s8 U;
  s8 V;
};

enum
{
  ALP_C,
  BLU_C,
  GRN_C,
  RED_C
};

// color order is ABGR in order to emulate RGBA on little-endian hardware

// does full blending of an incoming pixel
void BlendTev(u16 x, u16 y, u8* color);

// compare z at location x,y
// writes it if it passes
// returns result of compare.
bool ZCompare(u16 x, u16 y, u32 z);

// sets the color and alpha
void SetColor(u16 x, u16 y, u8* color);
void SetDepth(u16 x, u16 y, u32 depth);

u32 GetColor(u16 x, u16 y);
u32 GetDepth(u16 x, u16 y);

u8* GetPixelPointer(u16 x, u16 y, bool depth);

void EncodeXFB(u8* xfb_in_ram, u32 memory_stride, const MathUtil::Rectangle<int>& source_rect,
               float y_scale, float gamma);

u32 GetPerfQueryResult(PerfQueryType type);
void ResetPerfQuery();
void IncPerfCounterQuadCount(PerfQueryType type);
}  // namespace EfbInterface