mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
VideoCommon: Rename Renderer to EFBInterface.
This commit is contained in:
@ -4,8 +4,6 @@ add_library(videosoftware
|
||||
CopyRegion.h
|
||||
EfbCopy.cpp
|
||||
EfbCopy.h
|
||||
EfbInterface.cpp
|
||||
EfbInterface.h
|
||||
NativeVertexFormat.h
|
||||
Rasterizer.cpp
|
||||
Rasterizer.h
|
||||
@ -14,12 +12,12 @@ add_library(videosoftware
|
||||
SWmain.cpp
|
||||
SWBoundingBox.cpp
|
||||
SWBoundingBox.h
|
||||
SWEfbInterface.cpp
|
||||
SWEfbInterface.h
|
||||
SWGfx.cpp
|
||||
SWGfx.h
|
||||
SWOGLWindow.cpp
|
||||
SWOGLWindow.h
|
||||
SWRenderer.cpp
|
||||
SWRenderer.h
|
||||
SWTexture.cpp
|
||||
SWTexture.h
|
||||
SWVertexLoader.cpp
|
||||
|
@ -6,13 +6,9 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "VideoBackends/Software/EfbInterface.h"
|
||||
#include "VideoBackends/Software/TextureEncoder.h"
|
||||
#include "VideoBackends/Software/SWEfbInterface.h"
|
||||
|
||||
#include "VideoCommon/BPMemory.h"
|
||||
#include "VideoCommon/Fifo.h"
|
||||
#include "VideoCommon/VideoCommon.h"
|
||||
|
||||
namespace EfbCopy
|
||||
|
@ -10,16 +10,14 @@
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
#include "VideoBackends/Software/EfbInterface.h"
|
||||
#include "VideoBackends/Software/NativeVertexFormat.h"
|
||||
#include "VideoBackends/Software/SWEfbInterface.h"
|
||||
#include "VideoBackends/Software/Tev.h"
|
||||
#include "VideoCommon/BPFunctions.h"
|
||||
#include "VideoCommon/BPMemory.h"
|
||||
#include "VideoCommon/PerfQueryBase.h"
|
||||
#include "VideoCommon/Statistics.h"
|
||||
#include "VideoCommon/VideoCommon.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
#include "VideoCommon/XFMemory.h"
|
||||
|
||||
namespace Rasterizer
|
||||
{
|
||||
|
@ -1,11 +1,10 @@
|
||||
// Copyright 2009 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "VideoBackends/Software/EfbInterface.h"
|
||||
#include "VideoBackends/Software/SWEfbInterface.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
|
||||
@ -717,3 +716,35 @@ void IncPerfCounterQuadCount(PerfQueryType type)
|
||||
++perf_values[type];
|
||||
}
|
||||
} // namespace EfbInterface
|
||||
|
||||
namespace SW
|
||||
{
|
||||
|
||||
void SWEFBInterface::ReinterpretPixelData(EFBReinterpretType convtype)
|
||||
{
|
||||
}
|
||||
|
||||
void SWEFBInterface::PokeColor(u16 x, u16 y, u32 color)
|
||||
{
|
||||
}
|
||||
|
||||
void SWEFBInterface::PokeDepth(u16 x, u16 y, u32 depth)
|
||||
{
|
||||
}
|
||||
|
||||
u32 SWEFBInterface::PeekColorInternal(u16 x, u16 y)
|
||||
{
|
||||
const u32 color = EfbInterface::GetColor(x, y);
|
||||
|
||||
// rgba to argb
|
||||
u32 value = (color >> 8) | (color & 0xff) << 24;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
u32 SWEFBInterface::PeekDepth(u16 x, u16 y)
|
||||
{
|
||||
return EfbInterface::GetDepth(x, y);
|
||||
}
|
||||
|
||||
} // namespace SW
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/MathUtil.h"
|
||||
#include "VideoCommon/EFBInterface.h"
|
||||
#include "VideoCommon/PerfQueryBase.h"
|
||||
|
||||
namespace EfbInterface
|
||||
@ -48,9 +49,6 @@ bool ZCompare(u16 x, u16 y, u32 z);
|
||||
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,
|
||||
@ -60,3 +58,17 @@ u32 GetPerfQueryResult(PerfQueryType type);
|
||||
void ResetPerfQuery();
|
||||
void IncPerfCounterQuadCount(PerfQueryType type);
|
||||
} // namespace EfbInterface
|
||||
|
||||
namespace SW
|
||||
{
|
||||
class SWEFBInterface final : public EFBInterfaceBase
|
||||
{
|
||||
void ReinterpretPixelData(EFBReinterpretType convtype) override;
|
||||
|
||||
void PokeColor(u16 x, u16 y, u32 color) override;
|
||||
void PokeDepth(u16 x, u16 y, u32 depth) override;
|
||||
|
||||
u32 PeekColorInternal(u16 x, u16 y) override;
|
||||
u32 PeekDepth(u16 x, u16 y) override;
|
||||
};
|
||||
} // namespace SW
|
@ -1,69 +0,0 @@
|
||||
// Copyright 2009 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "VideoBackends/Software/SWRenderer.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "VideoBackends/Software/EfbInterface.h"
|
||||
|
||||
#include "VideoCommon/PixelEngine.h"
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
|
||||
namespace SW
|
||||
{
|
||||
u32 SWRenderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData)
|
||||
{
|
||||
u32 value = 0;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case EFBAccessType::PeekZ:
|
||||
{
|
||||
value = EfbInterface::GetDepth(x, y);
|
||||
break;
|
||||
}
|
||||
case EFBAccessType::PeekColor:
|
||||
{
|
||||
const u32 color = EfbInterface::GetColor(x, y);
|
||||
|
||||
// rgba to argb
|
||||
value = (color >> 8) | (color & 0xff) << 24;
|
||||
|
||||
// check what to do with the alpha channel (GX_PokeAlphaRead)
|
||||
PixelEngine::AlphaReadMode alpha_read_mode =
|
||||
Core::System::GetInstance().GetPixelEngine().GetAlphaReadMode();
|
||||
|
||||
if (alpha_read_mode == PixelEngine::AlphaReadMode::ReadNone)
|
||||
{
|
||||
// value is OK as it is
|
||||
}
|
||||
else if (alpha_read_mode == PixelEngine::AlphaReadMode::ReadFF)
|
||||
{
|
||||
value |= 0xFF000000;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (alpha_read_mode != PixelEngine::AlphaReadMode::Read00)
|
||||
{
|
||||
PanicAlertFmt("Invalid PE alpha read mode: {}", static_cast<u16>(alpha_read_mode));
|
||||
}
|
||||
value &= 0x00FFFFFF;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
} // namespace SW
|
@ -1,20 +0,0 @@
|
||||
// Copyright 2008 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
#include "VideoCommon/RenderBase.h"
|
||||
|
||||
namespace SW
|
||||
{
|
||||
class SWRenderer final : public Renderer
|
||||
{
|
||||
public:
|
||||
u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override;
|
||||
void PokeEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override {}
|
||||
|
||||
void ReinterpretPixelData(EFBReinterpretType convtype) override {}
|
||||
};
|
||||
} // namespace SW
|
@ -14,7 +14,6 @@
|
||||
|
||||
#include "VideoBackends/Software/NativeVertexFormat.h"
|
||||
#include "VideoBackends/Software/Rasterizer.h"
|
||||
#include "VideoBackends/Software/SWRenderer.h"
|
||||
#include "VideoBackends/Software/Tev.h"
|
||||
#include "VideoBackends/Software/TransformUnit.h"
|
||||
|
||||
|
@ -10,23 +10,16 @@
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/GL/GLContext.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
|
||||
#include "VideoBackends/Software/Clipper.h"
|
||||
#include "VideoBackends/Software/EfbInterface.h"
|
||||
#include "VideoBackends/Software/Rasterizer.h"
|
||||
#include "VideoBackends/Software/SWBoundingBox.h"
|
||||
#include "VideoBackends/Software/SWEfbInterface.h"
|
||||
#include "VideoBackends/Software/SWGfx.h"
|
||||
#include "VideoBackends/Software/SWOGLWindow.h"
|
||||
#include "VideoBackends/Software/SWRenderer.h"
|
||||
#include "VideoBackends/Software/SWTexture.h"
|
||||
#include "VideoBackends/Software/SWVertexLoader.h"
|
||||
#include "VideoBackends/Software/TextureCache.h"
|
||||
|
||||
#include "VideoCommon/FramebufferManager.h"
|
||||
#include "VideoCommon/Present.h"
|
||||
#include "VideoCommon/TextureCacheBase.h"
|
||||
#include "VideoCommon/VideoCommon.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
@ -108,7 +101,7 @@ bool VideoSoftware::Initialize(const WindowSystemInfo& wsi)
|
||||
|
||||
return InitializeShared(std::make_unique<SWGfx>(std::move(window)),
|
||||
std::make_unique<SWVertexLoader>(), std::make_unique<PerfQuery>(),
|
||||
std::make_unique<SWBoundingBox>(), std::make_unique<SWRenderer>(),
|
||||
std::make_unique<SWBoundingBox>(), std::make_unique<SWEFBInterface>(),
|
||||
std::make_unique<TextureCache>());
|
||||
}
|
||||
|
||||
|
@ -7,20 +7,18 @@
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "VideoBackends/Software/EfbInterface.h"
|
||||
#include "VideoBackends/Software/SWBoundingBox.h"
|
||||
#include "VideoBackends/Software/SWEfbInterface.h"
|
||||
#include "VideoBackends/Software/TextureSampler.h"
|
||||
|
||||
#include "VideoCommon/PerfQueryBase.h"
|
||||
#include "VideoCommon/PixelShaderManager.h"
|
||||
#include "VideoCommon/Statistics.h"
|
||||
#include "VideoCommon/VideoCommon.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
#include "VideoCommon/XFMemory.h"
|
||||
|
||||
static inline s16 Clamp255(s16 in)
|
||||
|
@ -5,12 +5,11 @@
|
||||
|
||||
#include "Common/Align.h"
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/CommonFuncs.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/Swap.h"
|
||||
|
||||
#include "VideoBackends/Software/EfbInterface.h"
|
||||
#include "VideoBackends/Software/SWEfbInterface.h"
|
||||
#include "VideoBackends/Software/SWTexture.h"
|
||||
|
||||
#include "VideoCommon/BPMemory.h"
|
||||
|
Reference in New Issue
Block a user