Remove immediate mode from the Texture converter, probably need to redo this for texcache rewrite :/

This commit is contained in:
Ryan Houdek 2011-08-25 04:02:11 -05:00
parent a5a2562e59
commit 12a8f590f8
1 changed files with 35 additions and 13 deletions

View File

@ -213,13 +213,24 @@ void EncodeToRamUsingShader(FRAGMENTSHADER& shader, GLuint srcTexture, const Tar
PixelShaderCache::SetCurrentShader(shader.glprogid); PixelShaderCache::SetCurrentShader(shader.glprogid);
// Draw... GL_REPORT_ERRORD();
glBegin(GL_QUADS);
glTexCoord2f((float)sourceRc.left, (float)sourceRc.top); glVertex2f(-1,-1); GLfloat tex1[] = {
glTexCoord2f((float)sourceRc.left, (float)sourceRc.bottom); glVertex2f(-1,1); (float)sourceRc.left, (float)sourceRc.top,
glTexCoord2f((float)sourceRc.right, (float)sourceRc.bottom); glVertex2f(1,1); (float)sourceRc.left, (float)sourceRc.bottom,
glTexCoord2f((float)sourceRc.right, (float)sourceRc.top); glVertex2f(1,-1); (float)sourceRc.right, (float)sourceRc.bottom,
glEnd(); (float)sourceRc.right, (float)sourceRc.top
};
GLfloat vtx1[] = {
-1, -1, 1,
-1, 1, 1,
1, 1, 1,
1, -1, 1
};
glTexCoordPointer(2, GL_FLOAT, 0, tex1);
glVertexPointer(3, GL_FLOAT, 0, vtx1);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
GL_REPORT_ERRORD(); GL_REPORT_ERRORD();
// .. and then read back the results. // .. and then read back the results.
@ -458,12 +469,23 @@ void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTextur
GL_REPORT_ERRORD(); GL_REPORT_ERRORD();
glBegin(GL_QUADS); GLfloat tex1[] = {
glTexCoord2f((float)srcFmtWidth, (float)srcHeight); glVertex2f(1,-1); (float)srcFmtWidth, (float)srcHeight,
glTexCoord2f((float)srcFmtWidth, 0); glVertex2f(1,1); (float)srcFmtWidth, 0,
glTexCoord2f(0, 0); glVertex2f(-1,1); 0, 0,
glTexCoord2f(0, (float)srcHeight); glVertex2f(-1,-1); 0, (float)srcHeight
glEnd(); };
GLfloat vtx1[] = {
1, -1, 1,
1, 1, 1,
-1, 1, 1,
-1, -1, 1
};
glTexCoordPointer(2, GL_FLOAT, 0, tex1);
glVertexPointer(3, GL_FLOAT, 0, vtx1);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
GL_REPORT_ERRORD();
// reset state // reset state
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0);