Skip to content

Commit

Permalink
Merge pull request #8051 from JosJuice/efb-constexpr
Browse files Browse the repository at this point in the history
Turn EFB_WIDTH/EFB_HEIGHT into constexpr
  • Loading branch information
stenzek committed Apr 28, 2019
2 parents e17bb8c + ced2306 commit d2d8d7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
5 changes: 3 additions & 2 deletions Source/Core/VideoBackends/Software/EfbInterface.cpp
Expand Up @@ -588,8 +588,9 @@ void EncodeXFB(u8* xfb_in_ram, u32 memory_stride, const MathUtil::Rectangle<int>
//
// In our implementation, the garbage just so happens to be the top or bottom row.
// Statistically, that could happen.
u16 y_prev = static_cast<u16>(std::max(clamp_top ? source_rect.top : 0, y - 1));
u16 y_next = static_cast<u16>(std::min(clamp_bottom ? source_rect.bottom : EFB_HEIGHT, y + 1));
const u16 y_prev = static_cast<u16>(std::max(clamp_top ? source_rect.top : 0, y - 1));
const u16 y_next =
static_cast<u16>(std::min<int>(clamp_bottom ? source_rect.bottom : EFB_HEIGHT, y + 1));

// Get a scanline of YUV pixels in 4:4:4 format
for (int i = 1, x = left; x < right; i++, x++)
Expand Down
11 changes: 4 additions & 7 deletions Source/Core/VideoCommon/VideoCommon.h
Expand Up @@ -10,21 +10,18 @@
extern bool g_bRecordFifoData;

// These are accurate (disregarding AA modes).
enum
{
EFB_WIDTH = 640,
EFB_HEIGHT = 528,
};
constexpr u32 EFB_WIDTH = 640;
constexpr u32 EFB_HEIGHT = 528;

// Max XFB width is 720. You can only copy out 640 wide areas of efb to XFB
// so you need multiple copies to do the full width.
// The VI can do horizontal scaling (TODO: emulate).
const u32 MAX_XFB_WIDTH = 720;
constexpr u32 MAX_XFB_WIDTH = 720;

// Although EFB height is 528, 576-line XFB's can be created either with
// vertical scaling by the EFB copy operation or copying to multiple XFB's
// that are next to each other in memory (TODO: handle that situation).
const u32 MAX_XFB_HEIGHT = 576;
constexpr u32 MAX_XFB_HEIGHT = 576;

#ifdef _WIN32
#define PRIM_LOG(...) DEBUG_LOG(VIDEO, __VA_ARGS__)
Expand Down

0 comments on commit d2d8d7c

Please sign in to comment.