Mercurial > sdl-ios-xcode
view VisualC/tests/testalpha/testalpha_VS2010.vcxproj @ 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 | fc26fb7e20af |
children |
line wrap: on
line source
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectName>testalpha</ProjectName> <RootNamespace>testalpha</RootNamespace> <ProjectGuid>{7814D54B-65D3-4677-AD77-E0B980B4FA2D}</ProjectGuid> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseOfMfc>false</UseOfMfc> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseOfMfc>false</UseOfMfc> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup> <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <Midl> <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <MkTypLibCompatible>true</MkTypLibCompatible> <SuppressStartupBanner>true</SuppressStartupBanner> <TargetEnvironment>Win32</TargetEnvironment> <TypeLibraryName>.\Debug/testalpha.tlb</TypeLibraryName> </Midl> <ClCompile> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <PrecompiledHeader> </PrecompiledHeader> <PrecompiledHeaderOutputFile>.\Debug/testalpha.pch</PrecompiledHeaderOutputFile> <AssemblerListingLocation>.\Debug/</AssemblerListingLocation> <ObjectFileName>.\Debug/</ObjectFileName> <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName> <WarningLevel>Level3</WarningLevel> <SuppressStartupBanner>true</SuppressStartupBanner> <DebugInformationFormat>EditAndContinue</DebugInformationFormat> <CompileAs>Default</CompileAs> </ClCompile> <ResourceCompile> <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <Culture>0x0409</Culture> </ResourceCompile> <Link> <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions> <OutputFile>.\Debug/testalpha.exe</OutputFile> <SuppressStartupBanner>true</SuppressStartupBanner> <GenerateDebugInformation>true</GenerateDebugInformation> <ProgramDatabaseFile>.\Debug/testalpha.pdb</ProgramDatabaseFile> <SubSystem>Windows</SubSystem> </Link> <PostBuildEvent> <Command>copy $(SolutionDir)\SDL\$(ConfigurationName)\SDL.dll $(TargetDir)\SDL.dll copy $(SolutionDir)\..\test\icon.bmp $(ProjectDir)\icon.bmp</Command> </PostBuildEvent> <PostBuildEvent> <Message>Copy SDL and data files</Message> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <Midl> <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <MkTypLibCompatible>true</MkTypLibCompatible> <SuppressStartupBanner>true</SuppressStartupBanner> <TargetEnvironment>Win32</TargetEnvironment> <TypeLibraryName>.\Release/testalpha.tlb</TypeLibraryName> </Midl> <ClCompile> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <FunctionLevelLinking>true</FunctionLevelLinking> <PrecompiledHeader> </PrecompiledHeader> <PrecompiledHeaderOutputFile>.\Release/testalpha.pch</PrecompiledHeaderOutputFile> <AssemblerListingLocation>.\Release/</AssemblerListingLocation> <ObjectFileName>.\Release/</ObjectFileName> <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName> <WarningLevel>Level3</WarningLevel> <SuppressStartupBanner>true</SuppressStartupBanner> <CompileAs>Default</CompileAs> </ClCompile> <ResourceCompile> <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <Culture>0x0409</Culture> </ResourceCompile> <Link> <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions> <OutputFile>.\Release/testalpha.exe</OutputFile> <SuppressStartupBanner>true</SuppressStartupBanner> <ProgramDatabaseFile>.\Release/testalpha.pdb</ProgramDatabaseFile> <SubSystem>Windows</SubSystem> </Link> <PostBuildEvent> <Command>copy $(SolutionDir)\SDL\$(ConfigurationName)\SDL.dll $(TargetDir)\SDL.dll copy $(SolutionDir)\..\test\icon.bmp $(ProjectDir)\icon.bmp</Command> </PostBuildEvent> <PostBuildEvent> <Message>Copy SDL and data files</Message> </PostBuildEvent> </ItemDefinitionGroup> <ItemGroup> <Library Include="..\..\Sdl\Debug\SDL.lib" /> <Library Include="..\..\SDLmain\Debug\SDLmain.lib" /> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\..\Test\testalpha.c" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> </Project>