Finish up my scanlines attempt. Now the 2 old shaders are back in and all 3 cycle on F7.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5809 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2.code 2014-01-11 23:17:07 +00:00
parent f5257b2c3c
commit 2ac3c47c42
5 changed files with 43 additions and 23 deletions

View File

@ -106,7 +106,7 @@ void GSDevice::Present(const GSVector4i& r, int shader)
if(m_current)
{
static int s_shader[3] = {0, 5, 6}; // FIXME
static int s_shader[4] = {0, 5, 6, 8}; // FIXME
Present(m_current, m_backbuffer, GSVector4(r), s_shader[shader]);
}

View File

@ -90,7 +90,7 @@ public: // TODO
{
CComPtr<ID3D11InputLayout> il;
CComPtr<ID3D11VertexShader> vs;
CComPtr<ID3D11PixelShader> ps[8];
CComPtr<ID3D11PixelShader> ps[9];
CComPtr<ID3D11SamplerState> ln;
CComPtr<ID3D11SamplerState> pt;
CComPtr<ID3D11DepthStencilState> dss;

View File

@ -119,7 +119,7 @@ public: // TODO
{
CComPtr<IDirect3DVertexDeclaration9> il;
CComPtr<IDirect3DVertexShader9> vs;
CComPtr<IDirect3DPixelShader9> ps[8];
CComPtr<IDirect3DPixelShader9> ps[9];
Direct3DSamplerState9 ln;
Direct3DSamplerState9 pt;
Direct3DDepthStencilState9 dss;

View File

@ -550,7 +550,7 @@ void GSRenderer::KeyEvent(GSKeyEventData* e)
m_aspectratio = (m_aspectratio + 3 + step) % 3;
return;
case VK_F7:
m_shader = (m_shader + 3 + step) % 3;
m_shader = (m_shader + 4 + step) % 4;
printf("GSdx: Set shader %d.\n", (int)m_shader);
return;
case VK_DELETE:

View File

@ -170,26 +170,36 @@ PS_OUTPUT ps_main4(PS_INPUT input)
return output;
}
PS_OUTPUT ps_main5(PS_INPUT input) // triangular
PS_OUTPUT ps_main5(PS_INPUT input) // scanlines
{
PS_OUTPUT output;
uint4 p = (uint4)input.p;
// output.c = ps_crt(input, ((p.x + (p.y & 1) * 3) >> 1) % 3);
output.c = ps_crt(input, ((p.x + ((p.y >> 1) & 1) * 3) >> 1) % 3);
output.c = ps_scanlines(input, p.y % 2);
return output;
}
PS_OUTPUT ps_main6(PS_INPUT input) // diagonal (repurposed for scanlines for now)
PS_OUTPUT ps_main6(PS_INPUT input) // diagonal
{
PS_OUTPUT output;
uint4 p = (uint4)input.p;
output.c = ps_scanlines(input, p.y % 2); // scanlines
//output.c = ps_crt(input, (p.x + (p.y % 3)) % 3); // diagonal
output.c = ps_crt(input, (p.x + (p.y % 3)) % 3);
return output;
}
PS_OUTPUT ps_main8(PS_INPUT input) // triangular
{
PS_OUTPUT output;
uint4 p = (uint4)input.p;
// output.c = ps_crt(input, ((p.x + (p.y & 1) * 3) >> 1) % 3);
output.c = ps_crt(input, ((p.x + ((p.y >> 1) & 1) * 3) >> 1) % 3);
return output;
}
@ -240,26 +250,36 @@ PS_OUTPUT ps_main4(PS_INPUT input)
return output;
}
PS_OUTPUT ps_main5(PS_INPUT input) // triangular
PS_OUTPUT ps_main5(PS_INPUT input) // scanlines
{
PS_OUTPUT output;
int4 p = (int4)input.p;
output.c = ps_scanlines(input, p.y % 2);
return output;
}
PS_OUTPUT ps_main6(PS_INPUT input) // diagonal
{
PS_OUTPUT output;
int4 p = (int4)input.p;
output.c = ps_crt(input, (p.x + (p.y % 3)) % 3);
return output;
}
PS_OUTPUT ps_main8(PS_INPUT input) // triangular
{
PS_OUTPUT output;
int4 p = (int4)input.p;
// output.c = ps_crt(input, ((p.x + (p.y % 2) * 3) / 2) % 3);
output.c = ps_crt(input, ((p.x + ((p.y / 2) % 2) * 3) / 2) % 3);
return output;
}
PS_OUTPUT ps_main6(PS_INPUT input) // diagonal (repurposed for scanlines for now)
{
PS_OUTPUT output;
int4 p = (int4)input.p;
output.c = ps_scanlines(input, p.y % 2); // scanlines
//output.c = ps_crt(input, (p.x + (p.y % 3)) % 3); // diagonal
return output;
}