Mostly formatting cleanup, but a couple of openGL related fixes : don't call state change functions if their params haven't changed. In particular, we call ClearScreen() in several places in the code, but BeginScene() already does this. According to several openGL performance guides I skimmed through, if you call clear more than once per frame draw, performance will suffer.
This seems to help with issue r103 - on my win machine, it's substantially better; on psp, not quite as drastic, but it's still better than before.
This commit is contained in:
+7
-4
@@ -362,10 +362,13 @@ void JRenderer::EnableVSync(bool flag)
|
||||
|
||||
void JRenderer::ClearScreen(PIXEL_TYPE color)
|
||||
{
|
||||
sceGuClearColor(color);
|
||||
//sceGuClearStencil( 0 );
|
||||
sceGuClear(GU_COLOR_BUFFER_BIT);
|
||||
//sceGuClear( GU_COLOR_BUFFER_BIT | GU_STENCIL_BUFFER_BIT );
|
||||
static PIXEL_TYPE previousColor = 0xFFFFFFFF;
|
||||
if (previousColor != color)
|
||||
{
|
||||
sceGuClearColor(color);
|
||||
sceGuClear(GU_COLOR_BUFFER_BIT);
|
||||
previousColor = color;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user