gsdx-ogl: Use 32B strides for all VBO

This commit is contained in:
Gregory Hainaut 2014-10-01 21:46:20 +02:00
parent d37cc8e1e7
commit 10c7be8c50
4 changed files with 15 additions and 24 deletions

View File

@ -191,10 +191,10 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
// ****************************************************************
GSInputLayoutOGL il_convert[2] =
{
{0, 2, GL_FLOAT, GL_FALSE, sizeof(GSVertexPxyT1), (const GLvoid*)offsetof(struct GSVertexPxyT1, p) },
{1, 2, GL_FLOAT, GL_FALSE, sizeof(GSVertexPxyT1), (const GLvoid*)offsetof(struct GSVertexPxyT1, t) },
{0, 2, GL_FLOAT, GL_FALSE, sizeof(GSVertexPT1), (const GLvoid*)offsetof(struct GSVertexPT1, p) },
{1, 2, GL_FLOAT, GL_FALSE, sizeof(GSVertexPT1), (const GLvoid*)offsetof(struct GSVertexPT1, t) },
};
m_vb_sr = new GSVertexBufferStateOGL(sizeof(GSVertexPxyT1), il_convert, countof(il_convert));
m_vb_sr = new GSVertexBufferStateOGL(sizeof(GSVertexPT1), il_convert, countof(il_convert));
// ****************************************************************
// Texture unit state
@ -851,12 +851,12 @@ void GSDeviceOGL::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt,
flip_sr.w = sr.y;
}
GSVertexPxyT1 vertices[] =
GSVertexPT1 vertices[] =
{
{GSVector2(left , top ) , GSVector2(flip_sr.x , flip_sr.y)} ,
{GSVector2(right , top ) , GSVector2(flip_sr.z , flip_sr.y)} ,
{GSVector2(left , bottom) , GSVector2(flip_sr.x , flip_sr.w)} ,
{GSVector2(right , bottom) , GSVector2(flip_sr.z , flip_sr.w)} ,
{GSVector4(left , top , 0.0f, 0.0f) , GSVector2(flip_sr.x , flip_sr.y)} ,
{GSVector4(right , top , 0.0f, 0.0f) , GSVector2(flip_sr.z , flip_sr.y)} ,
{GSVector4(left , bottom, 0.0f, 0.0f) , GSVector2(flip_sr.x , flip_sr.w)} ,
{GSVector4(right , bottom, 0.0f, 0.0f) , GSVector2(flip_sr.z , flip_sr.w)} ,
};
IASetVertexState(m_vb_sr);
@ -956,7 +956,7 @@ void GSDeviceOGL::DoShadeBoost(GSTexture* st, GSTexture* dt)
StretchRect(st, sr, dt, dr, m_shadeboost.ps, true);
}
void GSDeviceOGL::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPxyT1* vertices, bool datm)
void GSDeviceOGL::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, bool datm)
{
#ifdef ENABLE_OGL_STENCIL_DEBUG
const GSVector2i& size = rt->GetSize();

View File

@ -599,7 +599,7 @@ class GSDeviceOGL : public GSDevice
void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt, const GSVector4& dr, GLuint ps, bool linear = true);
void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt, const GSVector4& dr, GLuint ps, GSBlendStateOGL* bs, bool linear = true);
void SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPxyT1* vertices, bool datm);
void SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, bool datm);
void EndScene();

View File

@ -239,12 +239,12 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
GSVector4 src = ((m_vt.m_min.p.xyxy(m_vt.m_max.p) + o.xxyy()) * s.xyxy()).sat(o.zzyy());
GSVector4 dst = src * 2.0f + o.xxxx();
GSVertexPxyT1 vertices[] =
GSVertexPT1 vertices[] =
{
{GSVector2(dst.x, dst.y), GSVector2(src.x, src.y)},
{GSVector2(dst.z, dst.y), GSVector2(src.z, src.y)},
{GSVector2(dst.x, dst.w), GSVector2(src.x, src.w)},
{GSVector2(dst.z, dst.w), GSVector2(src.z, src.w)},
{GSVector4(dst.x, dst.y, 0.0f, 0.0f), GSVector2(src.x, src.y)},
{GSVector4(dst.z, dst.y, 0.0f, 0.0f), GSVector2(src.z, src.y)},
{GSVector4(dst.x, dst.w, 0.0f, 0.0f), GSVector2(src.x, src.w)},
{GSVector4(dst.z, dst.w, 0.0f, 0.0f), GSVector2(src.z, src.w)},
};
dev->SetupDATE(rt, ds, vertices, m_context->TEST.DATM);

View File

@ -52,15 +52,6 @@ struct GSVertexP
GSVector4 p;
};
// Align 16 because the structure only contains 16B. Otherwise
// sizeof(GSVertexPxyT1) == 32 which defeat the purpose to save bandwidth vs
// GSVertexPT1
__aligned(struct, 16) GSVertexPxyT1
{
GSVector2 p;
GSVector2 t;
};
__aligned(struct, 32) GSVertexPT1
{
GSVector4 p;