2010-04-25 00:31:27 +00:00
|
|
|
/*
|
2009-02-09 21:15:56 +00:00
|
|
|
* Copyright (C) 2007-2009 Gabest
|
|
|
|
* http://www.gabest.org
|
|
|
|
*
|
|
|
|
* 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.
|
2010-04-25 00:31:27 +00:00
|
|
|
*
|
2009-02-09 21:15:56 +00:00
|
|
|
* 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.
|
2010-04-25 00:31:27 +00:00
|
|
|
*
|
2009-02-09 21:15:56 +00:00
|
|
|
* 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.
|
2009-02-09 21:15:56 +00:00
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "GSState.h"
|
|
|
|
#include "GSRasterizer.h"
|
2009-02-11 07:05:44 +00:00
|
|
|
#include "GSScanlineEnvironment.h"
|
2009-02-13 09:28:51 +00:00
|
|
|
#include "GSSetupPrimCodeGenerator.h"
|
2009-02-11 07:05:44 +00:00
|
|
|
#include "GSDrawScanlineCodeGenerator.h"
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-07-05 00:18:33 +00:00
|
|
|
class GSDrawScanline : public IDrawScanline
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
2012-01-08 17:10:00 +00:00
|
|
|
public:
|
|
|
|
class SharedData : public GSRasterizerData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GSScanlineGlobalData global;
|
|
|
|
};
|
|
|
|
|
|
|
|
protected:
|
2011-02-17 18:22:47 +00:00
|
|
|
GSScanlineGlobalData m_global;
|
2011-02-17 03:24:37 +00:00
|
|
|
GSScanlineLocalData m_local;
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2011-02-16 03:19:36 +00:00
|
|
|
GSCodeGeneratorFunctionMap<GSSetupPrimCodeGenerator, uint64, SetupPrimPtr> m_sp_map;
|
|
|
|
GSCodeGeneratorFunctionMap<GSDrawScanlineCodeGenerator, uint64, DrawScanlinePtr> m_ds_map;
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2010-04-25 00:31:27 +00:00
|
|
|
template<class T, bool masked>
|
2011-02-16 03:19:36 +00:00
|
|
|
void DrawRectT(const int* RESTRICT row, const int* RESTRICT col, const GSVector4i& r, uint32 c, uint32 m);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2010-04-25 00:31:27 +00:00
|
|
|
template<class T, bool masked>
|
2009-07-06 16:35:06 +00:00
|
|
|
__forceinline void FillRect(const int* RESTRICT row, const int* RESTRICT col, const GSVector4i& r, uint32 c, uint32 m);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2010-04-25 00:31:27 +00:00
|
|
|
template<class T, bool masked>
|
2009-07-06 16:35:06 +00:00
|
|
|
__forceinline void FillBlock(const int* RESTRICT row, const int* RESTRICT col, const GSVector4i& r, const GSVector4i& c, const GSVector4i& m);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
public:
|
2011-02-17 18:22:47 +00:00
|
|
|
GSDrawScanline();
|
2009-02-09 21:15:56 +00:00
|
|
|
virtual ~GSDrawScanline();
|
|
|
|
|
|
|
|
// IDrawScanline
|
|
|
|
|
2012-01-08 17:10:00 +00:00
|
|
|
void BeginDraw(const GSRasterizerData* data);
|
2011-12-18 08:13:20 +00:00
|
|
|
void EndDraw(uint64 frame, uint64 ticks, int pixels);
|
2011-11-25 23:48:59 +00:00
|
|
|
|
|
|
|
void DrawRect(const GSVector4i& r, const GSVertexSW& v);
|
|
|
|
|
2011-12-16 19:13:58 +00:00
|
|
|
#ifndef ENABLE_JIT_RASTERIZER
|
2011-11-25 23:48:59 +00:00
|
|
|
|
2012-01-09 08:41:33 +00:00
|
|
|
void SetupPrim(const GSVertexSW* vertex, const uint32* index, const GSVertexSW& dscan);
|
2011-11-25 23:48:59 +00:00
|
|
|
void DrawScanline(int pixels, int left, int top, const GSVertexSW& scan);
|
|
|
|
void DrawEdge(int pixels, int left, int top, const GSVertexSW& scan);
|
|
|
|
|
|
|
|
bool IsEdge() const {return m_global.sel.aa1;}
|
|
|
|
bool IsRect() const {return m_global.sel.IsSolidRect();}
|
|
|
|
|
|
|
|
bool TestAlpha(GSVector4i& test, GSVector4i& fm, GSVector4i& zm, const GSVector4i& ga);
|
|
|
|
void WritePixel(const GSVector4i& src, int addr, int i, uint32 psm);
|
|
|
|
|
|
|
|
#endif
|
2009-02-09 21:15:56 +00:00
|
|
|
};
|