/* * 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 "GSRenderer.h" #include "GSDevice11.h" class GSRendererCS : public GSRenderer { struct VSSelector { union { struct { uint32 tme:1; uint32 fst:1; }; uint32 key; }; operator uint32() {return key & 0x3;} VSSelector() : key(0) {} }; __aligned(struct, 32) VSConstantBuffer { GSVector4 VertexScale; GSVector4 VertexOffset; }; struct GSSelector { union { struct { uint32 iip:1; uint32 prim:2; }; uint32 key; }; operator uint32() {return key & 0x7;} GSSelector() : key(0) {} }; struct PSSelector { union { struct { uint32 TODO:1; }; uint32 key; }; operator uint32() {return key & 0x1;} PSSelector() : key(0) {} }; __aligned(struct, 32) PSConstantBuffer { GSVector4 TODO; }; CComPtr m_dss; CComPtr m_bs; CComPtr m_ss; CComPtr m_vm; //CComPtr m_vm; CComPtr m_vm_uav; uint32 m_vm_valid[16]; CComPtr m_pb; //CComPtr m_pb; hash_map m_vs; CComPtr m_vs_cb; hash_map > m_gs; hash_map > m_ps; CComPtr m_ps_cb; CComPtr m_sob; void Write(GSOffset* o, const GSVector4i& r); void Read(GSOffset* o, const GSVector4i& r, bool invalidate); struct OffsetBuffer { CComPtr row, col; CComPtr row_view, col_view; }; hash_map m_offset; bool GetOffsetBuffer(OffsetBuffer** fzbo); protected: bool CreateDevice(GSDevice* dev); void VSync(int field); GSTexture* GetOutput(int i); void Draw(); void InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r); void InvalidateLocalMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r, bool clut); public: GSRendererCS(); virtual ~GSRendererCS(); };