2011-11-16 22:17:37 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011-2011 Gregory hainaut
|
|
|
|
* Copyright (C) 2007-2009 Gabest
|
|
|
|
*
|
|
|
|
* This Program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This Program 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 GNU Make; see the file COPYING. If not, write to
|
2012-09-09 18:16:11 +00:00
|
|
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA USA.
|
2011-11-16 22:17:37 +00:00
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-11-16 18:41:37 +00:00
|
|
|
#include "Renderers/HW/GSRendererHW.h"
|
2011-11-16 22:17:37 +00:00
|
|
|
#include "GSTextureCacheOGL.h"
|
2018-11-16 18:41:37 +00:00
|
|
|
#include "Renderers/HW/GSVertexHW.h"
|
2011-11-16 22:17:37 +00:00
|
|
|
|
2016-04-04 22:01:43 +00:00
|
|
|
class GSRendererOGL final : public GSRendererHW
|
2011-11-16 22:17:37 +00:00
|
|
|
{
|
2015-07-11 11:48:50 +00:00
|
|
|
enum PRIM_OVERLAP {
|
|
|
|
PRIM_OVERLAP_UNKNOW,
|
|
|
|
PRIM_OVERLAP_YES,
|
|
|
|
PRIM_OVERLAP_NO
|
|
|
|
};
|
|
|
|
|
2018-11-27 08:31:24 +00:00
|
|
|
enum ACC_DATE {
|
|
|
|
ACC_DATE_NONE = 0,
|
|
|
|
ACC_DATE_FAST = 1,
|
|
|
|
ACC_DATE_FULL = 2
|
|
|
|
};
|
|
|
|
|
2015-07-19 07:34:32 +00:00
|
|
|
enum ACC_BLEND {
|
2020-03-02 17:27:18 +00:00
|
|
|
ACC_BLEND_NONE = 0,
|
|
|
|
ACC_BLEND_BASIC = 1,
|
|
|
|
ACC_BLEND_MEDIUM = 2,
|
|
|
|
ACC_BLEND_HIGH = 3,
|
|
|
|
ACC_BLEND_FULL = 4,
|
|
|
|
ACC_BLEND_ULTRA = 5
|
2015-07-19 07:34:32 +00:00
|
|
|
};
|
|
|
|
|
2011-11-16 22:17:37 +00:00
|
|
|
private:
|
2016-04-10 11:48:05 +00:00
|
|
|
PRIM_OVERLAP m_prim_overlap;
|
2017-05-26 15:57:49 +00:00
|
|
|
std::vector<size_t> m_drawlist;
|
2015-05-08 08:40:43 +00:00
|
|
|
|
2017-02-24 16:55:39 +00:00
|
|
|
TriFiltering UserHacks_tri_filter;
|
2011-11-16 22:17:37 +00:00
|
|
|
|
2015-08-07 07:44:42 +00:00
|
|
|
GSDeviceOGL::VSConstantBuffer vs_cb;
|
|
|
|
GSDeviceOGL::PSConstantBuffer ps_cb;
|
2015-07-24 20:06:35 +00:00
|
|
|
|
2016-06-07 16:42:58 +00:00
|
|
|
bool m_require_one_barrier;
|
|
|
|
bool m_require_full_barrier;
|
|
|
|
|
2016-06-07 17:08:54 +00:00
|
|
|
GSDeviceOGL::VSSelector m_vs_sel;
|
|
|
|
GSDeviceOGL::GSSelector m_gs_sel;
|
|
|
|
GSDeviceOGL::PSSelector m_ps_sel;
|
|
|
|
|
2018-11-13 00:25:15 +00:00
|
|
|
GSDeviceOGL::PSSamplerSelector m_ps_ssel;
|
|
|
|
GSDeviceOGL::OMColorMaskSelector m_om_csel;
|
2016-06-07 17:08:54 +00:00
|
|
|
GSDeviceOGL::OMDepthStencilSelector m_om_dssel;
|
|
|
|
|
2016-04-04 20:48:10 +00:00
|
|
|
private:
|
2016-06-07 17:08:54 +00:00
|
|
|
inline void ResetStates();
|
2016-08-31 07:22:35 +00:00
|
|
|
inline void SetupIA(const float& sx, const float& sy);
|
2016-06-07 17:08:54 +00:00
|
|
|
inline void EmulateTextureShuffleAndFbmask();
|
|
|
|
inline void EmulateChannelShuffle(GSTexture** rt, const GSTextureCache::Source* tex);
|
|
|
|
inline void EmulateBlending(bool DATE_GL42);
|
|
|
|
inline void EmulateTextureSampler(const GSTextureCache::Source* tex);
|
2016-06-10 19:16:39 +00:00
|
|
|
inline void EmulateAtst(const int pass, const GSTextureCache::Source* tex);
|
2016-08-11 19:14:58 +00:00
|
|
|
inline void EmulateZbuffer();
|
2012-01-15 17:25:49 +00:00
|
|
|
|
2011-11-16 22:17:37 +00:00
|
|
|
public:
|
|
|
|
GSRendererOGL();
|
2011-12-19 21:03:23 +00:00
|
|
|
virtual ~GSRendererOGL() {};
|
2011-11-16 22:17:37 +00:00
|
|
|
|
|
|
|
bool CreateDevice(GSDevice* dev);
|
2011-12-19 21:03:23 +00:00
|
|
|
|
2016-04-04 20:48:10 +00:00
|
|
|
void DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* tex) final;
|
2015-04-24 18:53:59 +00:00
|
|
|
|
2015-07-11 11:48:50 +00:00
|
|
|
PRIM_OVERLAP PrimitiveOverlap();
|
2015-05-09 13:01:39 +00:00
|
|
|
|
2016-06-07 16:42:58 +00:00
|
|
|
void SendDraw();
|
2019-04-10 10:21:21 +00:00
|
|
|
|
|
|
|
bool IsDummyTexture() const final;
|
2011-11-16 22:17:37 +00:00
|
|
|
};
|