Some performance tweaks for the SDL OpenGL port. For reference,

I'm on a Celeron 766 with a crappy ATI card.  Under normal usage,
CPU usage has dropped from 60% to 8.5%.  But there is still a
slowdown when showing alpha-blended rectangles at the current
framerate.  I'm about to mark this up as being caused by the
crappy card and OpenGL implementation I'm using, so performance
may not get much better than this.  On my development system
(even before this latest patch), CPU usage never goes above 14%
(granted, that system is a P4-2.4 with GeForce4MX card).

I'll try to run on a similar system to this Celeron, but with
an NVidia card, and see if the ATI card drivers are actually
at fault.

But I really do think its the OpenGL drivers, since software
mode never uses more that 4% of the CPU, and that is at 1280x1024.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@212 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2003-11-18 15:04:17 +00:00
parent 6983686e91
commit 6a4af2b17a
2 changed files with 8 additions and 4 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: FrameBufferGL.cxx,v 1.4 2003-11-17 17:43:39 stephena Exp $ // $Id: FrameBufferGL.cxx,v 1.5 2003-11-18 15:04:17 stephena Exp $
//============================================================================ //============================================================================
#include <SDL.h> #include <SDL.h>
@ -218,7 +218,7 @@ bool FrameBufferGL::init()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::drawMediaSource() // FIXME - maybe less copying can be done? void FrameBufferGL::drawMediaSource()
{ {
// Copy the mediasource framebuffer to the RGB texture // Copy the mediasource framebuffer to the RGB texture
uInt8* currentFrame = myMediaSource->currentFrameBuffer(); uInt8* currentFrame = myMediaSource->currentFrameBuffer();
@ -253,6 +253,7 @@ void FrameBufferGL::drawMediaSource() // FIXME - maybe less copying can be done?
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, myTexture->w, myTexture->h, glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, myTexture->w, myTexture->h,
GL_RGBA, GL_UNSIGNED_BYTE, myTexture->pixels); GL_RGBA, GL_UNSIGNED_BYTE, myTexture->pixels);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glColor3f(0.0, 0.0, 0.0);
glBegin(GL_QUADS); glBegin(GL_QUADS);
glTexCoord2f(myTexCoord[0], myTexCoord[1]); glVertex2i(0, 0); glTexCoord2f(myTexCoord[0], myTexCoord[1]); glVertex2i(0, 0);
@ -260,6 +261,9 @@ void FrameBufferGL::drawMediaSource() // FIXME - maybe less copying can be done?
glTexCoord2f(myTexCoord[2], myTexCoord[3]); glVertex2i(myWidth, myHeight); glTexCoord2f(myTexCoord[2], myTexCoord[3]); glVertex2i(myWidth, myHeight);
glTexCoord2f(myTexCoord[0], myTexCoord[3]); glVertex2i(0, myHeight); glTexCoord2f(myTexCoord[0], myTexCoord[3]); glVertex2i(0, myHeight);
glEnd(); glEnd();
// The frame doesn't need to be completely redrawn anymore
theRedrawEntireFrameIndicator = false;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: SettingsUNIX.cxx,v 1.4 2003-11-17 17:43:39 stephena Exp $ // $Id: SettingsUNIX.cxx,v 1.5 2003-11-18 15:04:17 stephena Exp $
//============================================================================ //============================================================================
#include <cstdlib> #include <cstdlib>
@ -65,7 +65,7 @@ SettingsUNIX::SettingsUNIX()
set("video", "soft"); set("video", "soft");
#ifdef DISPLAY_OPENGL #ifdef DISPLAY_OPENGL
set("gl_filter", "nearest"); set("gl_filter", "nearest");
set("gl_aspect", "1"); set("gl_aspect", "2");
#endif #endif
set("sound", "oss"); set("sound", "oss");
set("fullscreen", "false"); set("fullscreen", "false");