Files
dolphin/Source/Core/VideoBackends/Software/EfbInterface.h
T

55 lines
1.4 KiB
C++
Raw Normal View History

// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
2010-06-09 01:37:08 +00:00
#pragma once
2010-06-09 01:37:08 +00:00
#include "VideoCommon.h"
namespace EfbInterface
{
const int DEPTH_BUFFER_START = EFB_WIDTH * EFB_HEIGHT * 3;
2010-06-09 01:37:08 +00:00
// xfb color format - packed so the compiler doesn't mess with alignment
2013-08-21 00:56:19 +12:00
#pragma pack(push,1)
typedef struct {
2013-08-20 23:51:39 +12:00
u8 Y;
u8 UV;
} yuv422_packed;
2013-08-21 00:56:19 +12:00
#pragma pack(pop)
2013-08-20 23:51:39 +12:00
2013-08-21 00:56:19 +12:00
// But this struct is only used internally, so we could optimise alignment
typedef struct {
2013-08-20 23:51:39 +12:00
u8 Y;
s8 U;
s8 V;
} yuv444;
2010-06-09 01:37:08 +00:00
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);
2010-06-09 01:37:08 +00: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-09 01:37:08 +00:00
// sets the color and alpha
void SetColor(u16 x, u16 y, u8 *color);
void SetDepth(u16 x, u16 y, u32 depth);
2010-06-09 01:37:08 +00:00
void GetColor(u16 x, u16 y, u8 *color);
2013-08-20 23:51:39 +12:00
void GetColorYUV(u16 x, u16 y, yuv444 *color);
u32 GetDepth(u16 x, u16 y);
2010-06-09 01:37:08 +00:00
u8* GetPixelPointer(u16 x, u16 y, bool depth);
2010-06-09 01:37:08 +00:00
2013-08-20 23:51:39 +12:00
void CopyToXFB(yuv422_packed* xfb_in_ram, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma);
void BypassXFB(u8* texture, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma);
2013-08-20 23:51:39 +12:00
void DoState(PointerWrap &p);
2010-06-09 01:37:08 +00:00
}