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
|
|
|
|
|
|
|
|
#include "GSRendererHW.h"
|
|
|
|
|
|
|
|
#include "GSRenderer.h"
|
|
|
|
#include "GSTextureCacheOGL.h"
|
|
|
|
#include "GSVertexHW.h"
|
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2015-07-19 07:34:32 +00:00
|
|
|
enum ACC_BLEND {
|
|
|
|
ACC_BLEND_NONE = 0,
|
|
|
|
ACC_BLEND_FREE = 1,
|
2015-07-19 19:40:41 +00:00
|
|
|
ACC_BLEND_SPRITE = 2,
|
2015-07-25 16:20:00 +00:00
|
|
|
ACC_BLEND_CCLIP_DALPHA = 3,
|
2015-07-19 19:40:41 +00:00
|
|
|
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:
|
2015-05-08 08:40:43 +00:00
|
|
|
bool m_accurate_date;
|
2016-04-10 15:30:49 +00:00
|
|
|
int m_sw_blending;
|
2016-04-10 11:48:05 +00:00
|
|
|
PRIM_OVERLAP m_prim_overlap;
|
2016-01-11 17:56:08 +00:00
|
|
|
vector<size_t> m_drawlist;
|
2015-05-08 08:40:43 +00:00
|
|
|
|
2013-02-23 15:35:56 +00:00
|
|
|
unsigned int UserHacks_TCOffset;
|
|
|
|
float UserHacks_TCO_x, UserHacks_TCO_y;
|
2016-08-21 16:34:03 +00:00
|
|
|
bool UserHacks_unscale_pt_ln;
|
2016-06-21 07:51:47 +00:00
|
|
|
int UserHacks_HPO;
|
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-11 11:48:50 +00:00
|
|
|
|
2015-07-24 20:06:35 +00:00
|
|
|
GSVector4i ComputeBoundingBox(const GSVector2& rtscale, const GSVector2i& rtsize);
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
GSDeviceOGL::PSSamplerSelector m_ps_ssel;
|
|
|
|
GSDeviceOGL::OMColorMaskSelector m_om_csel;
|
|
|
|
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();
|
2011-11-16 22:17:37 +00:00
|
|
|
};
|