EfbInterface.h 1.3 KB

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