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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-02-19 03:36:30 +00:00
|
|
|
#include "stdafx.h"
|
2009-08-02 23:07:30 +00:00
|
|
|
#include "GSdx.h"
|
2009-02-09 21:15:56 +00:00
|
|
|
#include "GSDevice.h"
|
2009-05-22 01:22:52 +00:00
|
|
|
|
2010-04-25 00:31:27 +00:00
|
|
|
GSDevice::GSDevice()
|
2009-06-03 12:09:04 +00:00
|
|
|
: m_wnd(NULL)
|
2009-10-31 01:06:23 +00:00
|
|
|
, m_vsync(false)
|
2009-08-16 16:45:26 +00:00
|
|
|
, m_rbswapped(false)
|
2009-05-22 01:22:52 +00:00
|
|
|
, m_backbuffer(NULL)
|
|
|
|
, m_merge(NULL)
|
|
|
|
, m_weavebob(NULL)
|
|
|
|
, m_blend(NULL)
|
2014-01-17 10:17:24 +00:00
|
|
|
, m_shaderfx(NULL)
|
2011-07-25 11:16:01 +00:00
|
|
|
, m_fxaa(NULL)
|
2012-02-29 00:29:29 +00:00
|
|
|
, m_shadeboost(NULL)
|
2009-05-22 01:22:52 +00:00
|
|
|
, m_1x1(NULL)
|
2010-05-23 15:33:50 +00:00
|
|
|
, m_frame(0)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2012-01-05 02:40:24 +00:00
|
|
|
memset(&m_vertex, 0, sizeof(m_vertex));
|
|
|
|
memset(&m_index, 0, sizeof(m_index));
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
2010-04-25 00:31:27 +00:00
|
|
|
GSDevice::~GSDevice()
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2009-07-04 17:37:06 +00:00
|
|
|
for_each(m_pool.begin(), m_pool.end(), delete_object());
|
2010-05-23 17:26:37 +00:00
|
|
|
|
2009-07-04 17:37:06 +00:00
|
|
|
delete m_backbuffer;
|
2010-04-25 00:31:27 +00:00
|
|
|
delete m_merge;
|
2009-07-04 17:37:06 +00:00
|
|
|
delete m_weavebob;
|
|
|
|
delete m_blend;
|
2014-01-17 10:17:24 +00:00
|
|
|
delete m_shaderfx;
|
2011-07-25 11:16:01 +00:00
|
|
|
delete m_fxaa;
|
2012-02-29 00:29:29 +00:00
|
|
|
delete m_shadeboost;
|
2009-07-04 17:37:06 +00:00
|
|
|
delete m_1x1;
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
2009-10-31 01:06:23 +00:00
|
|
|
bool GSDevice::Create(GSWnd* wnd)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2009-06-03 12:09:04 +00:00
|
|
|
m_wnd = wnd;
|
2009-05-22 01:22:52 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2009-09-18 18:45:37 +00:00
|
|
|
bool GSDevice::Reset(int w, int h)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2009-07-04 17:37:06 +00:00
|
|
|
for_each(m_pool.begin(), m_pool.end(), delete_object());
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2009-05-22 01:22:52 +00:00
|
|
|
m_pool.clear();
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2009-05-22 01:22:52 +00:00
|
|
|
delete m_backbuffer;
|
2010-04-25 00:31:27 +00:00
|
|
|
delete m_merge;
|
2009-05-22 01:22:52 +00:00
|
|
|
delete m_weavebob;
|
|
|
|
delete m_blend;
|
2014-01-17 10:17:24 +00:00
|
|
|
delete m_shaderfx;
|
2011-07-25 11:16:01 +00:00
|
|
|
delete m_fxaa;
|
2012-02-29 00:29:29 +00:00
|
|
|
delete m_shadeboost;
|
2009-05-22 01:22:52 +00:00
|
|
|
delete m_1x1;
|
|
|
|
|
|
|
|
m_backbuffer = NULL;
|
|
|
|
m_merge = NULL;
|
|
|
|
m_weavebob = NULL;
|
|
|
|
m_blend = NULL;
|
2014-01-17 10:17:24 +00:00
|
|
|
m_shaderfx = NULL;
|
2011-07-25 11:16:01 +00:00
|
|
|
m_fxaa = NULL;
|
2012-02-29 00:29:29 +00:00
|
|
|
m_shadeboost = NULL;
|
2009-05-22 01:22:52 +00:00
|
|
|
m_1x1 = NULL;
|
|
|
|
|
|
|
|
m_current = NULL; // current is special, points to other textures, no need to delete
|
|
|
|
|
2009-09-17 07:40:38 +00:00
|
|
|
return m_wnd != NULL;
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
2009-10-31 01:06:23 +00:00
|
|
|
void GSDevice::Present(const GSVector4i& r, int shader)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2009-06-03 12:09:04 +00:00
|
|
|
GSVector4i cr = m_wnd->GetClientRect();
|
2009-05-22 01:22:52 +00:00
|
|
|
|
2009-07-24 09:24:09 +00:00
|
|
|
int w = std::max<int>(cr.width(), 1);
|
|
|
|
int h = std::max<int>(cr.height(), 1);
|
2009-07-04 11:43:05 +00:00
|
|
|
|
2009-08-02 23:07:30 +00:00
|
|
|
if(!m_backbuffer || m_backbuffer->GetWidth() != w || m_backbuffer->GetHeight() != h)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2009-09-18 18:45:37 +00:00
|
|
|
if(!Reset(w, h))
|
2009-07-04 15:14:04 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
2015-05-15 13:12:49 +00:00
|
|
|
GL_PUSH("Present");
|
|
|
|
|
2009-05-22 01:22:52 +00:00
|
|
|
ClearRenderTarget(m_backbuffer, 0);
|
|
|
|
|
|
|
|
if(m_current)
|
|
|
|
{
|
2014-01-12 19:47:49 +00:00
|
|
|
static int s_shader[5] = {0, 5, 6, 8, 9}; // FIXME
|
2009-05-22 23:23:38 +00:00
|
|
|
|
2011-02-22 09:43:59 +00:00
|
|
|
Present(m_current, m_backbuffer, GSVector4(r), s_shader[shader]);
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
2009-10-31 01:06:23 +00:00
|
|
|
Flip();
|
2015-05-15 13:12:49 +00:00
|
|
|
|
|
|
|
GL_POP();
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
2011-02-22 09:43:59 +00:00
|
|
|
void GSDevice::Present(GSTexture* st, GSTexture* dt, const GSVector4& dr, int shader)
|
|
|
|
{
|
|
|
|
StretchRect(st, dt, dr, shader);
|
|
|
|
}
|
|
|
|
|
2011-02-22 23:39:02 +00:00
|
|
|
GSTexture* GSDevice::FetchSurface(int type, int w, int h, bool msaa, int format)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
|
|
|
GSVector2i size(w, h);
|
|
|
|
|
|
|
|
for(list<GSTexture*>::iterator i = m_pool.begin(); i != m_pool.end(); i++)
|
|
|
|
{
|
|
|
|
GSTexture* t = *i;
|
|
|
|
|
2009-08-02 23:07:30 +00:00
|
|
|
if(t->GetType() == type && t->GetFormat() == format && t->GetSize() == size && t->IsMSAA() == msaa)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
|
|
|
m_pool.erase(i);
|
|
|
|
|
|
|
|
return t;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-22 23:39:02 +00:00
|
|
|
return CreateSurface(type, w, h, msaa, format);
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
2009-07-31 23:59:06 +00:00
|
|
|
void GSDevice::EndScene()
|
|
|
|
{
|
2012-01-05 02:40:24 +00:00
|
|
|
m_vertex.start += m_vertex.count;
|
|
|
|
m_vertex.count = 0;
|
|
|
|
m_index.start += m_index.count;
|
|
|
|
m_index.count = 0;
|
2009-07-31 23:59:06 +00:00
|
|
|
}
|
|
|
|
|
2009-05-22 01:22:52 +00:00
|
|
|
void GSDevice::Recycle(GSTexture* t)
|
|
|
|
{
|
|
|
|
if(t)
|
|
|
|
{
|
2015-04-30 17:38:30 +00:00
|
|
|
t->Invalidate();
|
2015-04-25 10:44:59 +00:00
|
|
|
|
2010-05-23 15:33:50 +00:00
|
|
|
t->last_frame_used = m_frame;
|
2011-02-07 01:59:05 +00:00
|
|
|
|
2009-05-22 01:22:52 +00:00
|
|
|
m_pool.push_front(t);
|
2011-02-19 03:36:30 +00:00
|
|
|
|
2009-11-01 11:42:12 +00:00
|
|
|
//printf("%d\n",m_pool.size());
|
2011-02-19 03:36:30 +00:00
|
|
|
|
2009-11-01 11:42:12 +00:00
|
|
|
while(m_pool.size() > 300)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
|
|
|
delete m_pool.back();
|
|
|
|
|
|
|
|
m_pool.pop_back();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-05-23 15:33:50 +00:00
|
|
|
void GSDevice::AgePool()
|
|
|
|
{
|
|
|
|
m_frame++;
|
2011-02-07 01:59:05 +00:00
|
|
|
|
|
|
|
while(m_pool.size() > 20 && m_frame - m_pool.back()->last_frame_used > 10)
|
2010-05-23 15:33:50 +00:00
|
|
|
{
|
|
|
|
delete m_pool.back();
|
2011-02-07 01:59:05 +00:00
|
|
|
|
2010-05-23 15:33:50 +00:00
|
|
|
m_pool.pop_back();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-08-02 23:07:30 +00:00
|
|
|
GSTexture* GSDevice::CreateRenderTarget(int w, int h, bool msaa, int format)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2011-02-22 23:39:02 +00:00
|
|
|
return FetchSurface(GSTexture::RenderTarget, w, h, msaa, format);
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
2009-08-02 23:07:30 +00:00
|
|
|
GSTexture* GSDevice::CreateDepthStencil(int w, int h, bool msaa, int format)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2011-02-22 23:39:02 +00:00
|
|
|
return FetchSurface(GSTexture::DepthStencil, w, h, msaa, format);
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GSTexture* GSDevice::CreateTexture(int w, int h, int format)
|
|
|
|
{
|
2011-02-22 23:39:02 +00:00
|
|
|
return FetchSurface(GSTexture::Texture, w, h, false, format);
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GSTexture* GSDevice::CreateOffscreen(int w, int h, int format)
|
|
|
|
{
|
2011-02-22 23:39:02 +00:00
|
|
|
return FetchSurface(GSTexture::Offscreen, w, h, false, format);
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
2009-05-22 23:23:38 +00:00
|
|
|
void GSDevice::StretchRect(GSTexture* st, GSTexture* dt, const GSVector4& dr, int shader, bool linear)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2009-05-22 23:23:38 +00:00
|
|
|
StretchRect(st, GSVector4(0, 0, 1, 1), dt, dr, shader, linear);
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GSTexture* GSDevice::GetCurrent()
|
|
|
|
{
|
|
|
|
return m_current;
|
|
|
|
}
|
|
|
|
|
|
|
|
void GSDevice::Merge(GSTexture* st[2], GSVector4* sr, GSVector4* dr, const GSVector2i& fs, bool slbg, bool mmod, const GSVector4& c)
|
|
|
|
{
|
2011-07-25 11:16:01 +00:00
|
|
|
if(m_merge == NULL || m_merge->GetSize() != fs)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2009-10-14 16:42:59 +00:00
|
|
|
Recycle(m_merge);
|
2011-02-20 22:33:22 +00:00
|
|
|
|
2009-08-02 23:07:30 +00:00
|
|
|
m_merge = CreateRenderTarget(fs.x, fs.y, false);
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: m_1x1
|
|
|
|
|
2009-06-15 20:15:17 +00:00
|
|
|
// KH:COM crashes at startup when booting *through the bios* due to m_merge being NULL.
|
|
|
|
// (texture appears to be non-null, and is being re-created at a size around like 1700x340,
|
|
|
|
// dunno if that's relevant) -- air
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2009-06-16 01:42:08 +00:00
|
|
|
if(m_merge)
|
|
|
|
{
|
2009-08-02 23:07:30 +00:00
|
|
|
GSTexture* tex[2] = {NULL, NULL};
|
|
|
|
|
2013-06-29 12:02:03 +00:00
|
|
|
for(size_t i = 0; i < countof(tex); i++)
|
2009-08-02 23:07:30 +00:00
|
|
|
{
|
|
|
|
if(st[i] != NULL)
|
|
|
|
{
|
|
|
|
tex[i] = st[i]->IsMSAA() ? Resolve(st[i]) : st[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-21 23:25:25 +00:00
|
|
|
DoMerge(tex, sr, m_merge, dr, slbg, mmod, c);
|
2009-08-02 23:07:30 +00:00
|
|
|
|
2013-06-29 12:02:03 +00:00
|
|
|
for(size_t i = 0; i < countof(tex); i++)
|
2009-08-02 23:07:30 +00:00
|
|
|
{
|
|
|
|
if(tex[i] != st[i])
|
|
|
|
{
|
|
|
|
Recycle(tex[i]);
|
|
|
|
}
|
|
|
|
}
|
2009-06-16 01:42:08 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
printf("GSdx: m_merge is NULL!\n");
|
|
|
|
}
|
2009-05-22 01:22:52 +00:00
|
|
|
|
|
|
|
m_current = m_merge;
|
|
|
|
}
|
|
|
|
|
2009-06-03 12:09:04 +00:00
|
|
|
void GSDevice::Interlace(const GSVector2i& ds, int field, int mode, float yoffset)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2011-07-25 11:16:01 +00:00
|
|
|
if(m_weavebob == NULL || m_weavebob->GetSize() != ds)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2009-10-21 13:06:41 +00:00
|
|
|
delete m_weavebob;
|
2011-02-19 03:36:30 +00:00
|
|
|
|
2009-08-02 23:07:30 +00:00
|
|
|
m_weavebob = CreateRenderTarget(ds.x, ds.y, false);
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(mode == 0 || mode == 2) // weave or blend
|
|
|
|
{
|
|
|
|
// weave first
|
|
|
|
|
|
|
|
DoInterlace(m_merge, m_weavebob, field, false, 0);
|
|
|
|
|
|
|
|
if(mode == 2)
|
|
|
|
{
|
|
|
|
// blend
|
|
|
|
|
2011-07-25 11:16:01 +00:00
|
|
|
if(m_blend == NULL || m_blend->GetSize() != ds)
|
2009-05-22 01:22:52 +00:00
|
|
|
{
|
2010-04-18 17:11:45 +00:00
|
|
|
delete m_blend;
|
2011-02-19 03:36:30 +00:00
|
|
|
|
2009-08-02 23:07:30 +00:00
|
|
|
m_blend = CreateRenderTarget(ds.x, ds.y, false);
|
2009-05-22 01:22:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DoInterlace(m_weavebob, m_blend, 2, false, 0);
|
|
|
|
|
|
|
|
m_current = m_blend;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_current = m_weavebob;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(mode == 1) // bob
|
|
|
|
{
|
|
|
|
DoInterlace(m_merge, m_weavebob, 3, true, yoffset * field);
|
|
|
|
|
|
|
|
m_current = m_weavebob;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_current = m_merge;
|
|
|
|
}
|
2009-07-04 15:14:04 +00:00
|
|
|
}
|
|
|
|
|
2014-01-17 10:17:24 +00:00
|
|
|
void GSDevice::ExternalFX()
|
|
|
|
{
|
|
|
|
GSVector2i s = m_current->GetSize();
|
|
|
|
|
|
|
|
if (m_shaderfx == NULL || m_shaderfx->GetSize() != s)
|
|
|
|
{
|
|
|
|
delete m_shaderfx;
|
|
|
|
m_shaderfx = CreateRenderTarget(s.x, s.y, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_shaderfx != NULL)
|
|
|
|
{
|
|
|
|
GSVector4 sr(0, 0, 1, 1);
|
|
|
|
GSVector4 dr(0, 0, s.x, s.y);
|
|
|
|
|
|
|
|
StretchRect(m_current, sr, m_shaderfx, dr, 7, false);
|
|
|
|
DoExternalFX(m_shaderfx, m_current);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-25 11:16:01 +00:00
|
|
|
void GSDevice::FXAA()
|
|
|
|
{
|
|
|
|
GSVector2i s = m_current->GetSize();
|
|
|
|
|
|
|
|
if(m_fxaa == NULL || m_fxaa->GetSize() != s)
|
|
|
|
{
|
|
|
|
delete m_fxaa;
|
|
|
|
m_fxaa = CreateRenderTarget(s.x, s.y, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(m_fxaa != NULL)
|
|
|
|
{
|
|
|
|
GSVector4 sr(0, 0, 1, 1);
|
|
|
|
GSVector4 dr(0, 0, s.x, s.y);
|
|
|
|
|
|
|
|
StretchRect(m_current, sr, m_fxaa, dr, 7, false);
|
|
|
|
DoFXAA(m_fxaa, m_current);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-29 00:29:29 +00:00
|
|
|
void GSDevice::ShadeBoost()
|
|
|
|
{
|
|
|
|
GSVector2i s = m_current->GetSize();
|
|
|
|
|
|
|
|
if(m_shadeboost == NULL || m_shadeboost->GetSize() != s)
|
|
|
|
{
|
|
|
|
delete m_shadeboost;
|
|
|
|
m_shadeboost = CreateRenderTarget(s.x, s.y, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(m_shadeboost != NULL)
|
|
|
|
{
|
|
|
|
GSVector4 sr(0, 0, 1, 1);
|
|
|
|
GSVector4 dr(0, 0, s.x, s.y);
|
|
|
|
|
2012-02-29 13:19:36 +00:00
|
|
|
StretchRect(m_current, sr, m_shadeboost, dr, 0, false);
|
2012-02-29 00:29:29 +00:00
|
|
|
DoShadeBoost(m_shadeboost, m_current);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-04 15:14:04 +00:00
|
|
|
bool GSDevice::ResizeTexture(GSTexture** t, int w, int h)
|
|
|
|
{
|
|
|
|
if(t == NULL) {ASSERT(0); return false;}
|
|
|
|
|
|
|
|
GSTexture* t2 = *t;
|
|
|
|
|
2009-08-02 23:07:30 +00:00
|
|
|
if(t2 == NULL || t2->GetWidth() != w || t2->GetHeight() != h)
|
2009-07-04 15:14:04 +00:00
|
|
|
{
|
|
|
|
delete t2;
|
|
|
|
|
|
|
|
t2 = CreateTexture(w, h);
|
|
|
|
|
|
|
|
*t = t2;
|
|
|
|
}
|
|
|
|
|
|
|
|
return t2 != NULL;
|
|
|
|
}
|
2011-02-22 23:39:02 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
GSAdapter::operator std::string() const
|
|
|
|
{
|
|
|
|
char buf[sizeof "12345678:12345678:12345678:12345678"];
|
|
|
|
sprintf(buf, "%.4X:%.4X:%.8X:%.2X", vendor, device, subsys, rev);
|
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GSAdapter::operator==(const GSAdapter &desc_dxgi) const
|
|
|
|
{
|
|
|
|
return vendor == desc_dxgi.vendor
|
|
|
|
&& device == desc_dxgi.device
|
|
|
|
&& subsys == desc_dxgi.subsys
|
|
|
|
&& rev == desc_dxgi.rev;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef _WINDOWS
|
|
|
|
GSAdapter::GSAdapter(const DXGI_ADAPTER_DESC1 &desc_dxgi)
|
|
|
|
: vendor(desc_dxgi.VendorId)
|
|
|
|
, device(desc_dxgi.DeviceId)
|
|
|
|
, subsys(desc_dxgi.SubSysId)
|
|
|
|
, rev(desc_dxgi.Revision)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
GSAdapter::GSAdapter(const D3DADAPTER_IDENTIFIER9 &desc_d3d9)
|
|
|
|
: vendor(desc_d3d9.VendorId)
|
|
|
|
, device(desc_d3d9.DeviceId)
|
|
|
|
, subsys(desc_d3d9.SubSysId)
|
|
|
|
, rev(desc_d3d9.Revision)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
2014-12-15 18:14:30 +00:00
|
|
|
#ifdef __linux__
|
2012-08-06 05:26:44 +00:00
|
|
|
// TODO
|
2013-01-04 11:41:51 +00:00
|
|
|
#endif
|