Mercurial > sdl-ios-xcode
view VisualC/SDLmain/SDLmain_VS2005.vcproj @ 5053:b5b42be9333c
Fixed bug #1026
Vittorio Giovara 2010-07-16 19:09:28 PDT
i was reading SDL_renderer_gles and i noticed that every time we there
is some gl call the gl state is modified with a couple of
glEnableClientState()/glDisableClientState.
While this is completely fine for desktops systems, this is a major
performace kill on mobile devices, right where opengles is
implemented.
Normal practice in this case is to update the glstate once, keep it
always the same and disable/enable other states only in very special
occasions.
On the web there's plenty of documentation (on the top of my head
http://developer.apple.com/iphone/library/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Performance/Performance.html#//apple_ref/doc/uid/TP40008793-CH105-SW5
) and i personally tried this.
I modified my code and got a 10 fps boost, then modified SDL_render_gles and
shifted from 40 fps to 50 fps alone -- considering that i started from ~30fps i
got an 80% performance increase with this technique.
I have attached a dif of my changes, hope that it will be included in
mainstream.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 19 Jan 2011 23:56:16 -0800 |
parents | 379361d5e425 |
children | e8916fe9cfc8 |
line wrap: on
line source
<?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="SDLmain" ProjectGUID="{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" RootNamespace="SDLmain" > <Platforms> <Platform Name="Win32" /> <Platform Name="x64" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Release|Win32" OutputDirectory=".\Release" IntermediateDirectory=".\Release" ConfigurationType="4" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > <Tool Name="VCPreBuildEventTool" Description="Making sure basic SDL headers are in place..." CommandLine="if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
echo Copying SDL_config_win32.h to SDL_config.h...
copy "$(ProjectDir)\..\..\include\SDL_config_win32.h" "$(ProjectDir)\..\..\include\SDL_config.h"
:SDLCONFIGOKAY

if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
echo Creating stub SDL_revision.h file...
echo #define SDL_REVISION 0 >"$(ProjectDir)\..\..\include\SDL_revision.h"
:SDLREVISIONOKAY
" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\include,..\..\include\SDL" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,NDEBUG,_WINDOWS" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" CompileAs="0" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" OutputFile="$(IntDir)\SDLmain.lib" SuppressStartupBanner="true" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Release|x64" OutputDirectory="$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="4" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\include,..\..\include\SDL" PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" CompileAs="0" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" OutputFile="$(IntDir)\SDLmain.lib" SuppressStartupBanner="true" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Release_NoSTDIO|Win32" OutputDirectory=".\Release_NOSTDIO" IntermediateDirectory=".\Release_NOSTDIO" ConfigurationType="4" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > <Tool Name="VCPreBuildEventTool" Description="Making sure basic SDL headers are in place..." CommandLine="if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
echo Copying SDL_config_win32.h to SDL_config.h...
copy "$(ProjectDir)\..\..\include\SDL_config_win32.h" "$(ProjectDir)\..\..\include\SDL_config.h"
:SDLCONFIGOKAY

if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
echo Creating stub SDL_revision.h file...
echo #define SDL_REVISION 0 >"$(ProjectDir)\..\..\include\SDL_revision.h"
:SDLREVISIONOKAY
" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\include,..\..\include\SDL" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,NDEBUG,_WINDOWS,NO_STDIO_REDIRECT" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" CompileAs="0" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" OutputFile="$(IntDir)\SDLmain.lib" SuppressStartupBanner="true" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Release_NoSTDIO|x64" OutputDirectory="$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="4" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\include,..\..\include\SDL" PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,NO_STDIO_REDIRECT" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" CompileAs="0" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" OutputFile="$(IntDir)\SDLmain.lib" SuppressStartupBanner="true" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ConfigurationType="4" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > <Tool Name="VCPreBuildEventTool" Description="Making sure basic SDL headers are in place..." CommandLine="if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
echo Copying SDL_config_win32.h to SDL_config.h...
copy "$(ProjectDir)\..\..\include\SDL_config_win32.h" "$(ProjectDir)\..\..\include\SDL_config.h"
:SDLCONFIGOKAY

if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
echo Creating stub SDL_revision.h file...
echo #define SDL_REVISION 0 >"$(ProjectDir)\..\..\include\SDL_revision.h"
:SDLREVISIONOKAY
" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\include,..\..\include\SDL" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,_DEBUG,_WINDOWS" RuntimeLibrary="2" WarningLevel="3" SuppressStartupBanner="true" DebugInformationFormat="1" CompileAs="0" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" OutputFile="$(IntDir)\SDLmain.lib" SuppressStartupBanner="true" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Debug|x64" OutputDirectory="$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="4" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\include,..\..\include\SDL" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS" RuntimeLibrary="2" WarningLevel="3" SuppressStartupBanner="true" DebugInformationFormat="1" CompileAs="0" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" OutputFile="$(IntDir)\SDLmain.lib" SuppressStartupBanner="true" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <File RelativePath="..\..\Src\Main\Win32\SDL_win32_main.c" > </File> </Files> <Globals> </Globals> </VisualStudioProject>