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.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "GPUState.h"
|
|
|
|
#include "GSRasterizer.h"
|
2009-02-19 13:13:20 +00:00
|
|
|
#include "GPUScanlineEnvironment.h"
|
2009-02-20 10:59:10 +00:00
|
|
|
#include "GPUSetupPrimCodeGenerator.h"
|
2009-02-19 13:13:20 +00:00
|
|
|
#include "GPUDrawScanlineCodeGenerator.h"
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-07-05 00:18:33 +00:00
|
|
|
class GPUDrawScanline : public IDrawScanline
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
|
|
|
GPUScanlineEnvironment m_env;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
2009-05-14 16:41:52 +00:00
|
|
|
class GPUSetupPrimMap : public GSCodeGeneratorFunctionMap<GPUSetupPrimCodeGenerator, uint32, SetupPrimStaticPtr>
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
2009-02-20 10:59:10 +00:00
|
|
|
GPUScanlineEnvironment& m_env;
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
public:
|
2009-02-20 10:59:10 +00:00
|
|
|
GPUSetupPrimMap(GPUScanlineEnvironment& env);
|
2009-05-14 16:41:52 +00:00
|
|
|
GPUSetupPrimCodeGenerator* Create(uint32 key, void* ptr, size_t maxsize);
|
2009-02-20 10:59:10 +00:00
|
|
|
} m_sp;
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
|
2009-05-14 16:41:52 +00:00
|
|
|
class GPUDrawScanlineMap : public GSCodeGeneratorFunctionMap<GPUDrawScanlineCodeGenerator, uint32, DrawScanlineStaticPtr>
|
2009-02-19 13:13:20 +00:00
|
|
|
{
|
|
|
|
GPUScanlineEnvironment& m_env;
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-02-19 13:13:20 +00:00
|
|
|
public:
|
|
|
|
GPUDrawScanlineMap(GPUScanlineEnvironment& env);
|
2009-05-14 16:41:52 +00:00
|
|
|
GPUDrawScanlineCodeGenerator* Create(uint32 key, void* ptr, size_t maxsize);
|
2009-02-19 13:13:20 +00:00
|
|
|
} m_ds;
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
GPUState* m_state;
|
|
|
|
int m_id;
|
|
|
|
|
|
|
|
public:
|
|
|
|
GPUDrawScanline(GPUState* state, int id);
|
|
|
|
virtual ~GPUDrawScanline();
|
|
|
|
|
|
|
|
// IDrawScanline
|
|
|
|
|
|
|
|
void BeginDraw(const GSRasterizerData* data, Functions* f);
|
2009-02-20 10:59:10 +00:00
|
|
|
void EndDraw(const GSRasterizerStats& stats);
|
|
|
|
void PrintStats() {m_ds.PrintStats();}
|
2009-02-09 21:15:56 +00:00
|
|
|
};
|