2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2009 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 21:29:41 -06:00
|
|
|
// Refer to the license.txt file included.
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2016-01-17 14:54:31 -07:00
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
#include "VideoCommon/PerfQueryBase.h"
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "VideoCommon/VideoCommon.h"
|
2010-06-08 19:37:08 -06:00
|
|
|
|
|
|
|
namespace EfbInterface
|
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
// xfb color format - packed so the compiler doesn't mess with alignment
|
|
|
|
#pragma pack(push, 1)
|
|
|
|
struct yuv422_packed
|
|
|
|
{
|
|
|
|
u8 Y;
|
|
|
|
u8 UV;
|
|
|
|
};
|
2013-08-20 06:56:19 -06:00
|
|
|
#pragma pack(pop)
|
2013-08-20 05:51:39 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// But this struct is only used internally, so we could optimise alignment
|
|
|
|
struct yuv444
|
|
|
|
{
|
|
|
|
u8 Y;
|
|
|
|
s8 U;
|
|
|
|
s8 V;
|
|
|
|
};
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ALP_C,
|
|
|
|
BLU_C,
|
|
|
|
GRN_C,
|
|
|
|
RED_C
|
|
|
|
};
|
2013-08-22 06:07:21 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// color order is ABGR in order to emulate RGBA on little-endian hardware
|
2013-08-22 06:07:21 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// does full blending of an incoming pixel
|
|
|
|
void BlendTev(u16 x, u16 y, u8* color);
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// compare z at location x,y
|
|
|
|
// writes it if it passes
|
|
|
|
// returns result of compare.
|
|
|
|
bool ZCompare(u16 x, u16 y, u32 z);
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// sets the color and alpha
|
|
|
|
void SetColor(u16 x, u16 y, u8* color);
|
|
|
|
void SetDepth(u16 x, u16 y, u32 depth);
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2016-09-21 16:53:13 -06:00
|
|
|
u32 GetColor(u16 x, u16 y);
|
2016-06-24 02:43:46 -06:00
|
|
|
u32 GetDepth(u16 x, u16 y);
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
u8* GetPixelPointer(u16 x, u16 y, bool depth);
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2019-04-15 08:47:46 -06:00
|
|
|
void EncodeXFB(u8* xfb_in_ram, u32 memory_stride, const MathUtil::Rectangle<int>& source_rect,
|
|
|
|
float y_scale, float gamma);
|
2013-08-20 05:51:39 -06:00
|
|
|
|
2018-05-18 13:13:03 -06:00
|
|
|
u32 GetPerfQueryResult(PerfQueryType type);
|
|
|
|
void ResetPerfQuery();
|
|
|
|
void IncPerfCounterQuadCount(PerfQueryType type);
|
|
|
|
} // namespace EfbInterface
|