remove ubo for efb2ram

This commit is contained in:
degasus
2013-01-14 12:37:31 +01:00
parent f3d663c2f4
commit b18c0a5d1b
3 changed files with 28 additions and 37 deletions

View File

@ -61,6 +61,8 @@ static FRAGMENTSHADER s_ColorMatrixProgram;
static FRAGMENTSHADER s_DepthMatrixProgram;
static GLuint s_ColorMatrixUniform;
static GLuint s_DepthMatrixUniform;
static u32 s_ColorCbufid;
static u32 s_DepthCbufid;
static VERTEXSHADER s_vProgram;
struct VBOCache {
@ -318,10 +320,14 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
if(srcFormat == PIXELFMT_Z24) {
ProgramShaderCache::SetBothShaders(s_DepthMatrixProgram.glprogid, s_vProgram.glprogid);
glUniform4fv(s_DepthMatrixUniform, 5, colmat);
if(s_DepthCbufid != cbufid)
glUniform4fv(s_DepthMatrixUniform, 5, colmat);
s_DepthCbufid = cbufid;
} else {
ProgramShaderCache::SetBothShaders(s_ColorMatrixProgram.glprogid, s_vProgram.glprogid);
glUniform4fv(s_ColorMatrixUniform, 7, colmat);
if(s_ColorCbufid != cbufid)
glUniform4fv(s_ColorMatrixUniform, 7, colmat);
s_ColorCbufid = cbufid;
}
GL_REPORT_ERRORD();
@ -543,6 +549,8 @@ TextureCache::TextureCache()
s_ColorMatrixUniform = glGetUniformLocation(ProgramShaderCache::GetCurrentProgram(), "colmat");
ProgramShaderCache::SetBothShaders(s_DepthMatrixProgram.glprogid, s_vProgram.glprogid);
s_DepthMatrixUniform = glGetUniformLocation(ProgramShaderCache::GetCurrentProgram(), "colmat");
s_ColorCbufid = -1;
s_DepthCbufid = -1;
}

View File

@ -361,12 +361,14 @@ int EncodeToRamFromTexture(u32 address,GLuint source_texture, bool bFromZBuffer,
ProgramShaderCache::SetBothShaders(texconv_shader.glprogid, s_vProgram.glprogid);
float sampleStride = bScaleByHalf ? 2.f : 1.f;
TextureConversionShader::SetShaderParameters((float)expandedWidth,
(float)Renderer::EFBToScaledY(expandedHeight), // TODO: Why do we scale this?
(float)Renderer::EFBToScaledX(source.left),
(float)Renderer::EFBToScaledY(EFB_HEIGHT - source.top - expandedHeight),
Renderer::EFBToScaledXf(sampleStride),
Renderer::EFBToScaledYf(sampleStride));
float params[] = {
Renderer::EFBToScaledXf(sampleStride), Renderer::EFBToScaledYf(sampleStride),
0.0f, 0.0f,
(float)expandedWidth, (float)Renderer::EFBToScaledY(expandedHeight)-1,
(float)Renderer::EFBToScaledX(source.left), (float)Renderer::EFBToScaledY(EFB_HEIGHT - source.top - expandedHeight)
};
glUniform4fv(glGetUniformLocation(ProgramShaderCache::GetCurrentProgram(), I_COLORS), 2, params);
TargetRectangle scaledSource;
scaledSource.top = 0;