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
|
2010-04-25 00:31:27 +00:00
|
|
|
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, 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
|
|
|
{
|
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
|
|
|
|
2011-02-16 03:19:36 +00:00
|
|
|
void DrawRect(const GSVector4i& r, const GSVertexSW& v);
|
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
|
|
|
|
|
2011-02-17 18:22:47 +00:00
|
|
|
void BeginDraw(const void* param);
|
2011-02-17 03:24:37 +00:00
|
|
|
void EndDraw(const GSRasterizerStats& stats, uint64 frame);
|
2011-02-16 03:19:36 +00:00
|
|
|
void PrintStats() {m_ds_map.PrintStats();}
|
2009-02-09 21:15:56 +00:00
|
|
|
};
|