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"
|
|
|
|
|
2012-01-15 17:25:49 +00:00
|
|
|
class GSRendererOGL : 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;
|
2015-07-19 07:34:32 +00:00
|
|
|
int m_sw_blending;
|
2015-08-07 07:44:42 +00:00
|
|
|
PRIM_OVERLAP m_prim_overlap;
|
2015-12-31 22:58:03 +00:00
|
|
|
bool m_unsafe_fbmask;
|
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;
|
2015-12-31 22:58:03 +00:00
|
|
|
bool UserHacks_unsafe_fbmask;
|
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);
|
|
|
|
|
2011-11-16 22:17:37 +00:00
|
|
|
protected:
|
2013-05-27 16:53:38 +00:00
|
|
|
void EmulateGS();
|
2012-02-11 10:22:02 +00:00
|
|
|
void SetupIA();
|
2015-08-07 07:44:42 +00:00
|
|
|
bool EmulateTextureShuffleAndFbmask(GSDeviceOGL::PSSelector& ps_sel, GSDeviceOGL::OMColorMaskSelector& om_csel);
|
|
|
|
bool EmulateBlending(GSDeviceOGL::PSSelector& ps_sel, bool DATE_GL42);
|
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
|
|
|
|
2012-01-15 17:25:49 +00:00
|
|
|
void DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* tex);
|
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
|
|
|
|
|
|
|
void SendDraw(bool require_barrier);
|
2011-11-16 22:17:37 +00:00
|
|
|
};
|