2010-04-25 00:31:27 +00:00
|
|
|
/*
|
2010-04-24 21:37:39 +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
|
|
|
*
|
2010-04-24 21:37:39 +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
|
|
|
*
|
2010-04-24 21:37:39 +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.
|
2010-04-24 21:37:39 +00:00
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "GSRendererDX11.h"
|
|
|
|
#include "GSCrc.h"
|
|
|
|
#include "resource.h"
|
|
|
|
|
|
|
|
GSRendererDX11::GSRendererDX11()
|
2016-10-13 09:25:48 +00:00
|
|
|
: GSRendererDX(new GSTextureCache11(this), GSVector2(-0.5f))
|
2010-04-24 21:37:39 +00:00
|
|
|
{
|
2017-03-03 21:18:49 +00:00
|
|
|
if (theApp.GetConfigB("UserHacks")) {
|
|
|
|
UserHacks_unscale_pt_ln = theApp.GetConfigB("UserHacks_unscale_point_line");
|
|
|
|
} else {
|
|
|
|
UserHacks_unscale_pt_ln = false;
|
|
|
|
}
|
2010-04-24 21:37:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool GSRendererDX11::CreateDevice(GSDevice* dev)
|
|
|
|
{
|
|
|
|
if(!__super::CreateDevice(dev))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
GSdx-D3D: Texture and channel shuffle improvements.
Texture Shuffle changes:
Always Enable Texture shuffle on D3D10/11.
Previously Texture shuffle was enabled if CRC hack
level was below Full, this was kinda not good since
D3D also relies on CRC hacks on Full so you could either
stick with texture shuffle or crc hacks.
Texture shuffle is not supported on D3D9, however we can do a partial
port where instead of vertical lines with the effect we get the effect
on the entire screen. Better than nothing I suppose.
Ported some of the code from OpenGL to D3D
( just a copy - paste job :) ),
part of the code misses a dedicated shader but we can still
use it to fix various issues on many games.
List of affected games tested so far:
The Godfather, Final Fight Streetwise, The Suffering Ties that Bind,
Urban Chaos have their vertical lines issues fixed
(highly possible for other games as well), MGS and Stolen see an improvement
but they are still broken without crc hacks. Other games that suffered
similar issues are probably affected as well.
Channel Shuffle changes:
Update Channel Shuffle detection. A lot of games should see an improvement,
MGS, Urban Chaos, Stolen have their top left corner issues resolved.
Other games should be affected as well that use similar logic.
They still miss a shader so some effects are still broken/show glitches
but it's a nice improvement for D3D users.
Shared changes:
Texture Shuffle and Channel shuffle have been moved to their
own dedicated functions. Should make things a bit cleaner.
Move part of the code for Texture Shuffle to GSRendererHW to be shared
across all HW renderers, should aboid copy paste/duplicate code.
2018-03-18 09:08:36 +00:00
|
|
|
void GSRendererDX11::EmulateTextureShuffleAndFbmask()
|
|
|
|
{
|
|
|
|
size_t count = m_vertex.next;
|
|
|
|
GSVertex* v = &m_vertex.buff[0];
|
|
|
|
|
|
|
|
// Note: D3D1011 is limited and can't read the current framebuffer so we can't have PS_FBMASK and PS_WRITE_RG shaders ported and working.
|
|
|
|
if (m_texture_shuffle) {
|
|
|
|
m_ps_sel.shuffle = 1;
|
2018-09-13 07:35:42 +00:00
|
|
|
m_ps_sel.dfmt = 0;
|
GSdx-D3D: Texture and channel shuffle improvements.
Texture Shuffle changes:
Always Enable Texture shuffle on D3D10/11.
Previously Texture shuffle was enabled if CRC hack
level was below Full, this was kinda not good since
D3D also relies on CRC hacks on Full so you could either
stick with texture shuffle or crc hacks.
Texture shuffle is not supported on D3D9, however we can do a partial
port where instead of vertical lines with the effect we get the effect
on the entire screen. Better than nothing I suppose.
Ported some of the code from OpenGL to D3D
( just a copy - paste job :) ),
part of the code misses a dedicated shader but we can still
use it to fix various issues on many games.
List of affected games tested so far:
The Godfather, Final Fight Streetwise, The Suffering Ties that Bind,
Urban Chaos have their vertical lines issues fixed
(highly possible for other games as well), MGS and Stolen see an improvement
but they are still broken without crc hacks. Other games that suffered
similar issues are probably affected as well.
Channel Shuffle changes:
Update Channel Shuffle detection. A lot of games should see an improvement,
MGS, Urban Chaos, Stolen have their top left corner issues resolved.
Other games should be affected as well that use similar logic.
They still miss a shader so some effects are still broken/show glitches
but it's a nice improvement for D3D users.
Shared changes:
Texture Shuffle and Channel shuffle have been moved to their
own dedicated functions. Should make things a bit cleaner.
Move part of the code for Texture Shuffle to GSRendererHW to be shared
across all HW renderers, should aboid copy paste/duplicate code.
2018-03-18 09:08:36 +00:00
|
|
|
|
|
|
|
const GIFRegXYOFFSET& o = m_context->XYOFFSET;
|
|
|
|
|
|
|
|
// vertex position is 8 to 16 pixels, therefore it is the 16-31 bits of the colors
|
|
|
|
int pos = (v[0].XYZ.X - o.OFX) & 0xFF;
|
|
|
|
bool write_ba = (pos > 112 && pos < 136);
|
|
|
|
// Read texture is 8 to 16 pixels (same as above)
|
|
|
|
float tw = (float)(1u << m_context->TEX0.TW);
|
|
|
|
int tex_pos = (PRIM->FST) ? v[0].U : (int)(tw * v[0].ST.S);
|
|
|
|
tex_pos &= 0xFF;
|
|
|
|
m_ps_sel.read_ba = (tex_pos > 112 && tex_pos < 144);
|
|
|
|
|
|
|
|
// Convert the vertex info to a 32 bits color format equivalent
|
|
|
|
if (PRIM->FST) {
|
|
|
|
|
|
|
|
for(size_t i = 0; i < count; i += 2) {
|
|
|
|
if (write_ba)
|
|
|
|
v[i].XYZ.X -= 128u;
|
|
|
|
else
|
|
|
|
v[i+1].XYZ.X += 128u;
|
|
|
|
|
|
|
|
if (m_ps_sel.read_ba)
|
|
|
|
v[i].U -= 128u;
|
|
|
|
else
|
|
|
|
v[i+1].U += 128u;
|
|
|
|
|
|
|
|
// Height is too big (2x).
|
|
|
|
int tex_offset = v[i].V & 0xF;
|
|
|
|
GSVector4i offset(o.OFY, tex_offset, o.OFY, tex_offset);
|
|
|
|
|
|
|
|
GSVector4i tmp(v[i].XYZ.Y, v[i].V, v[i+1].XYZ.Y, v[i+1].V);
|
|
|
|
tmp = GSVector4i(tmp - offset).srl32(1) + offset;
|
|
|
|
|
|
|
|
v[i].XYZ.Y = (uint16)tmp.x;
|
|
|
|
v[i].V = (uint16)tmp.y;
|
|
|
|
v[i+1].XYZ.Y = (uint16)tmp.z;
|
|
|
|
v[i+1].V = (uint16)tmp.w;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
const float offset_8pix = 8.0f / tw;
|
|
|
|
|
|
|
|
for(size_t i = 0; i < count; i += 2) {
|
|
|
|
if (write_ba)
|
|
|
|
v[i].XYZ.X -= 128u;
|
|
|
|
else
|
|
|
|
v[i+1].XYZ.X += 128u;
|
|
|
|
|
|
|
|
if (m_ps_sel.read_ba)
|
|
|
|
v[i].ST.S -= offset_8pix;
|
|
|
|
else
|
|
|
|
v[i+1].ST.S += offset_8pix;
|
|
|
|
|
|
|
|
// Height is too big (2x).
|
|
|
|
GSVector4i offset(o.OFY, o.OFY);
|
|
|
|
|
|
|
|
GSVector4i tmp(v[i].XYZ.Y, v[i+1].XYZ.Y);
|
|
|
|
tmp = GSVector4i(tmp - offset).srl32(1) + offset;
|
|
|
|
|
|
|
|
//fprintf(stderr, "Before %d, After %d\n", v[i+1].XYZ.Y, tmp.y);
|
|
|
|
v[i].XYZ.Y = (uint16)tmp.x;
|
|
|
|
v[i].ST.T /= 2.0f;
|
|
|
|
v[i+1].XYZ.Y = (uint16)tmp.y;
|
|
|
|
v[i+1].ST.T /= 2.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Please bang my head against the wall!
|
|
|
|
// 1/ Reduce the frame mask to a 16 bit format
|
|
|
|
const uint32& m = m_context->FRAME.FBMSK;
|
|
|
|
uint32 fbmask = ((m >> 3) & 0x1F) | ((m >> 6) & 0x3E0) | ((m >> 9) & 0x7C00) | ((m >> 16) & 0x8000);
|
2018-04-23 18:09:49 +00:00
|
|
|
// FIXME GSVector will be nice here
|
|
|
|
uint8 rg_mask = fbmask & 0xFF;
|
|
|
|
uint8 ba_mask = (fbmask >> 8) & 0xFF;
|
GSdx-D3D: Texture and channel shuffle improvements.
Texture Shuffle changes:
Always Enable Texture shuffle on D3D10/11.
Previously Texture shuffle was enabled if CRC hack
level was below Full, this was kinda not good since
D3D also relies on CRC hacks on Full so you could either
stick with texture shuffle or crc hacks.
Texture shuffle is not supported on D3D9, however we can do a partial
port where instead of vertical lines with the effect we get the effect
on the entire screen. Better than nothing I suppose.
Ported some of the code from OpenGL to D3D
( just a copy - paste job :) ),
part of the code misses a dedicated shader but we can still
use it to fix various issues on many games.
List of affected games tested so far:
The Godfather, Final Fight Streetwise, The Suffering Ties that Bind,
Urban Chaos have their vertical lines issues fixed
(highly possible for other games as well), MGS and Stolen see an improvement
but they are still broken without crc hacks. Other games that suffered
similar issues are probably affected as well.
Channel Shuffle changes:
Update Channel Shuffle detection. A lot of games should see an improvement,
MGS, Urban Chaos, Stolen have their top left corner issues resolved.
Other games should be affected as well that use similar logic.
They still miss a shader so some effects are still broken/show glitches
but it's a nice improvement for D3D users.
Shared changes:
Texture Shuffle and Channel shuffle have been moved to their
own dedicated functions. Should make things a bit cleaner.
Move part of the code for Texture Shuffle to GSRendererHW to be shared
across all HW renderers, should aboid copy paste/duplicate code.
2018-03-18 09:08:36 +00:00
|
|
|
om_bsel.wrgba = 0;
|
|
|
|
|
|
|
|
// 2 Select the new mask (Please someone put SSE here)
|
2018-04-23 18:09:49 +00:00
|
|
|
if (rg_mask != 0xFF) {
|
|
|
|
if (write_ba) {
|
GSdx-D3D: Texture and channel shuffle improvements.
Texture Shuffle changes:
Always Enable Texture shuffle on D3D10/11.
Previously Texture shuffle was enabled if CRC hack
level was below Full, this was kinda not good since
D3D also relies on CRC hacks on Full so you could either
stick with texture shuffle or crc hacks.
Texture shuffle is not supported on D3D9, however we can do a partial
port where instead of vertical lines with the effect we get the effect
on the entire screen. Better than nothing I suppose.
Ported some of the code from OpenGL to D3D
( just a copy - paste job :) ),
part of the code misses a dedicated shader but we can still
use it to fix various issues on many games.
List of affected games tested so far:
The Godfather, Final Fight Streetwise, The Suffering Ties that Bind,
Urban Chaos have their vertical lines issues fixed
(highly possible for other games as well), MGS and Stolen see an improvement
but they are still broken without crc hacks. Other games that suffered
similar issues are probably affected as well.
Channel Shuffle changes:
Update Channel Shuffle detection. A lot of games should see an improvement,
MGS, Urban Chaos, Stolen have their top left corner issues resolved.
Other games should be affected as well that use similar logic.
They still miss a shader so some effects are still broken/show glitches
but it's a nice improvement for D3D users.
Shared changes:
Texture Shuffle and Channel shuffle have been moved to their
own dedicated functions. Should make things a bit cleaner.
Move part of the code for Texture Shuffle to GSRendererHW to be shared
across all HW renderers, should aboid copy paste/duplicate code.
2018-03-18 09:08:36 +00:00
|
|
|
om_bsel.wb = 1;
|
2018-04-23 18:09:49 +00:00
|
|
|
} else {
|
GSdx-D3D: Texture and channel shuffle improvements.
Texture Shuffle changes:
Always Enable Texture shuffle on D3D10/11.
Previously Texture shuffle was enabled if CRC hack
level was below Full, this was kinda not good since
D3D also relies on CRC hacks on Full so you could either
stick with texture shuffle or crc hacks.
Texture shuffle is not supported on D3D9, however we can do a partial
port where instead of vertical lines with the effect we get the effect
on the entire screen. Better than nothing I suppose.
Ported some of the code from OpenGL to D3D
( just a copy - paste job :) ),
part of the code misses a dedicated shader but we can still
use it to fix various issues on many games.
List of affected games tested so far:
The Godfather, Final Fight Streetwise, The Suffering Ties that Bind,
Urban Chaos have their vertical lines issues fixed
(highly possible for other games as well), MGS and Stolen see an improvement
but they are still broken without crc hacks. Other games that suffered
similar issues are probably affected as well.
Channel Shuffle changes:
Update Channel Shuffle detection. A lot of games should see an improvement,
MGS, Urban Chaos, Stolen have their top left corner issues resolved.
Other games should be affected as well that use similar logic.
They still miss a shader so some effects are still broken/show glitches
but it's a nice improvement for D3D users.
Shared changes:
Texture Shuffle and Channel shuffle have been moved to their
own dedicated functions. Should make things a bit cleaner.
Move part of the code for Texture Shuffle to GSRendererHW to be shared
across all HW renderers, should aboid copy paste/duplicate code.
2018-03-18 09:08:36 +00:00
|
|
|
om_bsel.wr = 1;
|
2018-04-23 18:09:49 +00:00
|
|
|
}
|
GSdx-D3D: Texture and channel shuffle improvements.
Texture Shuffle changes:
Always Enable Texture shuffle on D3D10/11.
Previously Texture shuffle was enabled if CRC hack
level was below Full, this was kinda not good since
D3D also relies on CRC hacks on Full so you could either
stick with texture shuffle or crc hacks.
Texture shuffle is not supported on D3D9, however we can do a partial
port where instead of vertical lines with the effect we get the effect
on the entire screen. Better than nothing I suppose.
Ported some of the code from OpenGL to D3D
( just a copy - paste job :) ),
part of the code misses a dedicated shader but we can still
use it to fix various issues on many games.
List of affected games tested so far:
The Godfather, Final Fight Streetwise, The Suffering Ties that Bind,
Urban Chaos have their vertical lines issues fixed
(highly possible for other games as well), MGS and Stolen see an improvement
but they are still broken without crc hacks. Other games that suffered
similar issues are probably affected as well.
Channel Shuffle changes:
Update Channel Shuffle detection. A lot of games should see an improvement,
MGS, Urban Chaos, Stolen have their top left corner issues resolved.
Other games should be affected as well that use similar logic.
They still miss a shader so some effects are still broken/show glitches
but it's a nice improvement for D3D users.
Shared changes:
Texture Shuffle and Channel shuffle have been moved to their
own dedicated functions. Should make things a bit cleaner.
Move part of the code for Texture Shuffle to GSRendererHW to be shared
across all HW renderers, should aboid copy paste/duplicate code.
2018-03-18 09:08:36 +00:00
|
|
|
} else if ((fbmask & 0xFF) != 0xFF) {
|
|
|
|
#ifdef _DEBUG
|
|
|
|
fprintf(stderr, "Please fix me! wb %u wr %u\n", om_bsel.wb, om_bsel.wr);
|
|
|
|
#endif
|
|
|
|
//ASSERT(0);
|
|
|
|
}
|
|
|
|
|
2018-04-23 18:09:49 +00:00
|
|
|
if (ba_mask != 0xFF) {
|
|
|
|
if (write_ba) {
|
GSdx-D3D: Texture and channel shuffle improvements.
Texture Shuffle changes:
Always Enable Texture shuffle on D3D10/11.
Previously Texture shuffle was enabled if CRC hack
level was below Full, this was kinda not good since
D3D also relies on CRC hacks on Full so you could either
stick with texture shuffle or crc hacks.
Texture shuffle is not supported on D3D9, however we can do a partial
port where instead of vertical lines with the effect we get the effect
on the entire screen. Better than nothing I suppose.
Ported some of the code from OpenGL to D3D
( just a copy - paste job :) ),
part of the code misses a dedicated shader but we can still
use it to fix various issues on many games.
List of affected games tested so far:
The Godfather, Final Fight Streetwise, The Suffering Ties that Bind,
Urban Chaos have their vertical lines issues fixed
(highly possible for other games as well), MGS and Stolen see an improvement
but they are still broken without crc hacks. Other games that suffered
similar issues are probably affected as well.
Channel Shuffle changes:
Update Channel Shuffle detection. A lot of games should see an improvement,
MGS, Urban Chaos, Stolen have their top left corner issues resolved.
Other games should be affected as well that use similar logic.
They still miss a shader so some effects are still broken/show glitches
but it's a nice improvement for D3D users.
Shared changes:
Texture Shuffle and Channel shuffle have been moved to their
own dedicated functions. Should make things a bit cleaner.
Move part of the code for Texture Shuffle to GSRendererHW to be shared
across all HW renderers, should aboid copy paste/duplicate code.
2018-03-18 09:08:36 +00:00
|
|
|
om_bsel.wa = 1;
|
2018-04-23 18:09:49 +00:00
|
|
|
} else {
|
GSdx-D3D: Texture and channel shuffle improvements.
Texture Shuffle changes:
Always Enable Texture shuffle on D3D10/11.
Previously Texture shuffle was enabled if CRC hack
level was below Full, this was kinda not good since
D3D also relies on CRC hacks on Full so you could either
stick with texture shuffle or crc hacks.
Texture shuffle is not supported on D3D9, however we can do a partial
port where instead of vertical lines with the effect we get the effect
on the entire screen. Better than nothing I suppose.
Ported some of the code from OpenGL to D3D
( just a copy - paste job :) ),
part of the code misses a dedicated shader but we can still
use it to fix various issues on many games.
List of affected games tested so far:
The Godfather, Final Fight Streetwise, The Suffering Ties that Bind,
Urban Chaos have their vertical lines issues fixed
(highly possible for other games as well), MGS and Stolen see an improvement
but they are still broken without crc hacks. Other games that suffered
similar issues are probably affected as well.
Channel Shuffle changes:
Update Channel Shuffle detection. A lot of games should see an improvement,
MGS, Urban Chaos, Stolen have their top left corner issues resolved.
Other games should be affected as well that use similar logic.
They still miss a shader so some effects are still broken/show glitches
but it's a nice improvement for D3D users.
Shared changes:
Texture Shuffle and Channel shuffle have been moved to their
own dedicated functions. Should make things a bit cleaner.
Move part of the code for Texture Shuffle to GSRendererHW to be shared
across all HW renderers, should aboid copy paste/duplicate code.
2018-03-18 09:08:36 +00:00
|
|
|
om_bsel.wg = 1;
|
2018-04-23 18:09:49 +00:00
|
|
|
}
|
GSdx-D3D: Texture and channel shuffle improvements.
Texture Shuffle changes:
Always Enable Texture shuffle on D3D10/11.
Previously Texture shuffle was enabled if CRC hack
level was below Full, this was kinda not good since
D3D also relies on CRC hacks on Full so you could either
stick with texture shuffle or crc hacks.
Texture shuffle is not supported on D3D9, however we can do a partial
port where instead of vertical lines with the effect we get the effect
on the entire screen. Better than nothing I suppose.
Ported some of the code from OpenGL to D3D
( just a copy - paste job :) ),
part of the code misses a dedicated shader but we can still
use it to fix various issues on many games.
List of affected games tested so far:
The Godfather, Final Fight Streetwise, The Suffering Ties that Bind,
Urban Chaos have their vertical lines issues fixed
(highly possible for other games as well), MGS and Stolen see an improvement
but they are still broken without crc hacks. Other games that suffered
similar issues are probably affected as well.
Channel Shuffle changes:
Update Channel Shuffle detection. A lot of games should see an improvement,
MGS, Urban Chaos, Stolen have their top left corner issues resolved.
Other games should be affected as well that use similar logic.
They still miss a shader so some effects are still broken/show glitches
but it's a nice improvement for D3D users.
Shared changes:
Texture Shuffle and Channel shuffle have been moved to their
own dedicated functions. Should make things a bit cleaner.
Move part of the code for Texture Shuffle to GSRendererHW to be shared
across all HW renderers, should aboid copy paste/duplicate code.
2018-03-18 09:08:36 +00:00
|
|
|
} else if ((fbmask & 0xFF) != 0xFF) {
|
|
|
|
#ifdef _DEBUG
|
|
|
|
fprintf(stderr, "Please fix me! wa %u wg %u\n", om_bsel.wa, om_bsel.wg);
|
|
|
|
#endif
|
|
|
|
//ASSERT(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2018-09-13 07:35:42 +00:00
|
|
|
m_ps_sel.dfmt = GSLocalMemory::m_psm[m_context->FRAME.PSM].fmt;
|
GSdx-D3D: Texture and channel shuffle improvements.
Texture Shuffle changes:
Always Enable Texture shuffle on D3D10/11.
Previously Texture shuffle was enabled if CRC hack
level was below Full, this was kinda not good since
D3D also relies on CRC hacks on Full so you could either
stick with texture shuffle or crc hacks.
Texture shuffle is not supported on D3D9, however we can do a partial
port where instead of vertical lines with the effect we get the effect
on the entire screen. Better than nothing I suppose.
Ported some of the code from OpenGL to D3D
( just a copy - paste job :) ),
part of the code misses a dedicated shader but we can still
use it to fix various issues on many games.
List of affected games tested so far:
The Godfather, Final Fight Streetwise, The Suffering Ties that Bind,
Urban Chaos have their vertical lines issues fixed
(highly possible for other games as well), MGS and Stolen see an improvement
but they are still broken without crc hacks. Other games that suffered
similar issues are probably affected as well.
Channel Shuffle changes:
Update Channel Shuffle detection. A lot of games should see an improvement,
MGS, Urban Chaos, Stolen have their top left corner issues resolved.
Other games should be affected as well that use similar logic.
They still miss a shader so some effects are still broken/show glitches
but it's a nice improvement for D3D users.
Shared changes:
Texture Shuffle and Channel shuffle have been moved to their
own dedicated functions. Should make things a bit cleaner.
Move part of the code for Texture Shuffle to GSRendererHW to be shared
across all HW renderers, should aboid copy paste/duplicate code.
2018-03-18 09:08:36 +00:00
|
|
|
|
|
|
|
om_bsel.wrgba = ~GSVector4i::load((int)m_context->FRAME.FBMSK).eq8(GSVector4i::xffffffff()).mask();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-03 21:18:49 +00:00
|
|
|
void GSRendererDX11::SetupIA(const float& sx, const float& sy)
|
2010-04-24 21:37:39 +00:00
|
|
|
{
|
2012-01-19 04:53:36 +00:00
|
|
|
GSDevice11* dev = (GSDevice11*)m_dev;
|
2012-01-06 00:17:52 +00:00
|
|
|
|
2017-03-03 21:18:49 +00:00
|
|
|
D3D11_PRIMITIVE_TOPOLOGY t;
|
|
|
|
|
|
|
|
bool unscale_hack = UserHacks_unscale_pt_ln && (GetUpscaleMultiplier() != 1);
|
|
|
|
|
|
|
|
switch (m_vt.m_primclass)
|
|
|
|
{
|
|
|
|
case GS_POINT_CLASS:
|
|
|
|
if (unscale_hack) {
|
|
|
|
m_gs_sel.point = 1;
|
|
|
|
gs_cb.PointSize = GSVector2(16.0f * sx, 16.0f * sy);
|
|
|
|
}
|
|
|
|
|
|
|
|
t = D3D11_PRIMITIVE_TOPOLOGY_POINTLIST;
|
|
|
|
break;
|
|
|
|
case GS_LINE_CLASS:
|
|
|
|
if (unscale_hack) {
|
|
|
|
m_gs_sel.line = 1;
|
|
|
|
gs_cb.PointSize = GSVector2(16.0f * sx, 16.0f * sy);
|
|
|
|
}
|
|
|
|
|
|
|
|
t = D3D11_PRIMITIVE_TOPOLOGY_LINELIST;
|
|
|
|
|
|
|
|
break;
|
|
|
|
case GS_SPRITE_CLASS:
|
2017-06-13 00:11:45 +00:00
|
|
|
t = D3D11_PRIMITIVE_TOPOLOGY_LINELIST;
|
2017-03-03 21:18:49 +00:00
|
|
|
break;
|
|
|
|
case GS_TRIANGLE_CLASS:
|
|
|
|
|
|
|
|
t = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
|
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
__assume(0);
|
|
|
|
}
|
|
|
|
|
2012-01-19 04:53:36 +00:00
|
|
|
void* ptr = NULL;
|
2011-02-07 01:59:05 +00:00
|
|
|
|
2012-01-19 04:53:36 +00:00
|
|
|
if(dev->IAMapVertexBuffer(&ptr, sizeof(GSVertex), m_vertex.next))
|
2010-04-24 21:37:39 +00:00
|
|
|
{
|
2013-02-12 10:57:48 +00:00
|
|
|
GSVector4i::storent(ptr, m_vertex.buff, sizeof(GSVertex) * m_vertex.next);
|
|
|
|
|
|
|
|
if(UserHacks_WildHack && !isPackedUV_HackFlag)
|
|
|
|
{
|
|
|
|
GSVertex* RESTRICT d = (GSVertex*)ptr;
|
|
|
|
|
GSdx:
- changed the KH2 fix in GetTextureMinMax to my taste, should give the same results, when the used texture rect is to the left/above the clamped area, it returns [min, min+1], and [max-1, max] for right/below
- m_mem.m_clut.Read32 was returned to its original place from GetAlphaMinMax
- UserHacks_WildHack was moved up to GSState, special UV handlers are only used when this setting is active
- updated xbyak to the latest available (avx2 seems incomplete, the 256-bit promoted old instructions are missing)
- changed vtune's include path to the 2013 edition
Some other not yet commited changes from a year ago:
- WriteImageX overflow crash-fix
- moved colclamp after dithering (sw mode), it makes more sense, no visible changes noticed
- Gif_Tag::analyzeTag(), there was a conditional I didn't like, split the loop into two parts
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5649 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-06-06 11:36:01 +00:00
|
|
|
for(unsigned int i = 0; i < m_vertex.next; i++)
|
|
|
|
{
|
|
|
|
if(PRIM->TME && PRIM->FST) d[i].UV &= 0x3FEF3FEF;
|
|
|
|
}
|
2013-02-12 10:57:48 +00:00
|
|
|
}
|
|
|
|
|
2012-01-19 04:53:36 +00:00
|
|
|
dev->IAUnmapVertexBuffer();
|
2010-04-24 21:37:39 +00:00
|
|
|
}
|
2010-08-17 04:38:49 +00:00
|
|
|
|
2012-01-19 04:53:36 +00:00
|
|
|
dev->IASetIndexBuffer(m_index.buff, m_index.tail);
|
|
|
|
dev->IASetPrimitiveTopology(t);
|
2010-04-24 21:37:39 +00:00
|
|
|
}
|