diff --git a/plugins/GSdx/GSDevice10.cpp b/plugins/GSdx/GSDevice10.cpp index bf22deb23d..a32bd1e7d4 100644 --- a/plugins/GSdx/GSDevice10.cpp +++ b/plugins/GSdx/GSDevice10.cpp @@ -511,7 +511,7 @@ void GSDevice10::IASetVertexBuffer(const void* vertices, size_t stride, size_t c { ASSERT(m_vertices.count == 0); - if(count > m_vertices.limit) + if(count * stride > m_vertices.limit * m_vertices.stride) { m_vertices.vb_old = m_vertices.vb; m_vertices.vb = NULL; diff --git a/plugins/GSdx/GSDevice9.cpp b/plugins/GSdx/GSDevice9.cpp index e84029c303..7d4f12a940 100644 --- a/plugins/GSdx/GSDevice9.cpp +++ b/plugins/GSdx/GSDevice9.cpp @@ -648,7 +648,7 @@ void GSDevice9::IASetVertexBuffer(const void* vertices, size_t stride, size_t co { ASSERT(m_vertices.count == 0); - if(count > m_vertices.limit) + if(count * stride > m_vertices.limit * m_vertices.stride) { m_vertices.vb_old = m_vertices.vb; m_vertices.vb = NULL; diff --git a/plugins/GSdx/res/tfx10.fx b/plugins/GSdx/res/tfx10.fx index 8f0fe77a9b..78d1c4403d 100644 --- a/plugins/GSdx/res/tfx10.fx +++ b/plugins/GSdx/res/tfx10.fx @@ -414,11 +414,11 @@ PS_OUTPUT ps_main(PS_INPUT input) { if(TCC == 0) { - c.rgb = c.rgb * t.rgb * 2; + c.rgb = c.rgb * t.rgb * 255.0f / 128; } else { - c = c * t * 2; + c = c * t * 255.0f / 128; } } else if(TFX == 1) @@ -434,7 +434,7 @@ PS_OUTPUT ps_main(PS_INPUT input) } else if(TFX == 2) { - c.rgb = c.rgb * t.rgb * 2 + c.a; + c.rgb = c.rgb * t.rgb * 255.0f / 128 + c.a; if(TCC == 1) { @@ -443,7 +443,7 @@ PS_OUTPUT ps_main(PS_INPUT input) } else if(TFX == 3) { - c.rgb = c.rgb * t.rgb * 2 + c.a; + c.rgb = c.rgb * t.rgb * 255.0f / 128 + c.a; if(TCC == 1) { diff --git a/plugins/GSdx/res/tfx9.fx b/plugins/GSdx/res/tfx9.fx index d825cf187b..384b85780d 100644 --- a/plugins/GSdx/res/tfx9.fx +++ b/plugins/GSdx/res/tfx9.fx @@ -241,11 +241,11 @@ float4 ps_main(PS_INPUT input) : COLOR { if(TCC == 0) { - c.rgb = c.rgb * t.rgb * 2; + c.rgb = c.rgb * t.rgb * 255.0f / 128; } else { - c = c * t * 2; + c = c * t * 255.0f / 128; } } else if(TFX == 1) @@ -261,7 +261,7 @@ float4 ps_main(PS_INPUT input) : COLOR } else if(TFX == 2) { - c.rgb = c.rgb * t.rgb * 2 + c.a; + c.rgb = c.rgb * t.rgb * 255.0f / 128 + c.a; if(TCC == 1) { @@ -270,7 +270,7 @@ float4 ps_main(PS_INPUT input) : COLOR } else if(TFX == 3) { - c.rgb = c.rgb * t.rgb * 2 + c.a; + c.rgb = c.rgb * t.rgb * 255.0f / 128 + c.a; if(TCC == 1) { @@ -292,7 +292,7 @@ float4 ps_main(PS_INPUT input) : COLOR } else if(ATST == 4) // e { - clip(0.6f / 256 - abs(c.a - AREF)); // FIXME: 0.5f is too small + clip(0.6f / 255 - abs(c.a - AREF)); // FIXME: 0.5f is too small } else if(ATST == 5 || ATST == 6) // ge, g {