gsdx ogl: use the new uniform cache upload method

This commit is contained in:
Gregory Hainaut 2016-05-28 19:13:35 +02:00
parent fa15d7fd26
commit 6f19d928f6
1 changed files with 4 additions and 7 deletions

View File

@ -260,7 +260,7 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
// Upload once and forget about it
ConvertConstantBuffer cb;
cb.ScalingFactor = GSVector4i(theApp.GetConfigI("upscale_multiplier"));
m_convert.cb->upload(&cb);
m_convert.cb->cache_upload(&cb);
vs = m_shader->Compile("convert.glsl", "vs_main", GL_VERTEX_SHADER, convert_glsl);
@ -1201,8 +1201,7 @@ void GSDeviceOGL::DoMerge(GSTexture* sTex[2], GSVector4* sRect, GSTexture* dTex,
if(sTex[0])
{
// TODO: potentially we could cache the value to avoid to upload every frame
m_merge_obj.cb->upload(&c.v);
m_merge_obj.cb->cache_upload(&c.v);
StretchRect(sTex[0], sRect[0], dTex, dRect[0], m_merge_obj.ps[mmod ? 1 : 0], m_MERGE_BLEND);
}
@ -1219,13 +1218,12 @@ void GSDeviceOGL::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool
GSVector4 sRect(0, 0, 1, 1);
GSVector4 dRect(0.0f, yoffset, s.x, s.y + yoffset);
// TODO: potentially we could cache the value to avoid to upload every frame
InterlaceConstantBuffer cb;
cb.ZrH = GSVector2(0, 1.0f / s.y);
cb.hH = s.y / 2;
m_interlace.cb->upload(&cb);
m_interlace.cb->cache_upload(&cb);
StretchRect(sTex, sRect, dTex, dRect, m_interlace.ps[shader], linear);
}
@ -1298,12 +1296,11 @@ void GSDeviceOGL::DoExternalFX(GSTexture* sTex, GSTexture* dTex)
ExternalFXConstantBuffer cb;
// TODO: potentially we could cache the value to avoid to upload every frame
cb.xyFrame = GSVector2((float)s.x, (float)s.y);
cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f);
cb.rcpFrameOpt = GSVector4::zero();
m_shaderfx.cb->upload(&cb);
m_shaderfx.cb->cache_upload(&cb);
StretchRect(sTex, sRect, dTex, dRect, m_shaderfx.ps, true);
}