Permalink
Browse files

Add a test case that draws a ludicrous number of bitmaps

  • Loading branch information...
1 parent 6c43f2b commit f3e56a02e274042f07a065961dcd6ec65cc6a49c @kg kg committed Jun 2, 2013
View
@@ -60,3 +60,5 @@ _ReSharper.*
/Squared/RenderPrecisionTest/RenderPrecisionTest/bin
/Squared/RenderPrecisionTest/RenderPrecisionTestContent/obj
/Squared/RenderPrecisionTest/RenderPrecisionTestContent/bin
+/Squared/LargeBufferTest/LargeBufferTest/obj
+/Squared/LargeBufferTest/LargeBufferTest/bin
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{8500D1B4-4BD9-4ED2-A7E6-AA64CCF4C73F}</ProjectGuid>
+ <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <OutputType>WinExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>LargeBufferTest</RootNamespace>
+ <AssemblyName>LargeBufferTest</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
+ <XnaPlatform>Windows</XnaPlatform>
+ <XnaProfile>HiDef</XnaProfile>
+ <XnaCrossPlatformGroupID>7bb8a6f3-a396-467f-adb3-a53dcd150e3b</XnaCrossPlatformGroupID>
+ <XnaOutputType>Game</XnaOutputType>
+ <ApplicationIcon>
+ </ApplicationIcon>
+ <Thumbnail>
+ </Thumbnail>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\x86\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <PlatformTarget>x86</PlatformTarget>
+ <XnaCompressContent>false</XnaCompressContent>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\x86\Release</OutputPath>
+ <DefineConstants>TRACE;WINDOWS</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <PlatformTarget>x86</PlatformTarget>
+ <XnaCompressContent>true</XnaCompressContent>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="mscorlib">
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System">
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Core">
+ <Private>False</Private>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Program.cs" />
+ <Compile Include="LargeBufferTestGame.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\GameLib\Squared.Game.csproj">
+ <Project>{36463AEE-E309-43A6-BCFA-A69944390AF0}</Project>
+ <Name>Squared.Game</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\RenderLib\Squared.Render.csproj">
+ <Project>{FE871F18-FD35-4124-AF8F-0021C9D4BA29}</Project>
+ <Name>Squared.Render</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Util\Squared.Util.csproj">
+ <Project>{D7F549CF-E0A6-491C-A78C-ECAB590BB2A7}</Project>
+ <Name>Squared.Util</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
+ <Visible>False</Visible>
+ <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Xna.Framework.4.0">
+ <Visible>False</Visible>
+ <ProductName>Microsoft XNA Framework Redistributable 4.0</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
+ <!--
+ To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Audio;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.GamerServices;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using Microsoft.Xna.Framework.Media;
+using Squared.Render;
+using Squared.Render.Convenience;
+
+namespace LargeBufferTest {
+ public class LargeBufferTestGame : MultithreadedGame {
+ public static readonly Color ClearColor = new Color(24, 96, 220, 255);
+
+ Texture2D WhitePixel;
+
+ DefaultMaterialSet Materials;
+ GraphicsDeviceManager Graphics;
+
+ public LargeBufferTestGame () {
+ Graphics = new GraphicsDeviceManager(this);
+ Graphics.PreferredBackBufferWidth = 1280;
+ Graphics.PreferredBackBufferHeight = 720;
+ Content.RootDirectory = "Content";
+ }
+
+ protected override void Initialize () {
+ Materials = new DefaultMaterialSet(Services);
+
+ base.Initialize();
+ }
+
+ protected override void LoadContent () {
+
+ WhitePixel = new Texture2D(GraphicsDevice, 1, 1);
+ WhitePixel.SetData(new Color[] { Color.White });
+ }
+
+ protected override void UnloadContent () {
+ }
+
+ protected override void Update (GameTime gameTime) {
+ base.Update(gameTime);
+ }
+
+ public override void Draw (GameTime gameTime, Frame frame) {
+ var ir = new ImperativeRenderer(frame, Materials);
+
+ ir.Clear(color: ClearColor);
+ ir.Layer += 1;
+
+ int width = 1280;
+ int height = 720;
+
+ for (var y = 0; y < height; y++)
+ for (var x = 0; x < width; x++)
+ ir.Draw(WhitePixel, x, y, multiplyColor: new Color(255, x % 255, y % 255));
+ }
+ }
+}
@@ -0,0 +1,20 @@
+using System;
+
+namespace LargeBufferTest {
+#if WINDOWS || XBOX
+ static class Program
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ static void Main(string[] args)
+ {
+ using (LargeBufferTestGame game = new LargeBufferTestGame())
+ {
+ game.Run();
+ }
+ }
+ }
+#endif
+}
+
View
@@ -46,7 +46,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DummyContentContainer", "Du
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RenderPrecisionTest", "RenderPrecisionTest\RenderPrecisionTest\RenderPrecisionTest.csproj", "{5A055035-0C3C-400E-AF41-3D1F7EB6E1AE}"
EndProject
-Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "RenderPrecisionTestContent", "RenderPrecisionTest\RenderPrecisionTestContent\RenderPrecisionTestContent.contentproj", "{7D0E8E01-408A-475C-9540-28F21F3C9E3F}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RenderPrecisionTestContent", "RenderPrecisionTest\RenderPrecisionTestContent\RenderPrecisionTestContent.contentproj", "{7D0E8E01-408A-475C-9540-28F21F3C9E3F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LargeBufferTest", "LargeBufferTest\LargeBufferTest\LargeBufferTest.csproj", "{8500D1B4-4BD9-4ED2-A7E6-AA64CCF4C73F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -171,6 +173,12 @@ Global
{7D0E8E01-408A-475C-9540-28F21F3C9E3F}.Debug|x86.ActiveCfg = Debug|x86
{7D0E8E01-408A-475C-9540-28F21F3C9E3F}.Mono|x86.ActiveCfg = Release|x86
{7D0E8E01-408A-475C-9540-28F21F3C9E3F}.Release|x86.ActiveCfg = Release|x86
+ {8500D1B4-4BD9-4ED2-A7E6-AA64CCF4C73F}.Debug|x86.ActiveCfg = Debug|x86
+ {8500D1B4-4BD9-4ED2-A7E6-AA64CCF4C73F}.Debug|x86.Build.0 = Debug|x86
+ {8500D1B4-4BD9-4ED2-A7E6-AA64CCF4C73F}.Mono|x86.ActiveCfg = Release|x86
+ {8500D1B4-4BD9-4ED2-A7E6-AA64CCF4C73F}.Mono|x86.Build.0 = Release|x86
+ {8500D1B4-4BD9-4ED2-A7E6-AA64CCF4C73F}.Release|x86.ActiveCfg = Release|x86
+ {8500D1B4-4BD9-4ED2-A7E6-AA64CCF4C73F}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

0 comments on commit f3e56a0

Please sign in to comment.