GS: Merge GSRendererNew and GSRendererHW

This commit is contained in:
Connor McLaughlin 2022-04-26 19:55:46 +10:00 committed by refractionpcsx2
parent cc5142000b
commit 14ce344a3f
10 changed files with 1874 additions and 1948 deletions

View File

@ -686,7 +686,6 @@ set(pcsx2GSSources
GS/Renderers/Null/GSTextureNull.cpp
GS/Renderers/HW/GSHwHack.cpp
GS/Renderers/HW/GSRendererHW.cpp
GS/Renderers/HW/GSRendererNew.cpp
GS/Renderers/HW/GSTextureCache.cpp
GS/Renderers/HW/GSTextureReplacementLoaders.cpp
GS/Renderers/HW/GSTextureReplacements.cpp
@ -748,7 +747,6 @@ set(pcsx2GSHeaders
GS/Renderers/Null/GSRendererNull.h
GS/Renderers/Null/GSTextureNull.h
GS/Renderers/HW/GSRendererHW.h
GS/Renderers/HW/GSRendererNew.h
GS/Renderers/HW/GSTextureCache.h
GS/Renderers/HW/GSTextureReplacements.h
GS/Renderers/HW/GSVertexHW.h

View File

@ -25,7 +25,7 @@
#include "Renderers/SW/GSRendererSW.h"
#include "Renderers/Null/GSRendererNull.h"
#include "Renderers/Null/GSDeviceNull.h"
#include "Renderers/HW/GSRendererNew.h"
#include "Renderers/HW/GSRendererHW.h"
#include "Renderers/HW/GSTextureReplacements.h"
#include "GSLzma.h"
@ -260,7 +260,7 @@ static bool DoGSOpen(GSRendererType renderer, u8* basemem)
}
else if (renderer != GSRendererType::SW)
{
g_gs_renderer = std::make_unique<GSRendererNew>();
g_gs_renderer = std::make_unique<GSRendererHW>();
}
else
{

File diff suppressed because it is too large Load Diff

View File

@ -132,24 +132,33 @@ private:
template <bool linear>
void RoundSpriteOffset();
protected:
void DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* tex);
void ResetStates();
void SetupIA(const float& sx, const float& sy);
void EmulateTextureShuffleAndFbmask();
void EmulateChannelShuffle(const GSTextureCache::Source* tex);
void EmulateBlending(bool& DATE_PRIMID, bool& DATE_BARRIER, bool& blending_alpha_pass);
void EmulateTextureSampler(const GSTextureCache::Source* tex);
void EmulateZbuffer();
void EmulateATST(float& AREF, GSHWDrawConfig::PSSelector& ps, bool pass_2);
void SetTCOffset();
GSTextureCache* m_tc;
GSVector4i m_r;
GSTextureCache::Source* m_src;
virtual void DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* tex) = 0;
void SetTCOffset();
bool m_reset;
bool m_channel_shuffle;
bool m_userhacks_tcoffset;
float m_userhacks_tcoffset_x;
float m_userhacks_tcoffset_y;
bool m_channel_shuffle;
bool m_reset;
GSVector2i m_lod; // Min & Max level of detail
GSHWDrawConfig m_conf;
public:
GSRendererHW();
virtual ~GSRendererHW() override;
@ -186,7 +195,7 @@ public:
void PurgeTextureCache() override;
// Called by the texture cache to know if current texture is useful
virtual bool IsDummyTexture() const { return false; }
bool IsDummyTexture() const;
// Called by the texture cache when optimizing the copy range for sources
bool IsPossibleTextureShuffle(GSTextureCache::Source* src) const;

File diff suppressed because it is too large Load Diff

View File

@ -1,43 +0,0 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "GS/Renderers/HW/GSRendererHW.h"
#include "GS/Renderers/HW/GSVertexHW.h"
class GSRendererNew final : public GSRendererHW
{
private:
GSHWDrawConfig m_conf;
private:
inline void ResetStates();
inline void SetupIA(const float& sx, const float& sy);
inline void EmulateTextureShuffleAndFbmask();
inline void EmulateChannelShuffle(const GSTextureCache::Source* tex);
inline void EmulateBlending(bool& DATE_PRIMID, bool& DATE_BARRIER, bool& blending_alpha_pass);
inline void EmulateTextureSampler(const GSTextureCache::Source* tex);
inline void EmulateZbuffer();
inline void EmulateATST(float& AREF, GSHWDrawConfig::PSSelector& ps, bool pass_2);
public:
GSRendererNew();
~GSRendererNew() override {}
void DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* tex) override;
bool IsDummyTexture() const override;
};

View File

@ -520,7 +520,6 @@
<ClCompile Include="GS\Renderers\SW\GSRasterizer.cpp" />
<ClCompile Include="GS\Renderers\Common\GSRenderer.cpp" />
<ClCompile Include="GS\Renderers\HW\GSRendererHW.cpp" />
<ClCompile Include="GS\Renderers\HW\GSRendererNew.cpp" />
<ClCompile Include="GS\Renderers\Null\GSRendererNull.cpp" />
<ClCompile Include="GS\Renderers\SW\GSRendererSW.cpp" />
<ClCompile Include="GS\Window\GSSetting.cpp" />
@ -904,7 +903,6 @@
<ClInclude Include="GS\Renderers\SW\GSRasterizer.h" />
<ClInclude Include="GS\Renderers\Common\GSRenderer.h" />
<ClInclude Include="GS\Renderers\HW\GSRendererHW.h" />
<ClInclude Include="GS\Renderers\HW\GSRendererNew.h" />
<ClInclude Include="GS\Renderers\Null\GSRendererNull.h" />
<ClInclude Include="GS\Renderers\SW\GSRendererSW.h" />
<ClInclude Include="GS\Renderers\SW\GSScanlineEnvironment.h" />

View File

@ -1634,9 +1634,6 @@
<ClCompile Include="GS\Renderers\HW\GSRendererHW.cpp">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClCompile>
<ClCompile Include="GS\Renderers\HW\GSRendererNew.cpp">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClCompile>
<ClCompile Include="GS\Renderers\HW\GSTextureCache.cpp">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClCompile>
@ -2815,9 +2812,6 @@
<ClInclude Include="GS\Renderers\HW\GSRendererHW.h">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClInclude>
<ClInclude Include="GS\Renderers\HW\GSRendererNew.h">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClInclude>
<ClInclude Include="GS\Renderers\HW\GSTextureCache.h">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClInclude>
@ -3119,4 +3113,4 @@
<Filter>AppHost\Resources</Filter>
</Manifest>
</ItemGroup>
</Project>
</Project>

View File

@ -288,7 +288,6 @@
<ClCompile Include="GS\Renderers\SW\GSRasterizer.cpp" />
<ClCompile Include="GS\Renderers\Common\GSRenderer.cpp" />
<ClCompile Include="GS\Renderers\HW\GSRendererHW.cpp" />
<ClCompile Include="GS\Renderers\HW\GSRendererNew.cpp" />
<ClCompile Include="GS\Renderers\Null\GSRendererNull.cpp" />
<ClCompile Include="GS\Renderers\SW\GSRendererSW.cpp" />
<ClCompile Include="GS\Window\GSSetting.cpp" />
@ -588,7 +587,6 @@
<ClInclude Include="GS\Renderers\SW\GSRasterizer.h" />
<ClInclude Include="GS\Renderers\Common\GSRenderer.h" />
<ClInclude Include="GS\Renderers\HW\GSRendererHW.h" />
<ClInclude Include="GS\Renderers\HW\GSRendererNew.h" />
<ClInclude Include="GS\Renderers\Null\GSRendererNull.h" />
<ClInclude Include="GS\Renderers\SW\GSRendererSW.h" />
<ClInclude Include="GS\Renderers\SW\GSScanlineEnvironment.h" />
@ -812,4 +810,4 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>

View File

@ -1097,9 +1097,6 @@
<ClCompile Include="GS\Renderers\HW\GSRendererHW.cpp">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClCompile>
<ClCompile Include="GS\Renderers\HW\GSRendererNew.cpp">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClCompile>
<ClCompile Include="GS\Renderers\HW\GSTextureCache.cpp">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClCompile>
@ -1931,9 +1928,6 @@
<ClInclude Include="GS\Renderers\HW\GSRendererHW.h">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClInclude>
<ClInclude Include="GS\Renderers\HW\GSRendererNew.h">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClInclude>
<ClInclude Include="GS\Renderers\HW\GSTextureCache.h">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClInclude>