mirror of https://github.com/PCSX2/pcsx2.git
GS: Merge GSRendererNew and GSRendererHW
This commit is contained in:
parent
cc5142000b
commit
14ce344a3f
|
@ -686,7 +686,6 @@ set(pcsx2GSSources
|
||||||
GS/Renderers/Null/GSTextureNull.cpp
|
GS/Renderers/Null/GSTextureNull.cpp
|
||||||
GS/Renderers/HW/GSHwHack.cpp
|
GS/Renderers/HW/GSHwHack.cpp
|
||||||
GS/Renderers/HW/GSRendererHW.cpp
|
GS/Renderers/HW/GSRendererHW.cpp
|
||||||
GS/Renderers/HW/GSRendererNew.cpp
|
|
||||||
GS/Renderers/HW/GSTextureCache.cpp
|
GS/Renderers/HW/GSTextureCache.cpp
|
||||||
GS/Renderers/HW/GSTextureReplacementLoaders.cpp
|
GS/Renderers/HW/GSTextureReplacementLoaders.cpp
|
||||||
GS/Renderers/HW/GSTextureReplacements.cpp
|
GS/Renderers/HW/GSTextureReplacements.cpp
|
||||||
|
@ -748,7 +747,6 @@ set(pcsx2GSHeaders
|
||||||
GS/Renderers/Null/GSRendererNull.h
|
GS/Renderers/Null/GSRendererNull.h
|
||||||
GS/Renderers/Null/GSTextureNull.h
|
GS/Renderers/Null/GSTextureNull.h
|
||||||
GS/Renderers/HW/GSRendererHW.h
|
GS/Renderers/HW/GSRendererHW.h
|
||||||
GS/Renderers/HW/GSRendererNew.h
|
|
||||||
GS/Renderers/HW/GSTextureCache.h
|
GS/Renderers/HW/GSTextureCache.h
|
||||||
GS/Renderers/HW/GSTextureReplacements.h
|
GS/Renderers/HW/GSTextureReplacements.h
|
||||||
GS/Renderers/HW/GSVertexHW.h
|
GS/Renderers/HW/GSVertexHW.h
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "Renderers/SW/GSRendererSW.h"
|
#include "Renderers/SW/GSRendererSW.h"
|
||||||
#include "Renderers/Null/GSRendererNull.h"
|
#include "Renderers/Null/GSRendererNull.h"
|
||||||
#include "Renderers/Null/GSDeviceNull.h"
|
#include "Renderers/Null/GSDeviceNull.h"
|
||||||
#include "Renderers/HW/GSRendererNew.h"
|
#include "Renderers/HW/GSRendererHW.h"
|
||||||
#include "Renderers/HW/GSTextureReplacements.h"
|
#include "Renderers/HW/GSTextureReplacements.h"
|
||||||
#include "GSLzma.h"
|
#include "GSLzma.h"
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ static bool DoGSOpen(GSRendererType renderer, u8* basemem)
|
||||||
}
|
}
|
||||||
else if (renderer != GSRendererType::SW)
|
else if (renderer != GSRendererType::SW)
|
||||||
{
|
{
|
||||||
g_gs_renderer = std::make_unique<GSRendererNew>();
|
g_gs_renderer = std::make_unique<GSRendererHW>();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -132,24 +132,33 @@ private:
|
||||||
template <bool linear>
|
template <bool linear>
|
||||||
void RoundSpriteOffset();
|
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;
|
GSTextureCache* m_tc;
|
||||||
GSVector4i m_r;
|
GSVector4i m_r;
|
||||||
GSTextureCache::Source* m_src;
|
GSTextureCache::Source* m_src;
|
||||||
|
|
||||||
virtual void DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* tex) = 0;
|
bool m_reset;
|
||||||
|
bool m_channel_shuffle;
|
||||||
void SetTCOffset();
|
|
||||||
|
|
||||||
bool m_userhacks_tcoffset;
|
bool m_userhacks_tcoffset;
|
||||||
float m_userhacks_tcoffset_x;
|
float m_userhacks_tcoffset_x;
|
||||||
float m_userhacks_tcoffset_y;
|
float m_userhacks_tcoffset_y;
|
||||||
|
|
||||||
bool m_channel_shuffle;
|
|
||||||
bool m_reset;
|
|
||||||
|
|
||||||
GSVector2i m_lod; // Min & Max level of detail
|
GSVector2i m_lod; // Min & Max level of detail
|
||||||
|
|
||||||
|
GSHWDrawConfig m_conf;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GSRendererHW();
|
GSRendererHW();
|
||||||
virtual ~GSRendererHW() override;
|
virtual ~GSRendererHW() override;
|
||||||
|
@ -186,7 +195,7 @@ public:
|
||||||
void PurgeTextureCache() override;
|
void PurgeTextureCache() override;
|
||||||
|
|
||||||
// Called by the texture cache to know if current texture is useful
|
// 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
|
// Called by the texture cache when optimizing the copy range for sources
|
||||||
bool IsPossibleTextureShuffle(GSTextureCache::Source* src) const;
|
bool IsPossibleTextureShuffle(GSTextureCache::Source* src) const;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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;
|
|
||||||
};
|
|
|
@ -520,7 +520,6 @@
|
||||||
<ClCompile Include="GS\Renderers\SW\GSRasterizer.cpp" />
|
<ClCompile Include="GS\Renderers\SW\GSRasterizer.cpp" />
|
||||||
<ClCompile Include="GS\Renderers\Common\GSRenderer.cpp" />
|
<ClCompile Include="GS\Renderers\Common\GSRenderer.cpp" />
|
||||||
<ClCompile Include="GS\Renderers\HW\GSRendererHW.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\Null\GSRendererNull.cpp" />
|
||||||
<ClCompile Include="GS\Renderers\SW\GSRendererSW.cpp" />
|
<ClCompile Include="GS\Renderers\SW\GSRendererSW.cpp" />
|
||||||
<ClCompile Include="GS\Window\GSSetting.cpp" />
|
<ClCompile Include="GS\Window\GSSetting.cpp" />
|
||||||
|
@ -904,7 +903,6 @@
|
||||||
<ClInclude Include="GS\Renderers\SW\GSRasterizer.h" />
|
<ClInclude Include="GS\Renderers\SW\GSRasterizer.h" />
|
||||||
<ClInclude Include="GS\Renderers\Common\GSRenderer.h" />
|
<ClInclude Include="GS\Renderers\Common\GSRenderer.h" />
|
||||||
<ClInclude Include="GS\Renderers\HW\GSRendererHW.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\Null\GSRendererNull.h" />
|
||||||
<ClInclude Include="GS\Renderers\SW\GSRendererSW.h" />
|
<ClInclude Include="GS\Renderers\SW\GSRendererSW.h" />
|
||||||
<ClInclude Include="GS\Renderers\SW\GSScanlineEnvironment.h" />
|
<ClInclude Include="GS\Renderers\SW\GSScanlineEnvironment.h" />
|
||||||
|
|
|
@ -1634,9 +1634,6 @@
|
||||||
<ClCompile Include="GS\Renderers\HW\GSRendererHW.cpp">
|
<ClCompile Include="GS\Renderers\HW\GSRendererHW.cpp">
|
||||||
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="GS\Renderers\HW\GSRendererNew.cpp">
|
|
||||||
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="GS\Renderers\HW\GSTextureCache.cpp">
|
<ClCompile Include="GS\Renderers\HW\GSTextureCache.cpp">
|
||||||
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -2815,9 +2812,6 @@
|
||||||
<ClInclude Include="GS\Renderers\HW\GSRendererHW.h">
|
<ClInclude Include="GS\Renderers\HW\GSRendererHW.h">
|
||||||
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="GS\Renderers\HW\GSRendererNew.h">
|
|
||||||
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="GS\Renderers\HW\GSTextureCache.h">
|
<ClInclude Include="GS\Renderers\HW\GSTextureCache.h">
|
||||||
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
|
@ -288,7 +288,6 @@
|
||||||
<ClCompile Include="GS\Renderers\SW\GSRasterizer.cpp" />
|
<ClCompile Include="GS\Renderers\SW\GSRasterizer.cpp" />
|
||||||
<ClCompile Include="GS\Renderers\Common\GSRenderer.cpp" />
|
<ClCompile Include="GS\Renderers\Common\GSRenderer.cpp" />
|
||||||
<ClCompile Include="GS\Renderers\HW\GSRendererHW.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\Null\GSRendererNull.cpp" />
|
||||||
<ClCompile Include="GS\Renderers\SW\GSRendererSW.cpp" />
|
<ClCompile Include="GS\Renderers\SW\GSRendererSW.cpp" />
|
||||||
<ClCompile Include="GS\Window\GSSetting.cpp" />
|
<ClCompile Include="GS\Window\GSSetting.cpp" />
|
||||||
|
@ -588,7 +587,6 @@
|
||||||
<ClInclude Include="GS\Renderers\SW\GSRasterizer.h" />
|
<ClInclude Include="GS\Renderers\SW\GSRasterizer.h" />
|
||||||
<ClInclude Include="GS\Renderers\Common\GSRenderer.h" />
|
<ClInclude Include="GS\Renderers\Common\GSRenderer.h" />
|
||||||
<ClInclude Include="GS\Renderers\HW\GSRendererHW.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\Null\GSRendererNull.h" />
|
||||||
<ClInclude Include="GS\Renderers\SW\GSRendererSW.h" />
|
<ClInclude Include="GS\Renderers\SW\GSRendererSW.h" />
|
||||||
<ClInclude Include="GS\Renderers\SW\GSScanlineEnvironment.h" />
|
<ClInclude Include="GS\Renderers\SW\GSScanlineEnvironment.h" />
|
||||||
|
|
|
@ -1097,9 +1097,6 @@
|
||||||
<ClCompile Include="GS\Renderers\HW\GSRendererHW.cpp">
|
<ClCompile Include="GS\Renderers\HW\GSRendererHW.cpp">
|
||||||
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="GS\Renderers\HW\GSRendererNew.cpp">
|
|
||||||
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="GS\Renderers\HW\GSTextureCache.cpp">
|
<ClCompile Include="GS\Renderers\HW\GSTextureCache.cpp">
|
||||||
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -1931,9 +1928,6 @@
|
||||||
<ClInclude Include="GS\Renderers\HW\GSRendererHW.h">
|
<ClInclude Include="GS\Renderers\HW\GSRendererHW.h">
|
||||||
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="GS\Renderers\HW\GSRendererNew.h">
|
|
||||||
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="GS\Renderers\HW\GSTextureCache.h">
|
<ClInclude Include="GS\Renderers\HW\GSTextureCache.h">
|
||||||
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
Loading…
Reference in New Issue