pcsx2/plugins/GSdx/GSScanlineEnvironment.h

146 lines
3.1 KiB
C

/*
* 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 "GSLocalMemory.h"
#include "GSVector.h"
union GSScanlineSelector
{
struct
{
DWORD fpsm:2; // 0
DWORD zpsm:2; // 2
DWORD ztst:2; // 4 (0: off, 1: write, 2: test (ge), 3: test (g))
DWORD atst:3; // 6
DWORD afail:2; // 9
DWORD iip:1; // 11
DWORD tfx:3; // 12
DWORD tcc:1; // 15
DWORD fst:1; // 16
DWORD ltf:1; // 17
DWORD tlu:1; // 18
DWORD fge:1; // 19
DWORD date:1; // 20
DWORD abe:1; // 21
DWORD aba:2; // 22
DWORD abb:2; // 24
DWORD abc:2; // 26
DWORD abd:2; // 28
DWORD pabe:1; // 30
DWORD aa1:1; // 31
DWORD fwrite:1; // 32
DWORD ftest:1; // 33
DWORD rfb:1; // 34
DWORD zwrite:1; // 35
DWORD ztest:1; // 36
DWORD zoverflow:1; // 37 (z max >= 0x80000000)
DWORD wms:2; // 38
DWORD wmt:2; // 40
DWORD datm:1; // 42
DWORD colclamp:1; // 43
DWORD fba:1; // 44
DWORD dthe:1; // 45
DWORD sprite:1; // 46
DWORD edge:1; // 47
};
struct
{
DWORD _pad1:22;
DWORD ababcd:8;
DWORD _pad2:2;
DWORD fb:2;
DWORD _pad3:1;
DWORD zb:2;
};
struct
{
DWORD lo;
DWORD hi;
};
UINT64 key;
operator DWORD() {return lo;}
operator UINT64() {return key;}
bool IsSolidRect()
{
return sprite
&& iip == 0
&& tfx == TFX_NONE
&& abe == 0
&& ztst <= 1
&& atst <= 1
&& date == 0
&& fge == 0;
}
};
__declspec(align(16)) struct GSScanlineParam
{
GSScanlineSelector sel;
void* vm;
const void* tex;
const DWORD* clut;
DWORD tw;
GSLocalMemory::Offset* fbo;
GSLocalMemory::Offset* zbo;
GSLocalMemory::Offset4* fzbo;
DWORD fm, zm;
};
__declspec(align(16)) struct GSScanlineEnvironment
{
void* vm;
const void* tex;
const DWORD* clut;
DWORD tw;
GSVector4i* fbr;
GSVector4i* zbr;
int** fbc;
int** zbc;
GSVector2i* fzbr;
GSVector2i* fzbc;
GSVector4i* dimx;
GSVector4i fm, zm;
struct {GSVector4i min, max, mask, invmask;} t; // [u] x 4 [v] x 4
GSVector4i aref;
GSVector4i afix;
GSVector4i frb, fga;
struct {GSVector4 z, s, t, q; GSVector4i rb, ga, f, si, ti, _pad[7];} d[4];
struct {GSVector4 z, stq; GSVector4i c, f, st;} d4;
struct {GSVector4i rb, ga;} c;
struct {GSVector4i z, f;} p;
struct {GSVector4i z, f, s, t, q, rb, ga, zs, zd, uf, vf, cov;} temp;
};